-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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: add "skipHastePackages" option #7778
Conversation
This is another one for the FB people to review, sorry about that 😅 (it'll need a changelog entry, though) |
👍LGTM! We'll use this in Metro too. cc @rafeca (we recently discussed about it). |
@mjesun how were you thinking of using this in Metro? We depend on this behavior at FB. Did you mean to disable this by default for open source? |
Some people using Metro internally at FB (but outside of RN) have run into similar issues due to global packages duplications (/cc @tjfryan ), allowing Metro to ignore haste packages would simplify their setups. |
@cpojer This option is false by default, so it shouldn't affect FB internals. LGTM? |
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.
Could you rebase this now that we are using TypeScript?
I don't think the name |
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.
Missing changelog entry (and I think the name of the option is imprecise)
953661d
to
bcb1024
Compare
Good to go 👍 |
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.
Thank you.
how do i use this flag ? |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
The
skipHastePackages
option prevents reading ofpackage.json
files and keeps them out of the module map. It's important to fixing package deduplication in Metro (see here: facebook/metro#350), especially after symlink support is merged (see here: facebook/metro#257).With support for symlinks in
node_modules
, it's very easy for the dependencies of one "locally developed" package to collide with another package's dependencies, which results in frustrating errors that are entirely avoidable.Test plan
I tested it manually. Works great! I don't have time to get familiar with your test suite.