Commit graph

24 commits

Author SHA1 Message Date
Samuel Attard
b6ec19a582
fix: support the throwIfNoEntry option to statSync and lstatSync in asar files (#40221) 2023-10-16 09:35:25 -07:00
Milan Burda
d75a852743
refactor: use type enum in file stats for asar archive (#39889) 2023-09-25 13:17:24 +02:00
Samuel Attard
16aec702b4
fix: ensure app load is limited to real asar files when appropriate (#39788) 2023-09-11 11:51:14 -07:00
Milan Burda
e71a56d11e
refactor: const Module = require('module') as NodeJS.ModuleInternal; (#38757)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2023-09-06 18:04:25 -04:00
Samuel Attard
ac031bf8de
feat: I guess it's esm (#37535)
* fix: allow ESM loads from within ASAR files

* fix: ensure that ESM entry points finish loading before app ready

* fix: allow loading ESM entrypoints via default_app

* fix: allow ESM loading for renderer preloads

* docs: document current known limitations of esm

* chore: add patches to support blending esm handlers

* refactor: use SetDefersLoading instead of JoinAppCode in renderers

Blink has it's own event loop so pumping the uv loop in the renderer is not enough, luckily in blink we can suspend the loading of the frame while we do additional work.

* chore: add patch to expose SetDefersLoading

* fix: use fileURLToPath instead of pathname

* chore: update per PR feedback

* fix: fs.exists/existsSync should never throw

* fix: convert path to file url before importing

* fix: oops

* fix: oops

* Update docs/tutorial/esm-limitations.md

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

* windows...

* windows...

* chore: update patches

* spec: fix tests and document empty body edge case

* Apply suggestions from code review

Co-authored-by: Daniel Scalzi <d_scalzi@yahoo.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>

* spec: add tests for esm

* spec: windows

* chore: update per PR feedback

* chore: update patches

* Update shell/common/node_bindings.h

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

* chore: update patches

* rebase

* use cjs loader by default for preload scripts

* chore: fix lint

* chore: update patches

* chore: update patches

* chore: fix patches

* build: debug depshash

* ?

* Revert "build: debug depshash"

This reverts commit 0de82523fb93f475226356b37418ce4b69acdcdf.

* chore: allow electron as builtin protocol in esm loader

* Revert "Revert "build: debug depshash""

This reverts commit ff86b1243ca6d05c9b3b38e0a6d717fb380343a4.

* chore: fix esm doc

* chore: update node patches

---------

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: electron-patch-conflict-fixer[bot] <83340002+electron-patch-conflict-fixer[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Daniel Scalzi <d_scalzi@yahoo.com>
2023-08-30 17:38:07 -07:00
Milan Burda
dc2e822dc7
fix: asar integration for require('node:child_process') (#38742) 2023-06-14 18:03:53 +09:00
Milan Burda
82af000a37
chore: cleanup eslint suppressions (#38417)
* chore: cleanup eslint suppressions

* address feedback

* revert script/lib/azput.js

* revert spec/fixtures/apps/remote-control/main.js

* address feedback

* revert typings/internal-ambient.d.ts
2023-05-25 10:09:17 +09:00
David Sanders
168726a052
fix: handle null/undefined options for fs.readdir (#34764) 2023-01-10 12:16:39 +01:00
electron-roller[bot]
d0e220cbce
chore: bump node to v16.17.0 (main) (#35350)
* chore: bump node in DEPS to v16.17.0

* chore: fixup asar patch

* lib: use null-prototype objects for property descriptors

https://github.com/nodejs/node/pull/43270

* src: make SecureContext fields private

https://github.com/nodejs/node/pull/43173

* crypto: remove Node.js-specific webcrypto extensions

https://github.com/nodejs/node/pull/43310

* test: refactor to top-level await

https://github.com/nodejs/node/pull/43500

* deps: cherry-pick two libuv fixes

https://github.com/nodejs/node/pull/43950

* src: slim down env-inl.h

https://github.com/nodejs/node/pull/43745

* util: add AggregateError.prototype.errors to inspect output

https://github.com/nodejs/node/pull/43646

* esm: improve performance & tidy tests

https://github.com/nodejs/node/pull/43784

* src: NodeArrayBufferAllocator delegates to v8's allocator

https://github.com/nodejs/node/pull/43594

* chore: update patch indices

* chore: update filenames

* src: refactor IsSupportedAuthenticatedMode

https://github.com/nodejs/node/pull/42368

* src: add --openssl-legacy-provider option

https://github.com/nodejs/node/pull/40478

* lib,src: add source map support for global eval

https://github.com/nodejs/node/pull/43428

* trace_events: trace net connect event

https://github.com/nodejs/node/pull/43903

* deps: update ICU to 71.1

https://github.com/nodejs/node/pull/42655

This fails the test because it's missing https://chromium-review.googlesource.com/c/chromium/deps/icu/+/3841093

* lib: give names to promisified exists() and question()

https://github.com/nodejs/node/pull/43218

* crypto: add CFRG curves to Web Crypto API

https://github.com/nodejs/node/pull/42507

* src: fix memory leak for v8.serialize

https://github.com/nodejs/node/pull/42695

This test does not work for Electron as they do not use V8's
ArrayBufferAllocator.

* buffer: fix atob input validation

https://github.com/nodejs/node/pull/42539

* src: fix ssize_t error from nghttp2.h

https://github.com/nodejs/node/pull/44393

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-08-29 09:55:36 -04:00
Milan Burda
34b985c556
refactor: use optional chaining / nullish coalescing operator (#35217) 2022-08-08 10:11:04 +02:00
Fedor Indutny
06a00b74e8
fix: initialize asar support in worker threads (#33216)
* fix: initialize asar support in worker threads

Use `ObjectWrap` instead of gin's Wrap in `electron_api_asar.cc` because
gin isn't fully initialized (and apparently not possible to initialize
without ruining the isolate configuration and array buffer allocator) in
worker threads. In the worker thread call `setupAsarSupport` just as we
do for the main process.

* Update lib/asar/fs-wrapper.ts

Co-authored-by: Darshan Sen <raisinten@gmail.com>

* Update patches/node/worker_thread_add_asar_support.patch

Co-authored-by: Darshan Sen <raisinten@gmail.com>

* Add a test

Co-authored-by: Darshan Sen <raisinten@gmail.com>
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-03-22 20:37:55 -04:00
Samuel Attard
57d088517c
feat: add support for validating asar archives on macOS (#30667)
* feat: add support for validating asar archives on macOS

* chore: fix lint

* chore: update as per feedback

* feat: switch implementation to asar integrity hash checks

* feat: make ranged requests work with the asar file validator DataSourceFilter

* chore: fix lint

* chore: fix missing log include on non-darwin

* fix: do not pull block size out of missing optional

* fix: match ValidateOrDie symbol on non-darwin

* chore: fix up asar specs by repacking archives

* fix: maintain integrity chain, do not load file integrity if header integrity was not loaded

* debug test

* Update node-spec.ts

* fix: initialize header_validated_

* chore: update PR per feedback

* chore: update per feedback

* build: use final asar module

* Update fuses.json5
2021-09-09 14:49:01 -07:00
Shelley Vohr
a4decffe9a
fix: improper wrapping of fs.promises.readFile (#29528) 2021-06-07 21:19:39 +02:00
Milan Burda
8d0ed05c99
refactor: replace a few usages of V8 hidden properties (#29400) 2021-06-03 14:59:56 +09:00
Jeremy Rose
d27ad0d182
fix: revert "refactor: mmap asar files (#24470)" (#28137)
This reverts commit 01a2e23194.
2021-03-15 11:42:54 -07:00
Milan Burda
79b3393768
chore: remove bunch of usages of any (#27512) 2021-01-29 12:41:59 -08:00
Avi Vahl
9b02d94e97
fix(asar): readdir(withFileTypes) fails on deep directory (#26865)
when using readdirSync on a deep directory within the archive, the code fails to get the stats of child paths.
2020-12-15 11:21:49 +09:00
Vadim
efca7007b6
fix: internalModuleReadJSON for unpacked JSON (#26749) 2020-12-01 21:33:39 -08:00
Fabio Spampinato
d4191c4a26
fix: optimized asar paths checks (#26024)
* fix: optimized asar paths checks

* fix: ensuring the linter is happy
2020-10-26 12:19:35 +09:00
Milan Burda
321395d96e
refactor: use Map instead of Object for better semantics (#25982) 2020-10-19 03:24:51 +03:00
Milan Burda
fb11a12d5b
refactor: replace a few any-s with proper types (#25681) 2020-10-08 03:01:23 +02:00
Jeremy Rose
01a2e23194
refactor: mmap asar files (#24470) 2020-08-04 11:48:04 -07:00
Electron Bot
2f02a469f4
chore: bump node to v12.18.3 (master) (#24707)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-07-27 09:12:29 -07:00
Samuel Attard
f649e604be
build: tsify asar and move to webpack js2c pipeline (#24495)
* build: tsify asar and move to webpack js2c pipeline

* build: use the webpack provider for fs-wrapper
2020-07-16 11:38:31 -07:00