Skip to content
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

fix(externals): keep both version of conflicting dependencies #758

Closed
wants to merge 27 commits into from

Conversation

mahdiboomeri
Copy link
Contributor

@mahdiboomeri mahdiboomeri commented Dec 15, 2022

πŸ”— Linked issue

resolves #722
potentially resolves #612

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR keeps both versions of conflicting dependencies by nesting them inside their parent.
It also introduces a new nitro option called optimizeExternals which allows you to manually include or exclude specific packages to the optimization process.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@vercel
Copy link

vercel bot commented Dec 17, 2022

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Updated
unjs-nitro πŸ”„ Building (Inspect) Dec 23, 2022 at 10:50AM (UTC)

@itpropro
Copy link
Contributor

Any feedback to this PR @pi0?

@mahdiboomeri mahdiboomeri marked this pull request as ready for review December 21, 2022 22:30
@codecov
Copy link

codecov bot commented Dec 22, 2022

Codecov Report

Merging #758 (158675b) into main (0106bd1) will increase coverage by 0.30%.
The diff coverage is 91.48%.

@@            Coverage Diff             @@
##             main     #758      +/-   ##
==========================================
+ Coverage   70.07%   70.37%   +0.30%     
==========================================
  Files          57       57              
  Lines        5229     5377     +148     
  Branches      575      600      +25     
==========================================
+ Hits         3664     3784     +120     
- Misses       1556     1584      +28     
  Partials        9        9              
Impacted Files Coverage Ξ”
src/utils/tree.ts 12.12% <0.00%> (ΓΈ)
src/build.ts 45.00% <50.00%> (ΓΈ)
src/rollup/plugins/externals.ts 90.14% <94.31%> (-4.17%) ⬇️
src/rollup/config.ts 91.60% <100.00%> (+0.01%) ⬆️
src/types/nitro.ts 100.00% <100.00%> (ΓΈ)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@pi0
Copy link
Member

pi0 commented Dec 23, 2022

Thanks legendary @mahdiboomeri for this implementation πŸ’―

During the local review, I found that we could improve overall implementation and performances by using pre-resolved data structures for traced files and packages and then apply new strategy from this. I have moved the additions and explanation to ~> #782 before merging them together. Please feel free to try it and suggest or directly make PR in top of it if i missed something.

Cheers.

@pi0 pi0 closed this Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

externalized packages aren't traced properly Problems with module resolution in nitro
3 participants