-
Notifications
You must be signed in to change notification settings - Fork 24.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
Sync React with Haste-style imports rewritten to use path-based imports instead #25100
Conversation
…ts instead This commit uses the same base commit of React that's currently in RN (React ec6691a68716bc59291746fc62f374a56fb435c9) plus a commit in the React repo that removes Haste-style imports from the renderer and a commit to make the shims import from `implementations` (facebook/react#15786). I built React in the React repo with `yarn build` and copied over the `oss` directory into one called `implementations` and removed the `*.fb.js` files. Test plan: run unit tests, RNTester, CI. Also verified that we can make Metro pick up `.fb.js` files with: ```js resolver: { sourceExts: ['fb.js', 'js', 'json', ...], } ```
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.
Let me import it.
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.
@cpojer has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
This pull request was successfully merged by @ide in 69d1ed7. When will my fix make it into a release? | Upcoming Releases |
…facebook#24811) Summary: **Depends on facebook#25100 This commit depends on having migrated all of RN away from Haste. With 100% standard path-based requires, the key foundation is set and we no longer need `hasteImpl` and related settings in the Jest configuration. This commit deletes the `hasteImpl` file and setting as well as `providesModuleNodeModules` and `modulePathNameMapper`, removing most of the dependency graph overriding performed by Jest. ## Changelog [General] [Changed] - Delete hasteImpl, providesModuleNodeModules, and modulePathNameMapper from Jest config Pull Request resolved: facebook#24811 Differential Revision: D15659274 Pulled By: cpojer fbshipit-source-id: 8a4a3b97ddf7e38fbe62c6d3cc9c98248bfca343
Summary: **Depends on #25100 This is one of the steps unlocked by migrating RN from Haste to path-based imports. This commit sets Flow to use path-based imports by removing all of the Haste-related configuration options. Additionally, it maps `react-native` to import from within this module to match Node's module resolution behavior. It also adds `<PROJECT_ROOT>` to the image name mapper so that the mapped name doesn't rely on Haste. ## Changelog [General] [Changed] - Make Flow configs use path-based imports instead of Haste Pull Request resolved: #24812 Differential Revision: D15659189 Pulled By: cpojer fbshipit-source-id: d0efaa2884485a492dcdef8d94061129cebc2566
…ts instead (facebook#25100) Summary: **This is a manual React sync to replace Haste names with paths so that the removal of Haste is not blocked on a normal React sync. This is a one-time special case; in the future, React will generate renderers that use paths instead of Haste.** This commit uses the same base commit of React that's currently in RN (React ec6691a68716bc59291746fc62f374a56fb435c9) plus a commit in the React repo that removes Haste-style imports from the renderer (61f62246c8cfb76a4a19d1661eeaa5822ec37b36) and a commit to make the shims import from `implementations` (facebook/react#15786). I built React in the React repo with `yarn build` and copied over the `oss` directory into one called `implementations` and removed the `*.fb.js` files. ## Changelog [General] [Changed] - Sync React with Haste-style imports rewritten to use path-based imports instead Pull Request resolved: facebook#25100 Reviewed By: yungsters Differential Revision: D15575646 Pulled By: cpojer fbshipit-source-id: adf25f9826b71729043b65ba1afd20d14d8c19c4 (cherry picked from commit 69d1ed7)
…facebook#24811) Summary: **Depends on facebook#25100 This commit depends on having migrated all of RN away from Haste. With 100% standard path-based requires, the key foundation is set and we no longer need `hasteImpl` and related settings in the Jest configuration. This commit deletes the `hasteImpl` file and setting as well as `providesModuleNodeModules` and `modulePathNameMapper`, removing most of the dependency graph overriding performed by Jest. ## Changelog [General] [Changed] - Delete hasteImpl, providesModuleNodeModules, and modulePathNameMapper from Jest config Pull Request resolved: facebook#24811 Differential Revision: D15659274 Pulled By: cpojer fbshipit-source-id: 8a4a3b97ddf7e38fbe62c6d3cc9c98248bfca343 (cherry picked from commit 7a2463e)
…4812) Summary: **Depends on facebook#25100 This is one of the steps unlocked by migrating RN from Haste to path-based imports. This commit sets Flow to use path-based imports by removing all of the Haste-related configuration options. Additionally, it maps `react-native` to import from within this module to match Node's module resolution behavior. It also adds `<PROJECT_ROOT>` to the image name mapper so that the mapped name doesn't rely on Haste. ## Changelog [General] [Changed] - Make Flow configs use path-based imports instead of Haste Pull Request resolved: facebook#24812 Differential Revision: D15659189 Pulled By: cpojer fbshipit-source-id: d0efaa2884485a492dcdef8d94061129cebc2566 (cherry picked from commit bf8d918)
…ts instead (#25100) Summary: **This is a manual React sync to replace Haste names with paths so that the removal of Haste is not blocked on a normal React sync. This is a one-time special case; in the future, React will generate renderers that use paths instead of Haste.** This commit uses the same base commit of React that's currently in RN (React ec6691a68716bc59291746fc62f374a56fb435c9) plus a commit in the React repo that removes Haste-style imports from the renderer (61f62246c8cfb76a4a19d1661eeaa5822ec37b36) and a commit to make the shims import from `implementations` (facebook/react#15786). I built React in the React repo with `yarn build` and copied over the `oss` directory into one called `implementations` and removed the `*.fb.js` files. ## Changelog [General] [Changed] - Sync React with Haste-style imports rewritten to use path-based imports instead Pull Request resolved: facebook/react-native#25100 Reviewed By: yungsters Differential Revision: D15575646 Pulled By: cpojer fbshipit-source-id: adf25f9826b71729043b65ba1afd20d14d8c19c4
…ts instead (facebook#25100) Summary: **This is a manual React sync to replace Haste names with paths so that the removal of Haste is not blocked on a normal React sync. This is a one-time special case; in the future, React will generate renderers that use paths instead of Haste.** This commit uses the same base commit of React that's currently in RN (React ec6691a68716bc59291746fc62f374a56fb435c9) plus a commit in the React repo that removes Haste-style imports from the renderer (61f62246c8cfb76a4a19d1661eeaa5822ec37b36) and a commit to make the shims import from `implementations` (facebook/react#15786). I built React in the React repo with `yarn build` and copied over the `oss` directory into one called `implementations` and removed the `*.fb.js` files. ## Changelog [General] [Changed] - Sync React with Haste-style imports rewritten to use path-based imports instead Pull Request resolved: facebook#25100 Reviewed By: yungsters Differential Revision: D15575646 Pulled By: cpojer fbshipit-source-id: adf25f9826b71729043b65ba1afd20d14d8c19c4
…facebook#24811) Summary: **Depends on facebook#25100 This commit depends on having migrated all of RN away from Haste. With 100% standard path-based requires, the key foundation is set and we no longer need `hasteImpl` and related settings in the Jest configuration. This commit deletes the `hasteImpl` file and setting as well as `providesModuleNodeModules` and `modulePathNameMapper`, removing most of the dependency graph overriding performed by Jest. ## Changelog [General] [Changed] - Delete hasteImpl, providesModuleNodeModules, and modulePathNameMapper from Jest config Pull Request resolved: facebook#24811 Differential Revision: D15659274 Pulled By: cpojer fbshipit-source-id: 8a4a3b97ddf7e38fbe62c6d3cc9c98248bfca343
…4812) Summary: **Depends on facebook#25100 This is one of the steps unlocked by migrating RN from Haste to path-based imports. This commit sets Flow to use path-based imports by removing all of the Haste-related configuration options. Additionally, it maps `react-native` to import from within this module to match Node's module resolution behavior. It also adds `<PROJECT_ROOT>` to the image name mapper so that the mapped name doesn't rely on Haste. ## Changelog [General] [Changed] - Make Flow configs use path-based imports instead of Haste Pull Request resolved: facebook#24812 Differential Revision: D15659189 Pulled By: cpojer fbshipit-source-id: d0efaa2884485a492dcdef8d94061129cebc2566
Part of the RN v0.60 -> v0.61 changes to the template app [1], corresponding to facebook/react-native@bf8d91868 and a correction in facebook/react-native@732ded7f7. This must happen at or after the main upgrade commit because the former declares that it depends on facebook/react-native#25100, which landed in facebook/react-native@69d1ed731 and was released in v0.61.0. [1]: https://react-native-community.github.io/upgrade-helper/?from=0.60.6&to=0.61.5
Part of the RN v0.60 -> v0.61 changes to the template app [1], corresponding to facebook/react-native@bf8d91868 and a correction in facebook/react-native@732ded7f7. This must happen at or after the main upgrade commit because the former declares that it depends on facebook/react-native#25100, which landed in facebook/react-native@69d1ed731 and was released in v0.61.0. [1]: https://react-native-community.github.io/upgrade-helper/?from=0.60.6&to=0.61.5
Part of the RN v0.60 -> v0.61 changes to the template app [1], corresponding to facebook/react-native@bf8d91868 and a correction in facebook/react-native@732ded7f7. This must happen at or after the main upgrade commit because the former declares that it depends on facebook/react-native#25100, which landed in facebook/react-native@69d1ed731 and was released in v0.61.0. [1]: https://react-native-community.github.io/upgrade-helper/?from=0.60.6&to=0.61.5
Part of the RN v0.60 -> v0.61 changes to the template app [1], corresponding to facebook/react-native@bf8d91868 and a correction in facebook/react-native@732ded7f7. This must happen at or after the main upgrade commit because the former declares that it depends on facebook/react-native#25100, which landed in facebook/react-native@69d1ed731 and was released in v0.61.0. [1]: https://react-native-community.github.io/upgrade-helper/?from=0.60.6&to=0.61.5
Part of the RN v0.60 -> v0.61 changes to the template app [1], corresponding to facebook/react-native@bf8d91868 and a correction in facebook/react-native@732ded7f7. This must happen at or after the main upgrade commit because the former declares that it depends on facebook/react-native#25100, which landed in facebook/react-native@69d1ed731 and was released in v0.61.0. [1]: https://react-native-community.github.io/upgrade-helper/?from=0.60.6&to=0.61.5
Part of the RN v0.60 -> v0.61 changes to the template app [1], corresponding to facebook/react-native@bf8d91868 and a correction in facebook/react-native@732ded7f7. This must happen at or after the main upgrade commit because the former declares that it depends on facebook/react-native#25100, which landed in facebook/react-native@69d1ed731 and was released in v0.61.0. [1]: https://react-native-community.github.io/upgrade-helper/?from=0.60.6&to=0.61.5
Part of the RN v0.60 -> v0.61 changes to the template app [1], corresponding to facebook/react-native@bf8d91868 and a correction in facebook/react-native@732ded7f7. This must happen at or after the main upgrade commit because the former declares that it depends on facebook/react-native#25100, which landed in facebook/react-native@69d1ed731 and was released in v0.61.0. [1]: https://react-native-community.github.io/upgrade-helper/?from=0.60.6&to=0.61.5
Part of the RN v0.60 -> v0.61 changes to the template app [1], corresponding to facebook/react-native@bf8d91868 and a correction in facebook/react-native@732ded7f7. This must happen at or after the main upgrade commit because the former declares that it depends on facebook/react-native#25100, which landed in facebook/react-native@69d1ed731 and was released in v0.61.0. [1]: https://react-native-community.github.io/upgrade-helper/?from=0.60.6&to=0.61.5
Part of the RN v0.60 -> v0.61 changes to the template app [1], corresponding to facebook/react-native@bf8d91868 and a correction in facebook/react-native@732ded7f7. This must happen at or after the main upgrade commit because the former declares that it depends on facebook/react-native#25100, which landed in facebook/react-native@69d1ed731 and was released in v0.61.0. [1]: https://react-native-community.github.io/upgrade-helper/?from=0.60.6&to=0.61.5
Summary
This is a manual React sync to replace Haste names with paths so that the removal of Haste is not blocked on a normal React sync. This is a one-time special case; in the future, React will generate renderers that use paths instead of Haste.
This commit uses the same base commit of React that's currently in RN (React ec6691a68716bc59291746fc62f374a56fb435c9) plus a commit in the React repo that removes Haste-style imports from the renderer (61f62246c8cfb76a4a19d1661eeaa5822ec37b36) and a commit to make the shims import from
implementations
(facebook/react#15786).I built React in the React repo with
yarn build
and copied over theoss
directory into one calledimplementations
and removed the*.fb.js
files.Changelog
[General] [Changed] - Sync React with Haste-style imports rewritten to use path-based imports instead
Test Plan
Run unit tests, RNTester, CI. Also verified that we can make Metro pick up
.fb.js
files with: