-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat: switch app-builder-bin to node-module-collector to get all production node modules #8571
base: master
Are you sure you want to change the base?
feat: switch app-builder-bin to node-module-collector to get all production node modules #8571
Conversation
@mmaietta Please help review again. |
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.
Note: There's some util functions already existing in builder-util/src/util
and builder-util/src/fs
that we could leverage to reduce duplicated code and improve debug logging
packages/app-builder-lib/src/node-module-collector/nodeModulesCollector.ts
Outdated
Show resolved
Hide resolved
packages/app-builder-lib/src/node-module-collector/nodeModulesCollector.ts
Outdated
Show resolved
Hide resolved
packages/app-builder-lib/src/node-module-collector/packageManager.ts
Outdated
Show resolved
Hide resolved
packages/app-builder-lib/src/node-module-collector/pnpmNodeModulesCollector.ts
Outdated
Show resolved
Hide resolved
packages/app-builder-lib/src/node-module-collector/packageManager.ts
Outdated
Show resolved
Hide resolved
packages/app-builder-lib/src/node-module-collector/nodeModulesCollector.ts
Outdated
Show resolved
Hide resolved
packages/app-builder-lib/src/node-module-collector/packageManager.ts
Outdated
Show resolved
Hide resolved
Excellent suggestions, all changes have been implemented. |
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 awesome, great work!
change app-builder-bin to node-module-collector(typescript)
Design
Support
Performance vs app-builder-bin
This is an IO-intensive task, primarily involving reading files and traversing the entire dependency tree. Node.js is capable of handling such IO-intensive tasks without issues.
Based on my personal testing, there's essentially no difference in performance
Advantages
unlike the previous app-builder-bin which only searched for all node_modules without optimizing. For example, if a module has one version in the dev node_modules dependencies, another in the root node_modules, and yet another version with multiple dependencies in the production node_modules, it results in multiple duplicate modules in the production node_modules. Now, hoisting is applied in such situations, reducing these duplicate packages.