-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
[standards] Migrate "Libraries" from Haste to standard path-based requires (sans vendor & renderers) #24749
Conversation
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.
Code analysis results:
eslint
found some issues. Runyarn lint --fix
to automatically fix problems.
const {NativeComponent} = require('ReactNative'); | ||
const Platform = require('../../Utilities/Platform'); | ||
const React = require('react'); | ||
const {NativeComponent} = require('../../Renderer/shims/ReactNative'); |
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.
no-unused-vars: 'NativeComponent' is assigned a value but never used.
…uires This is the next step in moving RN towards standard path-based requires. All the requires in `Libraries` have been rewritten to use relative requirs. This commit uses relative requires instead of `react-native/...` so that if Facebook were to stop syncing out certain folders and therefore remove code from the react-native package, internal code at Facebook would not need to change. Test plan: Prettier/Lint, Jest tests, loaded RNTester
ef0175a
to
d24539b
Compare
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.
Code analysis results:
eslint
found some issues. Runyarn lint --fix
to automatically fix problems.
const {NativeComponent} = require('ReactNative'); | ||
const Platform = require('../../Utilities/Platform'); | ||
const React = require('react'); | ||
const {NativeComponent} = require('../../Renderer/shims/ReactNative'); |
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.
no-unused-vars: 'NativeComponent' is assigned a value but never used.
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.
Awesome! Let me try to ship it. Did you do this manually or do you have a script for 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 is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Current status: I'm trying to get this landed but it may require more work at FB. So far I'm reverting I only have one more Flow issue in our integration tests remaining, will give another update later. |
(Please don't push changes to this PR) |
This pull request was successfully merged by @ide in 0ee5f68. When will my fix make it into a release? | Upcoming Releases |
This PR was mostly a script, followed by two FlowIgnoreMes (it appears that strict-local doesn’t behave as the Flow docs describe), Prettier and manual reverts for non-Libraries parts of the repo. |
Yay, it landed! Here are some follow-ups:
|
…vendor & renderers) (facebook#24749) Summary: This is the next step in moving RN towards standard path-based requires. All the requires in `Libraries` have been rewritten to use relative requires with a few exceptions, namely, `vendor` and `Renderer/oss` since those need to be changed upstream. This commit uses relative requires instead of `react-native/...` so that if Facebook were to stop syncing out certain folders and therefore remove code from the react-native package, internal code at Facebook would not need to change. See the umbrella issue at facebook#24316 for more detail. [General] [Changed] - Migrate "Libraries" from Haste to standard path-based requires Pull Request resolved: facebook#24749 Differential Revision: D15258017 Pulled By: cpojer fbshipit-source-id: a1f480ea36c05c659b6f37c8f02f6f9216d5a323 # Conflicts: # Libraries/AppState/AppState.js # Libraries/Blob/__tests__/URL-test.js # Libraries/Components/CheckBox/CheckBox.android.js # Libraries/Components/DatePicker/__tests__/DatePickerIOS-test.js # Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js # Libraries/Components/DrawerAndroid/__tests__/DrawerAndroid-test.js # Libraries/Components/MaskedView/__tests__/MaskedViewIOS-test.js # Libraries/Components/Picker/__tests__/Picker-test.js # Libraries/Components/ProgressBarAndroid/__tests__/ProgressBarAndroid-test.js # Libraries/Components/ProgressViewIOS/__tests__/ProgressViewIOS-test.js # Libraries/Components/SafeAreaView/SafeAreaView.js # Libraries/Components/SafeAreaView/__tests__/SafeAreaView-test.js # Libraries/Components/ScrollView/ScrollView.js # Libraries/Components/Slider/RCTSliderNativeComponent.js # Libraries/Components/TextInput/__tests__/InputAccessoryView-test.js # Libraries/Components/Touchable/TouchableWithoutFeedback.js # Libraries/Components/UnimplementedViews/UnimplementedNativeView.js # Libraries/Components/View/View.js # Libraries/Components/View/ViewPropTypes.js # Libraries/Core/Devtools/setupDevtools.js # Libraries/Core/InitializeCore.js # Libraries/Core/SegmentFetcher/NativeSegmentFetcher.js # Libraries/Core/setUpBatchedBridge.js # Libraries/Core/setUpSegmentFetcher.js # Libraries/Core/setUpXHR.js # Libraries/Image/__tests__/Image-test.js # Libraries/Inspector/PerformanceOverlay.js # Libraries/Interaction/JSEventLoopWatchdog.js # Libraries/Linking/Linking.js # Libraries/Lists/SectionList.js # Libraries/Lists/__tests__/VirtualizedSectionList-test.js # Libraries/Modal/__tests__/Modal-test.js # Libraries/Network/RCTNetworking.android.js # Libraries/Network/RCTNetworking.ios.js # Libraries/ReactNative/AppRegistry.js # Libraries/ReactNative/FabricUIManager.js # Libraries/ReactNative/renderApplication.js # Libraries/Text/TextProps.js # Libraries/TurboModule/samples/NativeSampleTurboModule.js # Libraries/Utilities/GlobalPerformanceLogger.js # Libraries/Utilities/PerformanceLoggerContext.js # Libraries/Utilities/__tests__/DeviceInfo-test.js # Libraries/Utilities/__tests__/Dimensions-test.js # Libraries/Utilities/__tests__/PerformanceLogger-test.js # Libraries/Utilities/__tests__/PixelRatio-test.js # Libraries/Utilities/__tests__/binaryToBase64-test.js # Libraries/Utilities/__tests__/clamp-test.js # Libraries/Utilities/__tests__/infoLog-test.js # Libraries/Utilities/__tests__/logError-test.js # Libraries/Utilities/__tests__/mergeIntoFast-test.js # Libraries/Utilities/__tests__/stringifySafe-test.js # Libraries/Utilities/__tests__/warnOnce-test.js # Libraries/Utilities/createPerformanceLogger.js # Libraries/YellowBox/YellowBox.js # Libraries/promiseRejectionIsError.js # packages/react-native-codegen/src/Helpers.js
Summary: This sync includes the following changes: - **[c1f5884ff](facebook/react@c1f5884ff )**: Add missing null checks to OffscreenInstance code ([#24846](facebook/react#24846)) //<Andrew Clark>// - **[4cd788aef](facebook/react@4cd788aef )**: Revert "Revert [Transition Tracing] Refactor Transition Tracing Root Code" ([#24830](facebook/react#24830)) //<Luna Ruan>// - **[e61fd91f5](facebook/react@e61fd91f5 )**: Revert "[Transition Tracing] Refactor Transition Tracing Root Code ([#24766](facebook/react#24766))" ([#24829](facebook/react#24829)) //<Andrew Clark>// - **[401296310](facebook/react@401296310 )**: [Transition Tracing] Refactor Transition Tracing Root Code ([#24766](facebook/react#24766)) //<Luna Ruan>// - **[185932902](facebook/react@185932902 )**: Track nearest Suspense handler on stack ([#24585](facebook/react#24585)) //<Andrew Clark>// - **[a7b192e0f](facebook/react@a7b192e0f )**: Add test gate alias for Offscreen ([#24749](facebook/react#24749)) //<Andrew Clark>// - **[6b6cf8311](facebook/react@6b6cf8311 )**: Land forked reconciler changes ([#24817](facebook/react#24817)) //<Andrew Clark>// - **[d1432ba93](facebook/react@d1432ba93 )**: [Transition Tracing] Fix excess calls to the transition start callback ([#24806](facebook/react#24806)) //<Luna Ruan>// - **[88574c1b8](facebook/react@88574c1b8 )**: Fix enableTransitionTracing flag ([#24801](facebook/react#24801)) //<Luna Ruan>// - **[a4bed4696](facebook/react@a4bed4696 )**: [Transition Tracing] Add Tracing Markers ([#24686](facebook/react#24686)) //<Luna Ruan>// - **[167853026](facebook/react@167853026 )**: fix hydration warning suppression in text comparisons ([#24784](facebook/react#24784)) //<Josh Story>// - **[9abe745aa](facebook/react@9abe745aa )**: [DevTools][Timeline Profiler] Component Stacks Backend ([#24776](facebook/react#24776)) //<Luna Ruan>// - **[cf665c4b7](facebook/react@cf665c4b7 )**: [DevTools] Refactor incompleteTransitions field from Root Fiber memoized state to FiberRoot ([#24765](facebook/react#24765)) //<Luna Ruan>// - **[56389e81f](facebook/react@56389e81f )**: Abort Flight ([#24754](facebook/react#24754)) //<Sebastian Markbåge>// - **[0f216ae31](facebook/react@0f216ae31 )**: Add entry points for "static" server rendering passes ([#24752](facebook/react#24752)) //<Sebastian Markbåge>// - **[f796fa13a](facebook/react@f796fa13a )**: Rename Segment to Task in Flight ([#24753](facebook/react#24753)) //<Sebastian Markbåge>// - **[0f0aca3ab](facebook/react@0f0aca3ab )**: Aborting early should not infinitely suspend ([#24751](facebook/react#24751)) //<Sebastian Markbåge>// - **[12a738f1a](facebook/react@12a738f1a )**: [Transition Tracing] Add Support for Multiple Transitions on Root ([#24732](facebook/react#24732)) //<Luna Ruan>// - **[72ebc703a](facebook/react@72ebc703a )**: [DevTools] fix useDeferredValue to match reconciler change ([#24742](facebook/react#24742)) //<Mengdi Chen>// - **[7cf9f5e03](facebook/react@7cf9f5e03 )**: Extra space ([#24612](facebook/react#24612)) //<Kerim Büyükakyüz>// Changelog: [General][Changed] - React Native sync for revisions 229c86a...c1f5884 Reviewed By: mdvacca, GijsWeterings Differential Revision: D38904311 fbshipit-source-id: 1e30bc420c30ec7a0c0073fc92a706afef4b3340
Summary: This sync includes the following changes: - **[c1f5884ff](facebook/react@c1f5884ff )**: Add missing null checks to OffscreenInstance code ([#24846](facebook/react#24846)) //<Andrew Clark>// - **[4cd788aef](facebook/react@4cd788aef )**: Revert "Revert [Transition Tracing] Refactor Transition Tracing Root Code" ([#24830](facebook/react#24830)) //<Luna Ruan>// - **[e61fd91f5](facebook/react@e61fd91f5 )**: Revert "[Transition Tracing] Refactor Transition Tracing Root Code ([#24766](facebook/react#24766))" ([#24829](facebook/react#24829)) //<Andrew Clark>// - **[401296310](facebook/react@401296310 )**: [Transition Tracing] Refactor Transition Tracing Root Code ([#24766](facebook/react#24766)) //<Luna Ruan>// - **[185932902](facebook/react@185932902 )**: Track nearest Suspense handler on stack ([#24585](facebook/react#24585)) //<Andrew Clark>// - **[a7b192e0f](facebook/react@a7b192e0f )**: Add test gate alias for Offscreen ([#24749](facebook/react#24749)) //<Andrew Clark>// - **[6b6cf8311](facebook/react@6b6cf8311 )**: Land forked reconciler changes ([#24817](facebook/react#24817)) //<Andrew Clark>// - **[d1432ba93](facebook/react@d1432ba93 )**: [Transition Tracing] Fix excess calls to the transition start callback ([#24806](facebook/react#24806)) //<Luna Ruan>// - **[88574c1b8](facebook/react@88574c1b8 )**: Fix enableTransitionTracing flag ([#24801](facebook/react#24801)) //<Luna Ruan>// - **[a4bed4696](facebook/react@a4bed4696 )**: [Transition Tracing] Add Tracing Markers ([#24686](facebook/react#24686)) //<Luna Ruan>// - **[167853026](facebook/react@167853026 )**: fix hydration warning suppression in text comparisons ([#24784](facebook/react#24784)) //<Josh Story>// - **[9abe745aa](facebook/react@9abe745aa )**: [DevTools][Timeline Profiler] Component Stacks Backend ([#24776](facebook/react#24776)) //<Luna Ruan>// - **[cf665c4b7](facebook/react@cf665c4b7 )**: [DevTools] Refactor incompleteTransitions field from Root Fiber memoized state to FiberRoot ([#24765](facebook/react#24765)) //<Luna Ruan>// - **[56389e81f](facebook/react@56389e81f )**: Abort Flight ([#24754](facebook/react#24754)) //<Sebastian Markbåge>// - **[0f216ae31](facebook/react@0f216ae31 )**: Add entry points for "static" server rendering passes ([#24752](facebook/react#24752)) //<Sebastian Markbåge>// - **[f796fa13a](facebook/react@f796fa13a )**: Rename Segment to Task in Flight ([#24753](facebook/react#24753)) //<Sebastian Markbåge>// - **[0f0aca3ab](facebook/react@0f0aca3ab )**: Aborting early should not infinitely suspend ([#24751](facebook/react#24751)) //<Sebastian Markbåge>// - **[12a738f1a](facebook/react@12a738f1a )**: [Transition Tracing] Add Support for Multiple Transitions on Root ([#24732](facebook/react#24732)) //<Luna Ruan>// - **[72ebc703a](facebook/react@72ebc703a )**: [DevTools] fix useDeferredValue to match reconciler change ([#24742](facebook/react#24742)) //<Mengdi Chen>// - **[7cf9f5e03](facebook/react@7cf9f5e03 )**: Extra space ([#24612](facebook/react#24612)) //<Kerim Büyükakyüz>// Changelog: [General][Changed] - React Native sync for revisions 229c86a...c1f5884 Reviewed By: mdvacca, GijsWeterings Differential Revision: D38904311 fbshipit-source-id: 1e30bc420c30ec7a0c0073fc92a706afef4b3340
Summary: This sync includes the following changes: - **[c1f5884ff](facebook/react@c1f5884ff )**: Add missing null checks to OffscreenInstance code ([facebook#24846](facebook/react#24846)) //<Andrew Clark>// - **[4cd788aef](facebook/react@4cd788aef )**: Revert "Revert [Transition Tracing] Refactor Transition Tracing Root Code" ([facebook#24830](facebook/react#24830)) //<Luna Ruan>// - **[e61fd91f5](facebook/react@e61fd91f5 )**: Revert "[Transition Tracing] Refactor Transition Tracing Root Code ([facebook#24766](facebook/react#24766))" ([facebook#24829](facebook/react#24829)) //<Andrew Clark>// - **[401296310](facebook/react@401296310 )**: [Transition Tracing] Refactor Transition Tracing Root Code ([facebook#24766](facebook/react#24766)) //<Luna Ruan>// - **[185932902](facebook/react@185932902 )**: Track nearest Suspense handler on stack ([facebook#24585](facebook/react#24585)) //<Andrew Clark>// - **[a7b192e0f](facebook/react@a7b192e0f )**: Add test gate alias for Offscreen ([facebook#24749](facebook/react#24749)) //<Andrew Clark>// - **[6b6cf8311](facebook/react@6b6cf8311 )**: Land forked reconciler changes ([facebook#24817](facebook/react#24817)) //<Andrew Clark>// - **[d1432ba93](facebook/react@d1432ba93 )**: [Transition Tracing] Fix excess calls to the transition start callback ([facebook#24806](facebook/react#24806)) //<Luna Ruan>// - **[88574c1b8](facebook/react@88574c1b8 )**: Fix enableTransitionTracing flag ([facebook#24801](facebook/react#24801)) //<Luna Ruan>// - **[a4bed4696](facebook/react@a4bed4696 )**: [Transition Tracing] Add Tracing Markers ([facebook#24686](facebook/react#24686)) //<Luna Ruan>// - **[167853026](facebook/react@167853026 )**: fix hydration warning suppression in text comparisons ([facebook#24784](facebook/react#24784)) //<Josh Story>// - **[9abe745aa](facebook/react@9abe745aa )**: [DevTools][Timeline Profiler] Component Stacks Backend ([facebook#24776](facebook/react#24776)) //<Luna Ruan>// - **[cf665c4b7](facebook/react@cf665c4b7 )**: [DevTools] Refactor incompleteTransitions field from Root Fiber memoized state to FiberRoot ([facebook#24765](facebook/react#24765)) //<Luna Ruan>// - **[56389e81f](facebook/react@56389e81f )**: Abort Flight ([facebook#24754](facebook/react#24754)) //<Sebastian Markbåge>// - **[0f216ae31](facebook/react@0f216ae31 )**: Add entry points for "static" server rendering passes ([facebook#24752](facebook/react#24752)) //<Sebastian Markbåge>// - **[f796fa13a](facebook/react@f796fa13a )**: Rename Segment to Task in Flight ([facebook#24753](facebook/react#24753)) //<Sebastian Markbåge>// - **[0f0aca3ab](facebook/react@0f0aca3ab )**: Aborting early should not infinitely suspend ([facebook#24751](facebook/react#24751)) //<Sebastian Markbåge>// - **[12a738f1a](facebook/react@12a738f1a )**: [Transition Tracing] Add Support for Multiple Transitions on Root ([facebook#24732](facebook/react#24732)) //<Luna Ruan>// - **[72ebc703a](facebook/react@72ebc703a )**: [DevTools] fix useDeferredValue to match reconciler change ([facebook#24742](facebook/react#24742)) //<Mengdi Chen>// - **[7cf9f5e03](facebook/react@7cf9f5e03 )**: Extra space ([facebook#24612](facebook/react#24612)) //<Kerim Büyükakyüz>// Changelog: [General][Changed] - React Native sync for revisions 229c86a...c1f5884 Reviewed By: mdvacca, GijsWeterings Differential Revision: D38904311 fbshipit-source-id: 1e30bc420c30ec7a0c0073fc92a706afef4b3340
Summary
This is the next step in moving RN towards standard path-based requires. All the requires in
Libraries
have been rewritten to use relative requires with a few exceptions, namely,vendor
andRenderer/oss
since those need to be changed upstream. This commit uses relative requires instead ofreact-native/...
so that if Facebook were to stop syncing out certain folders and therefore remove code from the react-native package, internal code at Facebook would not need to change.See the umbrella issue at #24316 for more detail.
Changelog
[General] [Changed] - Migrate "Libraries" from Haste to standard path-based requires
Test Plan
Prettier/Lint, Flow, Jest tests, loaded RNTester