Skip to content

Conversation

@indutny-signal
Copy link
Contributor

Description of Change

Extend HostImportModuleWithPhaseDynamically's routing to support Node.js import resolution in non-context-isolated preloads through v8_host_defined_options length check. The length of host defined options is distinct between Blink and Node.js and we can use it to determine which resolver to use.

Checklist

Release Notes

Notes: Support dynamic ESM imports in non-context isolated preloads

cc @MarshallOfSound

@indutny-signal indutny-signal requested a review from a team as a code owner September 24, 2025 20:50
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Sep 24, 2025
@indutny-signal indutny-signal changed the title Dynamic ESM import in non-context-isolated preload feat: dynamic ESM import in preload without context isolation Sep 24, 2025
@deepak1556
Copy link
Member

Can you rebase on latest main to address the CI failure

12:00:00 +0000"
/Users/runner/work/_temp/993dcffc-8ae2-48f4-be38-ba2e8e2e83ef.sh: line 2: src/electron/script/actions/screencapture-nag-remover.sh: No such file or directory

@deepak1556 deepak1556 added semver/minor backwards-compatible functionality target/38-x-y PR should also be added to the "38-x-y" branch. target/39-x-y PR should also be added to the "39-x-y" branch. labels Sep 25, 2025
@deepak1556 deepak1556 added target/37-x-y PR should also be added to the "37-x-y" branch. and removed api-review/requested 🗳 labels Sep 25, 2025
@indutny-signal indutny-signal force-pushed the feature/esm-in-non-context-isolated-preload branch from f8fd799 to eefce0c Compare September 25, 2025 14:08
@indutny-signal
Copy link
Contributor Author

@deepak1556 you got it!

Copy link
Member

@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation LGTM 👍

@indutny-signal indutny-signal force-pushed the feature/esm-in-non-context-isolated-preload branch from eefce0c to 652f656 Compare September 26, 2025 00:02
Extend `HostImportModuleWithPhaseDynamically`'s routing to support
Node.js import resolution in non-context-isolated preloads through
`v8_host_defined_options` length check. The length of host defined
options is distinct between Blink and Node.js and we can use it to
determine which resolver to use.
@indutny-signal indutny-signal force-pushed the feature/esm-in-non-context-isolated-preload branch from 652f656 to 475a0a7 Compare September 26, 2025 00:02
Copy link
Member

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Oct 1, 2025
@codebytere
Copy link
Member

API LGTM

@codebytere codebytere merged commit e8e91c3 into electron:main Oct 8, 2025
61 checks passed
@release-clerk
Copy link

release-clerk bot commented Oct 8, 2025

Release Notes Persisted

Support dynamic ESM imports in non-context isolated preloads

@trop
Copy link
Contributor

trop bot commented Oct 8, 2025

I have automatically backported this PR to "37-x-y", please check out #48487

@trop
Copy link
Contributor

trop bot commented Oct 8, 2025

I have automatically backported this PR to "39-x-y", please check out #48488

@trop
Copy link
Contributor

trop bot commented Oct 8, 2025

I have automatically backported this PR to "38-x-y", please check out #48489

@trop trop bot added in-flight/37-x-y in-flight/39-x-y in-flight/38-x-y and removed target/37-x-y PR should also be added to the "37-x-y" branch. target/39-x-y PR should also be added to the "39-x-y" branch. target/38-x-y PR should also be added to the "38-x-y" branch. labels Oct 8, 2025
@indutny-signal indutny-signal deleted the feature/esm-in-non-context-isolated-preload branch October 8, 2025 17:28
@indutny-signal
Copy link
Contributor Author

Thank you everyone!

@trop trop bot added merged/39-x-y PR was merged to the "39-x-y" branch. merged/38-x-y PR was merged to the "38-x-y" branch. merged/37-x-y PR was merged to the "37-x-y" branch. and removed in-flight/39-x-y in-flight/38-x-y in-flight/37-x-y labels Oct 21, 2025
TheCommieAxolotl pushed a commit to TheCommieAxolotl/electron that referenced this pull request Nov 2, 2025
…on#48375)

Dynamic ESM import in non-context-isolated preload

Extend `HostImportModuleWithPhaseDynamically`'s routing to support
Node.js import resolution in non-context-isolated preloads through
`v8_host_defined_options` length check. The length of host defined
options is distinct between Blink and Node.js and we can use it to
determine which resolver to use.
nilayarya pushed a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
…on#48375)

Dynamic ESM import in non-context-isolated preload

Extend `HostImportModuleWithPhaseDynamically`'s routing to support
Node.js import resolution in non-context-isolated preloads through
`v8_host_defined_options` length check. The length of host defined
options is distinct between Blink and Node.js and we can use it to
determine which resolver to use.
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
…on#48375)

Dynamic ESM import in non-context-isolated preload

Extend `HostImportModuleWithPhaseDynamically`'s routing to support
Node.js import resolution in non-context-isolated preloads through
`v8_host_defined_options` length check. The length of host defined
options is distinct between Blink and Node.js and we can use it to
determine which resolver to use.
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
…on#48375)

Dynamic ESM import in non-context-isolated preload

Extend `HostImportModuleWithPhaseDynamically`'s routing to support
Node.js import resolution in non-context-isolated preloads through
`v8_host_defined_options` length check. The length of host defined
options is distinct between Blink and Node.js and we can use it to
determine which resolver to use.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-review/approved ✅ merged/37-x-y PR was merged to the "37-x-y" branch. merged/38-x-y PR was merged to the "38-x-y" branch. merged/39-x-y PR was merged to the "39-x-y" branch. semver/minor backwards-compatible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants