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 the haste/metro workaround (move to RN61?) #3483

Closed
namrog84 opened this issue Oct 22, 2019 · 1 comment
Closed

Fix the haste/metro workaround (move to RN61?) #3483

namrog84 opened this issue Oct 22, 2019 · 1 comment

Comments

@namrog84
Copy link
Contributor

namrog84 commented Oct 22, 2019

RNW has some weird workarounds using haste/metro.

Can the long term solution be prioritized for this?

I think this was supposed to have been fixable in 60, but not sure if RNW needs to be on 61 or not for this.
https://facebook.github.io/react-native/blog/2019/06/12/react-native-open-source-update

"0.60 is pretty messy with all this haste stuff, where it is in an in-between phase where haste is half removed. -- This will get better with 0.61"

"The haste map is a tech that facebook uses internally to reference modules across projects -- they just name all their files differently, then they can require any file from anywhere without having to worry about where it is. Haste was used by react-native to support platforms to be able to override specific modules. View.windows would be picked up by haste from react-native-windows by any require('View') within react-native. The community hates haste, it isn't compatible with normal tooling and created initial boot perf issues on the bundler and a bunch of other issues. So haste is being removed from react-native. As of 0.60, the requires within react-native are mostly not using haste. So we can't rely on haste to work. As of 0.61 it will be gone entirely. But for 0.60 we need to have both relative path imports work and haste imports work. For relative paths to work, we have to copy all of react-native into react-native-windows. So that require(../View/View) will pickup View.windows, we need view.windows to be in the same location as view.js. So now react-native-windows contains the entire implementation of react-native, not just the windows parts. Then we tell metro to use the location of react-native-windows as the location of react-native. This also means that we need to configure haste to only look in react-native-windows, not react-native-windows and react-native for haste modules. Hence, adding react-native to the blacklist."

see also:
facebook/react-native#24316

@ghost ghost added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Oct 22, 2019
@chrisglein
Copy link
Member

We'll move to 61 rather than tackle this. #3543

@chrisglein chrisglein removed the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants