GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [standards] Migrate "Libraries" from Haste to standard path-based requires (sans vendor & renderers) by ide · Pull Request #24749 · react/react-native

Conversation

@ide

@ide ide commented May 8, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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 #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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

zhigang1992 reacted with hooray emoji
All reactions
  • 🎉 1 reaction
@ide
ide requested a review from cpojer May 8, 2019 02:11
@ide
ide requested a review from shergin as a code owner May 8, 2019 02:11
@ide ide mentioned this pull request May 8, 2019
[standards] Umbrella issue to track migration to standard path-based requires (remove Haste) #24316
Closed
12 tasks done
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Expo Partner: Expo Partner labels May 8, 2019
analysis-bot
analysis-bot suggested changes May 8, 2019
View reviewed changes

@analysis-bot analysis-bot left a comment

Copy link
Copy Markdown

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. Run yarn lint --fix to automatically fix problems.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Libraries/Components/RefreshControl/RefreshControl.js Outdated

@analysis-bot analysis-bot May 8, 2019

Copy link
Copy Markdown

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ide
[standards] Convert "Libraries" from Haste to standard path-based req…
d24539b
…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
@ide
ide force-pushed the standard-paths-libraries branch from ef0175a to d24539b Compare May 8, 2019 02:37
analysis-bot
analysis-bot suggested changes May 8, 2019
View reviewed changes

@analysis-bot analysis-bot left a comment

Copy link
Copy Markdown

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. Run yarn lint --fix to automatically fix problems.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Libraries/Components/RefreshControl/RefreshControl.js
const {NativeComponent} = require('ReactNative');
const Platform = require('../../Utilities/Platform');
const React = require('react');
const {NativeComponent} = require('../../Renderer/shims/ReactNative');

@analysis-bot analysis-bot May 8, 2019

Copy link
Copy Markdown

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ide ide changed the title [standards] Migrate "Libraries" from Haste to standard path-based requires [standards] Migrate "Libraries" from Haste to standard path-based requires (sans vendor & renderers) May 8, 2019
cpojer
cpojer approved these changes May 8, 2019
View reviewed changes

@cpojer cpojer left a comment

Copy link
Copy Markdown
Contributor

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
facebook-github-bot
facebook-github-bot approved these changes May 8, 2019
View reviewed changes

@facebook-github-bot facebook-github-bot left a comment

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@cpojer

cpojer commented May 8, 2019

Copy link
Copy Markdown
Contributor

Current status: I'm trying to get this landed but it may require more work at FB. So far I'm reverting react-native-implementation for now as that causes a lot of issues with Jest mocking and the requires for ReactFiber/ReactNative because at FB they should be required from the fb folder and not oss. We use haste for that toggle atm.

I only have one more Flow issue in our integration tests remaining, will give another update later.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cpojer

cpojer commented May 8, 2019

Copy link
Copy Markdown
Contributor

(Please don't push changes to this PR)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@facebook-github-bot facebook-github-bot closed this in 0ee5f68 May 8, 2019
@react-native-bot

react-native-bot commented May 8, 2019

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @ide in 0ee5f68.

When will my fix make it into a release? | Upcoming Releases

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@react-native-bot react-native-bot added the Merged This PR has been merged. label May 8, 2019
@ide

ide commented May 8, 2019

Copy link
Copy Markdown
Contributor Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cpojer

cpojer commented May 8, 2019

Copy link
Copy Markdown
Contributor

Yay, it landed! Here are some follow-ups:

  • I had to revert changes to react-native-implementation. We'll need a change for a ton of internal tests and add an API like jest.mockReactNativeModule('<HasteModuleName>') that works like jest.mock but mocks the full path and also patches the mock onto the exports of react-native-implementation. I'm not entirely sure what the issue was that I was seeing internally but it's gotta be something like this.
  • Figure out a way how to pick the React renderer.
  • Actually disable haste within this folder so it will throw when using haste.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Cauldrath pushed a commit to Cauldrath/react-native that referenced this pull request Jul 30, 2019
@ide @Cauldrath
Migrate "Libraries" from Haste to standard path-based requires (sans …
33cd633
…vendor & renderers) (react#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 react#24316 for more detail.

[General] [Changed] - Migrate "Libraries" from Haste to standard path-based requires
Pull Request resolved: react#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
@ide
ide deleted the standard-paths-libraries branch April 25, 2020 08:30
facebook-github-bot pushed a commit that referenced this pull request Sep 6, 2022
@sammy-SC @facebook-github-bot
React Native sync for revisions 229c86a...c1f5884
37d0a25
Summary:
This sync includes the following changes:
- **[c1f5884](react/react@c1f5884ff )**: Add missing null checks to OffscreenInstance code ([#24846](react/react#24846)) //<Andrew Clark>//
- **[4cd788a](react/react@4cd788aef )**: Revert "Revert [Transition Tracing] Refactor Transition Tracing Root Code" ([#24830](react/react#24830)) //<Luna Ruan>//
- **[e61fd91](react/react@e61fd91f5 )**: Revert "[Transition Tracing] Refactor Transition Tracing Root Code ([#24766](react/react#24766))" ([#24829](react/react#24829)) //<Andrew Clark>//
- **[4012963](react/react@401296310 )**: [Transition Tracing] Refactor Transition Tracing Root Code ([#24766](react/react#24766)) //<Luna Ruan>//
- **[1859329](react/react@185932902 )**: Track nearest Suspense handler on stack ([#24585](react/react#24585)) //<Andrew Clark>//
- **[a7b192e](react/react@a7b192e0f )**: Add test gate alias for Offscreen ([#24749](react/react#24749)) //<Andrew Clark>//
- **[6b6cf83](react/react@6b6cf8311 )**: Land forked reconciler changes ([#24817](react/react#24817)) //<Andrew Clark>//
- **[d1432ba](react/react@d1432ba93 )**: [Transition Tracing] Fix excess calls to the transition start callback ([#24806](react/react#24806)) //<Luna Ruan>//
- **[88574c1](react/react@88574c1b8 )**: Fix enableTransitionTracing flag ([#24801](react/react#24801)) //<Luna Ruan>//
- **[a4bed46](react/react@a4bed4696 )**: [Transition Tracing] Add Tracing Markers ([#24686](react/react#24686)) //<Luna Ruan>//
- **[1678530](react/react@167853026 )**: fix hydration warning suppression in text comparisons ([#24784](react/react#24784)) //<Josh Story>//
- **[9abe745](react/react@9abe745aa )**: [DevTools][Timeline Profiler] Component Stacks Backend ([#24776](react/react#24776)) //<Luna Ruan>//
- **[cf665c4](react/react@cf665c4b7 )**: [DevTools] Refactor incompleteTransitions field from Root Fiber memoized state to FiberRoot ([#24765](react/react#24765)) //<Luna Ruan>//
- **[56389e8](react/react@56389e81f )**: Abort Flight ([#24754](react/react#24754)) //<Sebastian Markbåge>//
- **[0f216ae](react/react@0f216ae31 )**: Add entry points for "static" server rendering passes ([#24752](react/react#24752)) //<Sebastian Markbåge>//
- **[f796fa1](react/react@f796fa13a )**: Rename Segment to Task in Flight ([#24753](react/react#24753)) //<Sebastian Markbåge>//
- **[0f0aca3](react/react@0f0aca3ab )**: Aborting early should not infinitely suspend ([#24751](react/react#24751)) //<Sebastian Markbåge>//
- **[12a738f](react/react@12a738f1a )**: [Transition Tracing] Add Support for Multiple Transitions on Root ([#24732](react/react#24732)) //<Luna Ruan>//
- **[72ebc70](react/react@72ebc703a )**: [DevTools] fix useDeferredValue to match reconciler change ([#24742](react/react#24742)) //<Mengdi Chen>//
- **[7cf9f5e](react/react@7cf9f5e03 )**: Extra space ([#24612](react/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
cipolleschi pushed a commit that referenced this pull request Sep 7, 2022
@sammy-SC Riccardo Cipolleschi
React Native sync for revisions 229c86a...c1f5884
d9cd5a5
Summary:
This sync includes the following changes:
- **[c1f5884](react/react@c1f5884ff )**: Add missing null checks to OffscreenInstance code ([#24846](react/react#24846)) //<Andrew Clark>//
- **[4cd788a](react/react@4cd788aef )**: Revert "Revert [Transition Tracing] Refactor Transition Tracing Root Code" ([#24830](react/react#24830)) //<Luna Ruan>//
- **[e61fd91](react/react@e61fd91f5 )**: Revert "[Transition Tracing] Refactor Transition Tracing Root Code ([#24766](react/react#24766))" ([#24829](react/react#24829)) //<Andrew Clark>//
- **[4012963](react/react@401296310 )**: [Transition Tracing] Refactor Transition Tracing Root Code ([#24766](react/react#24766)) //<Luna Ruan>//
- **[1859329](react/react@185932902 )**: Track nearest Suspense handler on stack ([#24585](react/react#24585)) //<Andrew Clark>//
- **[a7b192e](react/react@a7b192e0f )**: Add test gate alias for Offscreen ([#24749](react/react#24749)) //<Andrew Clark>//
- **[6b6cf83](react/react@6b6cf8311 )**: Land forked reconciler changes ([#24817](react/react#24817)) //<Andrew Clark>//
- **[d1432ba](react/react@d1432ba93 )**: [Transition Tracing] Fix excess calls to the transition start callback ([#24806](react/react#24806)) //<Luna Ruan>//
- **[88574c1](react/react@88574c1b8 )**: Fix enableTransitionTracing flag ([#24801](react/react#24801)) //<Luna Ruan>//
- **[a4bed46](react/react@a4bed4696 )**: [Transition Tracing] Add Tracing Markers ([#24686](react/react#24686)) //<Luna Ruan>//
- **[1678530](react/react@167853026 )**: fix hydration warning suppression in text comparisons ([#24784](react/react#24784)) //<Josh Story>//
- **[9abe745](react/react@9abe745aa )**: [DevTools][Timeline Profiler] Component Stacks Backend ([#24776](react/react#24776)) //<Luna Ruan>//
- **[cf665c4](react/react@cf665c4b7 )**: [DevTools] Refactor incompleteTransitions field from Root Fiber memoized state to FiberRoot ([#24765](react/react#24765)) //<Luna Ruan>//
- **[56389e8](react/react@56389e81f )**: Abort Flight ([#24754](react/react#24754)) //<Sebastian Markbåge>//
- **[0f216ae](react/react@0f216ae31 )**: Add entry points for "static" server rendering passes ([#24752](react/react#24752)) //<Sebastian Markbåge>//
- **[f796fa1](react/react@f796fa13a )**: Rename Segment to Task in Flight ([#24753](react/react#24753)) //<Sebastian Markbåge>//
- **[0f0aca3](react/react@0f0aca3ab )**: Aborting early should not infinitely suspend ([#24751](react/react#24751)) //<Sebastian Markbåge>//
- **[12a738f](react/react@12a738f1a )**: [Transition Tracing] Add Support for Multiple Transitions on Root ([#24732](react/react#24732)) //<Luna Ruan>//
- **[72ebc70](react/react@72ebc703a )**: [DevTools] fix useDeferredValue to match reconciler change ([#24742](react/react#24742)) //<Mengdi Chen>//
- **[7cf9f5e](react/react@7cf9f5e03 )**: Extra space ([#24612](react/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
@kelset kelset added the ☂️ Umbrella To label issues that serve as coordination point and drivers for tasks in the react-native repo label Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@shergin shergin Awaiting requested review from shergin
3 more reviewers
@analysis-bot analysis-bot analysis-bot requested changes
@cpojer cpojer cpojer approved these changes
@facebook-github-bot facebook-github-bot facebook-github-bot approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. ☂️ Umbrella To label issues that serve as coordination point and drivers for tasks in the react-native repo p: Expo Partner: Expo Partner

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@ide @cpojer @react-native-bot @facebook-github-bot @analysis-bot @kelset
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.