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? |
cpojer
left a comment
There was a problem hiding this comment.
Could you rebase this now that we are using TypeScript?
|
I don't think the name |
SimenB
left a comment
There was a problem hiding this comment.
Missing changelog entry (and I think the name of the option is imprecise)
953661d to
bcb1024
Compare
|
Good to go 👍 |
|
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
skipHastePackagesoption prevents reading ofpackage.jsonfiles 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.