Verify version when resolving Node builtin polyfills#8387
Merged
Conversation
6092f6a to
69ef97a
Compare
69ef97a to
02290e2
Compare
devongovett
reviewed
Aug 25, 2022
65884f9 to
4ecff55
Compare
mischnic
commented
Aug 31, 2022
| "mocha-junit-reporter": "^2.0.0", | ||
| "mocha-multi-reporters": "^1.5.1", | ||
| "prettier": "2.4.1", | ||
| "punycode": "^1.4.1", |
Member
Author
There was a problem hiding this comment.
The url polyfill package declares punycode as a dependency
but then does require("punycode") which uses the node polyfill (as opposed to require("punycode/")). I needed to declare this version to get the integration tests to pass....
devongovett
approved these changes
Sep 3, 2022
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
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 will call
packageManager.resolvefor every resolution of a Node builtin with the correct range that should be used to catch cases where another instance of some Node builtin polyfill was pulled in by some other dependency, be it in the same package, or in a monorepo situationIf it's the wrong version, it will either autoinstall, or error (using the existing autoinstall logic):
Questions:
Previously, the polyfill was resolved from the actual source file but autoinstalled into the project root. We either need to install it into the local package (what I've done now), or resolve it relative from the monorepo root. (So that resolution base = autoinstall target)Now, all builtin polyfills are resolved from the project rootpackageManager.resolveis slow? I suspect there won't be that many Node builtins anyway