-
Notifications
You must be signed in to change notification settings - Fork 434
NodeJS Compat: Process Compat via Separate Implementation #4446
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The generated output of |
anonrig
reviewed
Jul 2, 2025
a077341
to
7b8a70b
Compare
anonrig
reviewed
Jul 2, 2025
efe209d
to
306b228
Compare
87ea720
to
79a3227
Compare
CodSpeed Performance ReportMerging #4446 will not alter performanceComparing Summary
|
jasnell
reviewed
Jul 3, 2025
jasnell
approved these changes
Jul 3, 2025
…"""" This reverts commit e940848.
…dir(), umask()"" This reverts commit 9e7e656.
…features"" This reverts commit c1a74fa.
Co-authored-by: Yagiz Nizipli <[email protected]>
79a3227
to
566b232
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This reincludes the unrevert of the original PR from #4271 and all of its features, along with the unrevert of the compatibility flag introduced in #4350.
Then to ensure compatibility, instead of exporting undefined named exports for process features when not using the
enable_nodejs_process_v2
compatibility flag, two entirely separate process implementations are provided as internal modules -node-internal:public_process
for the new implementation andnode-internal:legacy_process
for the former implementation. Implementation internals are then shared as suitable through the internal process module as well.Then in the resolver, we detect
node:process
andprocess
imports and direct those to eithernode-internal:public_process
ornode-internal:legacy_process
depending on the compat flag.process.getBuiltinModule
also has a similar switch logic along with the global getter function forglobalThis.process
.Tests are added for the legacy process module to ensure it does not contain unexpected properties. In this way, full compatibility is maintained for all users not using the new process implementation.
New process features remain identical to the original summary in #4271.
Stdio and FS integrations remain pending for removing experimental.
While working on this I noticed the Node.js LTS version already bumped a minor - Claude was able to cook up a script to bump this automatically for us which is also added here as
just update-reported-node-version
for convenience.