-
Notifications
You must be signed in to change notification settings - Fork 6
Add unstable_alias and fix alias self references #898
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
🦋 Changeset detectedLatest commit: f0c7821 The changes in this PR will be included in the next version bump. This PR includes changesets to release 109 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| self.map.get(specifier) | ||
| } | ||
|
|
||
| pub fn resolve_alias(&self, specifier: &Specifier) -> Option<Cow<'_, AliasValue>> { |
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.
The diff makes this look like all new code but it's just mostly moved from package_json.rs
| && path == self.from | ||
| { | ||
| // Don't resolve alias that points to itself. | ||
| return Ok(None); |
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.
This is the circular self reference fix
📊 Type Coverage ReportCoverage Comparison
Files with Most Type Issues (Top 15)
This report was generated by the Type Coverage GitHub Action |
📊 Benchmark Results🎉 Performance improvements detected! 📊 Benchmark ResultsOverall Performance
🔍 Detailed Phase AnalysisThree.js Real Repository (JS)
Three.js Real Repository (Native)
💾 Unified Memory AnalysisThree.js Real Repository (JS) Memory Statistics
Sample Counts: JS: 6, Native: 284 Three.js Real Repository (Native) Memory Statistics
Sample Counts: JS: 6, Native: 648 🖥️ Environment
|
marcins
left a comment
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.
LGTM!
This PR makes the following changes to the node resolver:
alias.rsfileunstable_aliaswhich allows you to configure build specific aliases, rather than project wide onesunstable_aliasTo remove our reliance on custom resolvers, this PR adds a new
unstable_aliasfeature which let's you configure resolver aliases in the.parcelrc. The feature is currently a little half-baked as it's only supported in V3 builds and doesn't support config extending (only the top-level .parcelrc will be used). I've only added it to V3 as you'd have add code to each resolver plugin to make it work and the intention is to move away from custom resolvers, not add to them.I didn't bother with extension support as this is really just a stepping stone feature before we get to the config file reboot. Outside of this above, the aliasing features should work as exactly the same as the one defined in package.json.
You can also continue to use the package.json ones alongside the
unstable_aliasones. You'd want to do this if you have aliases that are actually valid for the whole project.Checklist