-
Notifications
You must be signed in to change notification settings - Fork 16.3k
fix: importing from electron/utility in ESM #47998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM
Is it possible to put these sparse definitions of module names in one file? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems incorrect that allowing electron/main
and electron/renderer
in the utility process. These namespaces are for type level separation only and the actual available module list is controlled elsewhere. However it would be nice to make the behavior at type level match what we mention as allowed in the docs.
Not a blocker for this PR, would be a nice follow-up.
@deepak1556, agreed on it being something for a follow-up rather than this PR. This behavior is consistent with this comment in the code, so if we want to revisit this behavior we should be sure to update the comment: Lines 104 to 109 in 51add3e
|
Release Notes Persisted
|
I have automatically backported this PR to "38-x-y", please check out #48019 |
I have automatically backported this PR to "36-x-y", please check out #48020 |
I have automatically backported this PR to "37-x-y", please check out #48021 |
Description of Change
Follow-up to #47968. I missed that there's a patch to handle the
electron/*
module imports in ESM mode, as I'd only tested CJS. Our test coverage was a bit sparse so I expanded it to cover both ESM and CJS code paths for the utility process and added additional ESM coverage for these imports across the board.Checklist
npm test
passesRelease Notes
Notes: Fixed an issue where importing from
electron/utility
in an ESM file threw an error at runtime