electron/lib
trop[bot] 785193e858
fix: don't copy 'package.json's out of ASAR file (#46478)
* fix: don't copy 'package.json's out of ASAR file

New Node.js module resolution system reads `package.json` from imported
modules by reading from the file natively in C++ without calling into
`fs.readFileSync`. The ASAR FS wrapper code had copied files out into a
temporary folder as a workaround, but it is inefficient and does not
cover all module resolution mechanisms in Node.js.

In this change we expose `overrideReadFileSync` method on the `modules`
binding in Node.js, and use this override to call into ASAR-supporting
`fs.readFileSync`.

Co-authored-by: Fedor Indutny <indutny@signal.org>

* chore: remove erroneous patch

* chore: re-add line ending

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Fedor Indutny <indutny@signal.org>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-03 22:26:44 -07:00
..
browser chore: deprecate systemPreferences.isAeroGlassEnabled() (#45554) 2025-02-18 16:29:41 -05:00
common build: add import/order eslint rule (#44085) 2024-10-02 19:10:44 -07:00
isolated_renderer refactor: cleanup global variable declarations (#38410) 2023-05-24 20:01:07 +02:00
node fix: don't copy 'package.json's out of ASAR file (#46478) 2025-04-03 22:26:44 -07:00
preload_realm feat: service worker preload scripts for improved extensions support … (#45408) 2025-02-05 14:18:24 -05:00
renderer feat: service worker preload scripts for improved extensions support … (#45408) 2025-02-05 14:18:24 -05:00
sandboxed_renderer feat: service worker preload scripts for improved extensions support … (#45408) 2025-02-05 14:18:24 -05:00
utility build: add import/order eslint rule (#44085) 2024-10-02 19:10:44 -07:00
worker fix: EventSource undefined in Renderer/Worker (#44475) 2024-10-31 15:24:44 -04:00