-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix: remove implicit dependencies handling #9010
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: remove implicit dependencies handling #9010
Conversation
🦋 Changeset detectedLatest commit: c52f08b The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 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 |
… and NpmNodeModulesCollector
The HoistedNodeModuleTest did not run, and there are several others under this category that were also skipped. This might be caused by issues with parallel testing. @mmaietta When you have time, could you help take a look at this?
|
…lector and PnpmNodeModulesCollector
1fb9db1
to
212eba2
Compare
…dd it back in PnpmNodeModulesCollector
packages/app-builder-lib/src/node-module-collector/npmNodeModulesCollector.ts
Show resolved
Hide resolved
packages/app-builder-lib/src/node-module-collector/npmNodeModulesCollector.ts
Outdated
Show resolved
Hide resolved
packages/app-builder-lib/src/node-module-collector/pnpmNodeModulesCollector.ts
Outdated
Show resolved
Hide resolved
Fantastic work on this PR! |
fix #9000 and #9006
Root Cause
It directly copies
node_modules
into the app directory and removesdevDependencies
frompackage.json
. This way,npm list
can retrieve all dependencies. However, during the lookup process, if there are duplicate dependency packages, somedependencies
innpm
may be empty. A previous fix(#8864 ) introduced the concept ofimplicit dependencies
to address this issue, but it only handled the first level ofimplicit dependencies
. Ifimplicit dependencies
themselves contain furtherimplicit dependencies
, the problem described in #9000 will occur.How to fix
The current approach directly searches the
parsedTree
and updates the globalthis.productionGraph
. If there are cases wheredependencies
are empty, it retrieves the same dependency fromallDependencies
and performs a lookup for sub-dependencies. If the dependency already exists inthis.productionGraph
, no further lookup is performed. Additionally, to prevent infinite loops, an empty array is set before searching for sub-dependencies.Now that two tree lookup has been eliminated, there will be a certain improvement in performance.