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

[assets] Adds support for publicPath to enable serving assets from different locations. #299

Closed
wants to merge 1 commit into from

Conversation

raejin
Copy link
Contributor

@raejin raejin commented Oct 23, 2018

Summary

This is an updated followup from #280, which we would still need to address the following assumptions about /assets/:

const assetPath: string = urlObj.pathname.match(/^\/assets\/(.+)$/);

} else if (pathname.match(/\.assets$/)) {

} else if (pathname.match(/^\/assets\//)) {

As pointed out by @gdborton, there isn't currently a way to make this a configurable option. I am not certain how to find a proper workaround for processRequest.

Update as of November 5th, 2018

We found a temporary solution to have our express app pick up serving the assets from a publicPath as a middleware. But the change in this PR is still necessary to get it working fully.

Test plan

  • Will add tests once we figure out a comprehensive solution

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 23, 2018
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

different locations. This only adds the `publicPath` transformer
options, the assets serving portion will have to be handled by a
separate middleware for now.
@codecov-io
Copy link

Codecov Report

Merging #299 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #299   +/-   ##
======================================
  Coverage    86.3%   86.3%           
======================================
  Files         163     163           
  Lines        4906    4906           
  Branches      751     751           
======================================
  Hits         4234    4234           
  Misses        599     599           
  Partials       73      73
Impacted Files Coverage Δ
packages/metro/src/JSTransformer/worker.js 91.2% <ø> (ø) ⬆️
packages/metro-config/src/defaults/index.js 85% <ø> (ø) ⬆️
packages/metro/src/assetTransformer.js 100% <ø> (ø) ⬆️
...es/metro/src/DeltaBundler/Serializers/getAssets.js 100% <ø> (ø) ⬆️
packages/metro-config/src/convertConfig.js 100% <ø> (ø) ⬆️
packages/metro/src/Server.js 86.8% <ø> (ø) ⬆️
packages/metro/src/Assets.js 90.47% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update afee5b1...9811daa. Read the comment docs.

@raejin
Copy link
Contributor Author

raejin commented Nov 5, 2018

@mjesun This is ready for review! Should I include instructions on how to wire this up with express app?

Copy link
Contributor

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mjesun has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Nov 9, 2018
… locations. (#299)

Summary:
<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory. -->

**Summary**

<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->

This is an updated followup from facebook/metro#280, which we would still need to address the following assumptions about `/assets/`:

https://github.com/facebook/metro/blob/e7deea19001d903a47868bb1fe6456bdc4b585e7/packages/metro/src/Server.js#L332

https://github.com/facebook/metro/blob/e7deea19001d903a47868bb1fe6456bdc4b585e7/packages/metro/src/Server.js#L379

https://github.com/facebook/metro/blob/e7deea19001d903a47868bb1fe6456bdc4b585e7/packages/metro/src/Server.js#L385

As pointed out by gdborton, there isn't currently a way to make this a configurable option. I am not certain how to find a proper workaround for `processRequest`.

We found a temporary solution to have our express app pick up serving the assets from a publicPath as a middleware. But the change in this PR is still necessary to get it working fully.

**Test plan**

<!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI. -->

- Will add tests once we figure out a comprehensive solution
Pull Request resolved: facebook/metro#299

Reviewed By: rafeca

Differential Revision: D12939229

Pulled By: mjesun

fbshipit-source-id: 769c23468c5ac434f8319e5e7caaf46dd6453f2d
vishaldwivedi added a commit to vishaldwivedi/react-native that referenced this pull request Nov 30, 2018
* Fix IllegalStateException when dismissing DialogManager

Summary: This diff fixes a IllegalStateException that can happen because of a race condition when using DialogManager

Reviewed By: fkgozali

Differential Revision: D12899432

fbshipit-source-id: 98fb7c1ee1d292a959628a33c8a2dd5a6d93e328

* Trivial cleanup in ReactRootView

Summary: Trivial clanup of imports in ReactRootView

Reviewed By: fkgozali

Differential Revision: D12899430

fbshipit-source-id: 83bb052bbeee9e02e91157305420a2dd799e60e2

* RN: Copyright Header for `ReactInstanceManagerTest.java`

Summary: Missing when D12829677 landed.

Reviewed By: mdvacca

Differential Revision: D12903182

fbshipit-source-id: 1c142acb2a098b1118170f2f8ed8cf719fc14f90

* Fix the comment for getSize in Image.android.js (#22092)

Summary:
A minor change to the comment in the Image.android.js file.
Pull Request resolved: https://github.com/facebook/react-native/pull/22092

Differential Revision: D12918066

Pulled By: TheSavior

fbshipit-source-id: f27c63241c9dde780c037edcbcdf4cc10d55d33e

* Fix duplicate function declaration in WebSockets (#22098)

Summary:
Fixes the only ESLint error pending to resolve. It was a duplicate `get` declaration.
Pull Request resolved: https://github.com/facebook/react-native/pull/22098

Differential Revision: D12918078

Pulled By: TheSavior

fbshipit-source-id: c738d6880241dbc1f1ddc06c2d4e52443c00768a

* Improving Modal `visible` prop check to handle undefined and null (#22072)

Summary:
Changing the the this.props.visible if to be ` if (!!this.props.visible === false)` . So passing undefined, or other values wont set the modal to be visible. Granting that anything that is not true, will set the modal to null on the render.

I make this this PR, because on the company that im working, we used a lot of RN. At the moment, we arent using anything like flow or TS. But to grant that the modals will only show if they are set visible to true i have changed the if made.

_Pull requests that expand test coverage are more likely to get reviewed. Add a test case whenever possible!_
Pull Request resolved: https://github.com/facebook/react-native/pull/22072

Differential Revision: D12918086

Pulled By: TheSavior

fbshipit-source-id: 8f9c63ac6fd56d83949bb8428ad7c5b7bf805c49

* Flow strict ScrollViewMock (#22103)

Summary:
Related to #22100

Turn Flow strict mode on for ScrollViewMock.
This file used to declare jest var as `any` but jest module is already typed in root flow folder.

Note: I had to use a quick fix for polyfillPromise. See here #22101

- All flow tests succeed.

[GENERAL] [ENHANCEMENT] [ScrollViewMock.js] - Flow strict mode
Pull Request resolved: https://github.com/facebook/react-native/pull/22103

Differential Revision: D12918380

Pulled By: TheSavior

fbshipit-source-id: cd3aba47b1a43e76a7da09e15cc2d9cfcdf7f56d

* Remove var in Libraries/emitter/* (#22087)

Summary:
Replaces the keywords var with const in Libraries/emitter/EventValidator.js

If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.

_Pull requests that expand test coverage are more likely to get reviewed. Add a test case whenever possible!_

- [x] Check npm run flow
- [x] Check npm run flow-check-ios
- [x] Check npm run flow-check-android

[GENERAL] [ENHANCEMENT] [Libraries/emitter] - remove `var`
Pull Request resolved: https://github.com/facebook/react-native/pull/22087

Differential Revision: D12918444

Pulled By: TheSavior

fbshipit-source-id: 630ccb283fd6c3118a22124a656038eac4a88599

* RN: Revert React 16.6 Sync

Summary:
There are some critical bugs that require further investigation in the most recent upgrade to React 16.6 (and ReactNativeRenderer changes).

This revision reverts the sync until these issues have been resolved.

Reviewed By: mdvacca

Differential Revision: D12918541

fbshipit-source-id: 5c1ada185851ba599f3c86387158a2b41f3dcf3e

* Remove flow-strict from polyfillPromise (#22048)

Summary:
Flow is broken for a bunch of people and has been for the last few days. For some reason this isn't causing any builds to fail which we will need to look into. For now, this stops the bleeding.

I *think* this is because of case sensitivity differenes between Mac and where all of our CI machines run.
```
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ Libraries/Core/polyfillPromise.js:21:33

Importing from an untyped module makes it any and is not safe! Did you mean to add // flow to the top of Promise?
(untyped-import)

     18│  * If you don't need these polyfills, don't use InitializeCore; just directly
     19│  * require the modules you need from InitializeCore for setup.
     20│  */
     21│ polyfillGlobal('Promise', () => require('Promise'));
     22│
```

Pull Request resolved: https://github.com/facebook/react-native/pull/22048

Reviewed By: shergin

Differential Revision: D12918418

Pulled By: TheSavior

fbshipit-source-id: 9d9db1b3686eab906244180325c12ffcce92be8c

* Remove unused variables (#22097)

Summary:
Fix unused variable ESLint warnings.
Pull Request resolved: https://github.com/facebook/react-native/pull/22097

Differential Revision: D12919249

Pulled By: TheSavior

fbshipit-source-id: f680fa7277c58cf685e70dfb911753a30fe01c1d

* Replace var to const in Libraries/Utilities/deepFreezeAndThrowOnMutationInDev-test.js (#22110)

Summary:
Replaces the keywords var to const in Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js

- [x]  Check npm run flow
- [x]  Check npm run flow-check-ios
- [x]  Check npm run flow-check-android

[GENERAL] [ENHANCEMENT] [Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js] - replace var
Pull Request resolved: https://github.com/facebook/react-native/pull/22110

Differential Revision: D12919284

Pulled By: TheSavior

fbshipit-source-id: 4a3a3f4c49665c538ed5f38f3cc2142d40ac4d55

* Remove var in Libraries/vendor/core/merge.js (#22108)

Summary:
Replaces the keywords var with const in Libraries/merge.js

If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.

Pull requests that expand test coverage are more likely to get reviewed. Add a test case whenever possible!

- [x]  Check npm run flow
- [x] Check npm run flow-check-ios
- [x] Check npm run flow-check-android

[GENERAL] [ENHANCEMENT] [Libraries/core] - remove var
Pull Request resolved: https://github.com/facebook/react-native/pull/22108

Differential Revision: D12919282

Pulled By: TheSavior

fbshipit-source-id: e3c8569c47c95ad3d1a061917c90185c2694c78f

* Remove var in Libraries/Utilities/MatrixMath.js (#22111)

Summary:
Replaces the keywords var with let in Libraries/Utilities/MatrixMath.js

- [x] Check npm run flow
- [x] Check npm run flow-check-ios
- [x] Check npm run flow-check-android

[GENERAL] [ENHANCEMENT] [Libraries/Utilities/MatrixMath.js] - remove `var`
Pull Request resolved: https://github.com/facebook/react-native/pull/22111

Differential Revision: D12919285

Pulled By: TheSavior

fbshipit-source-id: dca65d2da311b5c50ab6ce7338af1cc941fb7a33

* Remove var in Libraries/Utilities/buildStyleInterpolator.js (#22112)

Summary:
Replaces the keywords var with const in Libraries/Utilities/buildStyleInterpolator.js
Pull Request resolved: https://github.com/facebook/react-native/pull/22112

Differential Revision: D12919286

Pulled By: TheSavior

fbshipit-source-id: bc39a1efc2c372365d95cd305cc6d915f030b209

* Make PR template consistent with Changelog (#22117)

Summary:
In the new changelog format, we're following [Keep a Changelog](https://keepachangelog.com/en/1.0.0). This change updates the PR template to follow their change types, plus it simplifies the *CATEGORY* field to follow the changelog's groupings. Some simplified examples have been provided, though I plan to revisit this after 0.58 to add real-world examples. This change is motivated by react-native-community/react-native-releases#47.
Pull Request resolved: https://github.com/facebook/react-native/pull/22117

Differential Revision: D12919271

Pulled By: TheSavior

fbshipit-source-id: 91f063f769357b24383db281545678b924ad3efb

* Fix rn-cli linting issues (#22099)

Summary:
Fixes ESLint warnings in `react-native-cli`. I isolated this PR from other lint fixes because of the top `DO NOT MODIFY THIS FILE` message. Either way I think this issues should be fixed :)
Pull Request resolved: https://github.com/facebook/react-native/pull/22099

Differential Revision: D12920673

Pulled By: TheSavior

fbshipit-source-id: ed1308fe7ef4633b793d85fe8c6ce5d068651e12

* Turn Flow strict mode on for DatePickerIOS (#22105)

Summary:
Related to #22100

Turn Flow strict mode on for DatePickerIOS.

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android

This error was happend #22101 #22048

[GENERAL] [ENHANCEMENT] [Components/DatePicker/DatePickerIOS.ios.js] - Flow strict mode
Pull Request resolved: https://github.com/facebook/react-native/pull/22105

Differential Revision: D12920939

Pulled By: TheSavior

fbshipit-source-id: aae5ca04d656abb1cf34168e12e44dd50f0a603c

* Turn Flow strict mode on for KeyBoard (#22114)

Summary:
Related to #22100

Turn Flow strict mode on for KeyBoard

- [x] npm run prettier
- [ ] npm run flow-check-ios
- [ ] npm run flow-check-android

This error was happend #22101 #22048

[GENERAL] [ENHANCEMENT] [Components/Keyboard/Keyboard.js] - Flow strict mode
Pull Request resolved: https://github.com/facebook/react-native/pull/22114

Differential Revision: D12920947

Pulled By: TheSavior

fbshipit-source-id: 8d72019efd4d30032ce4784764e5deb9c60e7b01

* remove var in ReactAndroid/src/androidTest (#22136)

Summary:
I removed var in ReactAndroid/src/androidTest.

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android

[GENERAL] [ReactAndroid/src/androidTest] - remove var
Pull Request resolved: https://github.com/facebook/react-native/pull/22136

Differential Revision: D12921227

Pulled By: TheSavior

fbshipit-source-id: 45c03a52a5eafa25965aa785da094421c3df3999

* remove var in ReactAndroid/src/androidTest. (#22137)

Summary:
I removed var in ReactAndroid/src/androidTest.

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android

[GENERAL] [ReactAndroid/src/androidTest] - remove var
Pull Request resolved: https://github.com/facebook/react-native/pull/22137

Differential Revision: D12921228

Pulled By: TheSavior

fbshipit-source-id: d3b7380b6047fc304265d0f47a53cb1170a6aea6

* Remove var in ReactAndroid/src/androidTest (#22135)

Summary:
I removed var in ReactAndroid/src/androidTest.

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android

[GENERAL] [ReactAndroid/src/androidTest] - remove var
Pull Request resolved: https://github.com/facebook/react-native/pull/22135

Differential Revision: D12921224

Pulled By: TheSavior

fbshipit-source-id: 9a14755944df642f8b82c46c691d6ed6ee8fa623

* Performance improvement for loading cached images on iOS (#20356)

Summary:
This PR increases the speed at which cached images are loaded and displayed on the screen. Images are currently cached in memory using RCTImageCache, but each time they are loaded, a round trip through RCTNetworking happens before RCTImageCache is even checked. This is likely so that RCTNetworking can handle the caching behavior required by the HTTP headers. However, this means that at the very least, images are read from disk each time they're loaded.

This PR makes RCTImageLoader check RCTImageCache _before_ sending a request to RCTNetworking. RCTImageCache stores a bit of information about the response headers so that it can respect Cache-Control fields without needing a roundtrip through RCTNetworking.

Here are a couple of graphs showing improved loading times before this change (blue) and after (red) with SDWebImage (yellow) as a baseline comparison. The increase is most evident when loading especially large (hi-res photo size) images, or loading multiple images at a time.
https://imgur.com/a/cnL47Z0

More performance gains can potentially be had by increasing the size limit of RCTImageCache: https://github.com/facebook/react-native/blob/1a6666a116fd8b9e8637956de2b41a1c315dd470/Libraries/Image/RCTImageCache.m#L39 but this comes at the tradeoff of being more likely to run into OOM crashes.
Pull Request resolved: https://github.com/facebook/react-native/pull/20356

Reviewed By: PeteTheHeat

Differential Revision: D12909121

Pulled By: alsun2001

fbshipit-source-id: 7f5e21928c53d7aa53f293b7f1b4ec5c99b5f0c2

* Increase cache and file size limits

Summary: This change expands the limits to support a greater variety of scenarios.

Reviewed By: PeteTheHeat

Differential Revision: D12911841

fbshipit-source-id: a7c8eb6fece49dfe47b3ada98f55a02b43396ce8

* Disallow Optional::operator=(nullptr_t) unless T is a pointer

Summary: The old implementation of folly::none inadvertently allowed disengaging an optional by writing `op = nullptr`. Disallow that and require `op = folly::none`.

Reviewed By: yfeldblum

Differential Revision: D12884724

fbshipit-source-id: b17bcf00b245069d8ea2d9bc3703b0fdcaa85c07

* remove createReactClass from ToolbarAndroid/ToolbarAndroid.android.js (#21893)

Summary:
Related to #21581 .
Removed createReactClass from the Libraries/Components/ToolbarAndroid/ToolbarAndroid.android.js

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android
[GENERAL] [ENHANCEMENT] [Libraries/Components/ToolbarAndroid/ToolbarAndroid.android.js] - remove createReactClass dependency
Pull Request resolved: https://github.com/facebook/react-native/pull/21893

Reviewed By: TheSavior

Differential Revision: D12826971

Pulled By: RSNara

fbshipit-source-id: 3d3fb88a3c9faf3ef89e386ca0d41d939f5d14dd

* remove createReactClass from SegmentedControlIOS.ios.js (#21888)

Summary:
Related to #21581 .
Removed createReactClass from the SegmentedControlIOS.ios.js

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android
[GENERAL] [ENHANCEMENT] [Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js] - remove createReactClass dependency
Pull Request resolved: https://github.com/facebook/react-native/pull/21888

Reviewed By: TheSavior

Differential Revision: D12827447

Pulled By: RSNara

fbshipit-source-id: 74a91bcba131d9a34a136c6127459a40424a0738

* Flow type RefreshControl (#22119)

Summary:
Related to #22100

Enhance Flow types for RefreshControl specifying `onRefresh` props type.
There are still 2 `any` left using `requireNativeComponent` that need to be addressed to turn Flow to strict mode.

I went through `RCTRefreshControl` and `AndroidSwipeRefreshLayout` classes to understand where this method came from.

- All flow tests succeed.

[GENERAL] [ENHANCEMENT] [RefreshControl.js] - Flow onRefresh type
Pull Request resolved: https://github.com/facebook/react-native/pull/22119

Differential Revision: D12919764

Pulled By: TheSavior

fbshipit-source-id: 9ba675be8dbce77d77972acb904fc13c68524831

* Remove unused styles (#22083)

Summary:
Removes unused styles.

NOTE: Lint rule `react-native/no-unused-styles` not added because of custom lint rule internally at Facebook that does this.
Pull Request resolved: https://github.com/facebook/react-native/pull/22083

Differential Revision: D12929443

Pulled By: TheSavior

fbshipit-source-id: d42b0be3db745e445447e65df3b78b61f53e4229

* Fix `no-shadow` eslint warning & remove var (#22124)

Summary:
Fixes `no-shadow` warning for `local-cli/link/ios/getGroup.js`  and remove `var` declaration keyword.
```
react-native/local-cli/link/ios/getGroup.js
  13:23  warning  'group' is already declared in the upper scope  no-shadow
```

- [x] Check `npm run flow`
- [x] Check `npm run flow-check-ios`
- [x] Check `npm run flow-check-android`
- [x] Check `npm run lint`

N/A
Pull Request resolved: https://github.com/facebook/react-native/pull/22124

Differential Revision: D12929717

Pulled By: TheSavior

fbshipit-source-id: 10f8269ae7a0e61f4d0ec6fe710889c3a7c90b3b

* Removed unnecessary code in Libraries/Text/Text.js (#22132)

Summary:
I don't think it's necessary to use spread properties (prevState) in `getDerivedStateFromProps`
Pull Request resolved: https://github.com/facebook/react-native/pull/22132

Differential Revision: D12929838

Pulled By: TheSavior

fbshipit-source-id: cdc4f9df8e2f0b2878aec605478144b3e08cea89

* Flow strict StaticContainer (#22121)

Summary:
Related to #22100

Turn on Flow strict mode for StaticContainer.react
This component needed proper Props type definition. I went through the only component (`TabBarItemIOS.ios`) using this to try to know the most appropriate props.

- All flow tests succeed.

[GENERAL] [ENHANCEMENT] [StaticContainer.react.js] - Flow strict mode
Pull Request resolved: https://github.com/facebook/react-native/pull/22121

Differential Revision: D12929646

Pulled By: TheSavior

fbshipit-source-id: 8826aa7bc83c854efdd71cdb4fba3d7ca98f2fce

* Remove var in /Libralies/Experimental/IncrementalPresenter.js (#22144)

Summary:
Remove `var` declaration keyword in ` /Libralies/Experimental/IncrementalPresenter.js` .

- [x] Check `npm run flow`
- [x] Check `npm run flow-check-ios`
- [x] Check `npm run flow-check-android`
- [x] Check `npm run lint`

[GENERAL] [ENHANCEMENT] [Libralies/Experimental] - remove `var`
Pull Request resolved: https://github.com/facebook/react-native/pull/22144

Differential Revision: D12930731

Pulled By: TheSavior

fbshipit-source-id: 64d7689ffec1da14479bdd7106fdea9a3dbeaa42

* Flow strict DrawerLayout (#22152)

Summary:
Issue in focus: #22100

The only occurrence of `Object` was replaced with the appropriate flow type
A Lint error was encountered in `deepFreezeAndThrowOnMutationInDev-test.js` when running `npm run lint` and was fixed by running `yarn prettier`
Pull Request resolved: https://github.com/facebook/react-native/pull/22152

Differential Revision: D12930872

Pulled By: RSNara

fbshipit-source-id: f9706ed2e49d9ccedfa331594c886d2d3b615db5

* Flow strict in ViewPagerAndroid.android.js (#22134)

Summary:
Related to #22100

Turn Flow strict mode on for Libraries/Components/ViewPager/ViewPagerAndroid.android.js

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android

[GENERAL] [ENHANCEMENT] [Libraries/Components/ViewPager/ViewPagerAndroid.android.js] - Flow strict mode
Pull Request resolved: https://github.com/facebook/react-native/pull/22134

Differential Revision: D12930719

Pulled By: TheSavior

fbshipit-source-id: 9519f31b7af27f0497e42fd51f18c19be3692823

* Update and expand bytecode spec

Summary:
* Adds parent tag as param for createNode in place of explicit appendChild commands.
* Adds version info to bytecode
* Adds native conditional support:

Conditionals are represented in product code with the new `NativeConditional` React
component. It takes params necessary to construct a native function call, and takes
a render prop as a child that passes the value of the native call as an arg. In
prod, the component would actually call the native module and render with that value,
but in jest we render for *both* true and false and set them as children
of a new jest-only primitive/host component which we special-case and generate a
special command with `OP_CODE.conditional`, generate the appropriate bytecode commands
for each branch, and embed them as args in the conditional OP_CODE command. When
evaluating the bytecode, only one set of commands is executed, based on the native
module value (which is evaluated with another new opcode which computes the value
and stuffs it in a "register").

Obviously generating this bytecode is kind of a cludge compared to prepack, but
when I asked @[501709947:Dominic] about it, he said they had no bytecode spec right
now, so I'm running ahead with this prototype. The main thing I'm focused on is
the C++/RN bytecode interpretter - this jest stuff is just a way to generate bytecode
for it to consume which could be replaced or augmented with many other approaches,
such as prepack, server rendering, etc.

Also piggybacked a bunch of other cleanup.

Reviewed By: shergin

Differential Revision: D10277121

fbshipit-source-id: 15d3217a59ef481b574c742d17d8a7dc893cba90

* mostly working on Android + OTA

Summary:
It works great on iOS, and mostly works on Android, and is now OTA'able as part of the screen config! Haven't done template view yet. One remaining issue:

Layout is borked on Android. I'm guessing the issue has to do with the timing of setting the constraints in `updateRootLayoutSpecs` and calling `mBinding.startSurface` which actually builds the shadow tree. If I try to call `updateRootLayoutSpecs` earlier, it just crashes immediately. Here's the layout it spits out, which clearly has -440 for the x of 420006, which is the RCTText component, causing it to get cut off on the left of the screen:
```
updateLayoutMountItem for reactTag: 420006 x: -440, y: -13, width: 931, height: 78
updateLayoutMountItem for reactTag: 420010 x: 26, y: 79, width: 0, height: 1651
updateLayoutMountItem for reactTag: 420012 x: 0, y: 26, width: 0, height: 158
updateLayoutMountItem for reactTag: 420016 x: 0, y: 210, width: 454, height: 454
updateLayoutMountItem for reactTag: 420018 x: 454, y: 210, width: 455, height: 454
updateLayoutMountItem for reactTag: 420022 x: 0, y: 690, width: 454, height: 454
updateLayoutMountItem for reactTag: 420024 x: 454, y: 690, width: 455, height: 454
updateLayoutMountItem for reactTag: 420028 x: 0, y: 1171, width: 454, height: 454
updateLayoutMountItem for reactTag: 420030 x: 454, y: 1171, width: 455, height: 454
updateLayoutMountItem for reactTag: 420032 x: 0, y: 1651, width: 0, height: 0
```

Reviewed By: mdvacca

Differential Revision: D12813192

fbshipit-source-id: 450d646af4883ff25184141721351da67b091b7c

* Cleanup a bunch of the JS stuff

Summary: Stricter flow typing, better naming, modularization with context objects, more extensible, etc.

Reviewed By: yungsters

Differential Revision: D10443440

fbshipit-source-id: 171358dfb105829b872d6379064ba4bc29ce34de

* rename ReactBytecode -> UITemplate

Summary: React bytecode is kind of a different thing that sebmarkbage already has in mind so lets keep the namespace separate.

Reviewed By: mdvacca

Differential Revision: D12896293

fbshipit-source-id: e0f266da6e7a051bcf5defea49b958452342754d

* Remove var in Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js (#22126)

Summary:
Replaces the keywords var with let or const in Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js

- [x] Check npm run flow
- [x] Check npm run flow-check-ios
- [x] Check npm run flow-check-android

[GENERAL] [ENHANCEMENT] [Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js] - remove var
Pull Request resolved: https://github.com/facebook/react-native/pull/22126

Differential Revision: D12929758

Pulled By: TheSavior

fbshipit-source-id: bee9dfb463d197458cb218f39274af5a4d16ce1f

* Fabric: Using RuntimeExecutor in concrete EventBeats

Summary: Now we use RuntimeExecutor instead of MessageQueue; that's more clear and remove a dependency from Bridge.

Reviewed By: sahrens

Differential Revision: D12837226

fbshipit-source-id: 0ea3782ce2f49c7f3a91425880863e3b3ea37712

* Fabric: Explicit clearing std::vector after moving from it

Summary: Apparently, the standard does not guarantee that the vector is empty after moving from it. So, let's clear it explicitly instead of asserting the emptiness.

Reviewed By: sahrens

Differential Revision: D12837227

fbshipit-source-id: 85dff6848707f4204f4c79be173064547e83c63e

* Fabric: Making jsi::Runtime a part of EventBeat and EventPipe

Summary:
We double down on JSI in Fabric. So, practically, JSI is now a hard dependency for Fabric. I hope it's for good.
Now `jsi::Runtime` is coupled with scheduling via `EventExecuter`, so we have to make `jsi::Runtime` a part of `EventBeat` to proxy runtime reference to bindgings.

Reviewed By: sahrens

Differential Revision: D12837225

fbshipit-source-id: 98edc33d6a3358e6c2905f2f03ce0004a9ca0503

* Fabric: Removing deprecated leftovers from RCTScheduler and RCTSurfacePresenter

Summary: Trivial. We don't use it anymore.

Reviewed By: mdvacca

Differential Revision: D12876743

fbshipit-source-id: dc979aaea1fef443b8caf2e58d44b0c7aad90246

* Fabric: Some helper classes and functions were moved to uimanager/primitives

Summary: Trivial.

Reviewed By: mdvacca

Differential Revision: D12876747

fbshipit-source-id: a2e72ecb69ffc3787f0d8b432f06b9c9715ac5b1

* Fabric: Introduced ComponentDescriptorRegistry::at() method family

Summary: This is more usable (because it allows to use `->` operator) and safe (const-style) methods replacing old `operator[]` methods.

Reviewed By: mdvacca

Differential Revision: D12876744

fbshipit-source-id: 8ea7398c9777f8be3e88db873ec00915d0761615

* Fabric: A bunch of functions for converting JSI primitives to Fabric and vice-versa

Summary: We need to decouple this from actual JSI/UIManagerBinding implementation to make them more maintainable.

Reviewed By: sahrens

Differential Revision: D12876742

fbshipit-source-id: 30cad69d0a9761e2aa82f31d180e4b5a40cedb61

* Fabric: Introducing UIManagerBinding, a replacement for JSIFabricUIManager

Summary:
This diff changes how we expose UIManager to JavaScript realm and control ownership of it. This change should improve reliability and a thread-safety.

UIManagerBinding is a HostObject which consolidate ownership of UIManager. Now JavaScript's GC controls its lifetime which eliminates the possibility of calling some JS facing methods of UIManager using a dangling pointer.
Besides that, all API now imply that if the caller has a reference to jsi::Runtime, it calls the method on the proper thread (it's an implication of RuntimeExecutor design).

Reviewed By: sahrens

Differential Revision: D12876745

fbshipit-source-id: eb8c70317460df5b14e45031ad15fc6c8e5b5ce3

* Fabric: Making some picky compilers happy

Summary: Trivial nits.

Reviewed By: mdvacca

Differential Revision: D12897927

fbshipit-source-id: 61cec4a070218606d52f05740aacbfae1d2efd31

* TouchEventEmitter: Fix assignment of Y coordinates (#22160)

Summary:
This patch fixes the the assignment of Y coordinate information in the event payloads in `TouchEventEmitter`, which were inadvertently being assigned X coordinate data.
Pull Request resolved: https://github.com/facebook/react-native/pull/22160

Differential Revision: D12943125

Pulled By: shergin

fbshipit-source-id: a3fde64c4d6c76784f1a0ac7cae4c0d62f3d4497

* Types for BackHandler

Summary: Improve types for BackHandler

Reviewed By: benjaffe

Differential Revision: D9838175

fbshipit-source-id: 839a5a695b468974aadb7bc0da1a23ef844fdd7f

* Fix inline styles in ReactAndroid (#22166)

Summary:
Fix `react-native/no-inline-styles` eslint warning for ReactAndroid module.
Pull Request resolved: https://github.com/facebook/react-native/pull/22166

Differential Revision: D12946925

Pulled By: TheSavior

fbshipit-source-id: f4bc0653bd2971e551bc46d89455c006003947c7

* Fix inline styles in IntegrationTests (#22165)

Summary:
Fix `react-native/no-inline-styles` eslint warning for IntegrationTests module.
Pull Request resolved: https://github.com/facebook/react-native/pull/22165

Differential Revision: D12946915

Pulled By: TheSavior

fbshipit-source-id: 438bb74cc34dd5893f725e4865568715ce949c3a

* Flow strict Slider (#22127)

Summary:
Related to #22100

Turn on Flow strict mode for Slider.
Enhanced event type and props callbacks type defs for Slider.

- All flow tests succeed.

[GENERAL] [ENHANCEMENT] [Slider.js] - Flow strict mode
Pull Request resolved: https://github.com/facebook/react-native/pull/22127

Differential Revision: D12946817

Pulled By: TheSavior

fbshipit-source-id: 631391f70c04fddf0bfa6fec92f5cb769a555547

* Flow strict TouchableOpacity (#22146)

Summary:
Related to #22100

Enhance Flow types for TouchableOpacity specifying Touchable event types and TvParallaxPropertiesType.
I had to export TvParallaxPropertiesType from TVViewPropTypes file.
There are still 1 any left using requireNativeComponent and a dependency to `Touchable` that need to be addressed to turn Flow to strict mode.

I guess `Touchable` is a lot more work since there's no flow annotation and it's still good old Mixin.

- All flow tests succeed.

[GENERAL] [ENHANCEMENT] [TouchableOpacity.js] - Flow types
[GENERAL] [ENHANCEMENT] [TVViewPropTypes.js] - Export type
Pull Request resolved: https://github.com/facebook/react-native/pull/22146

Reviewed By: TheSavior

Differential Revision: D12927044

Pulled By: RSNara

fbshipit-source-id: c63d805699dd58e2fbc4fd1df4ee0c9f87e2336a

* Fix inline styles warning in Libraries (#22161)

Summary:
Fixes `react-native/no-inline-styles` eslint warnings in the `Libraries` module.
Pull Request resolved: https://github.com/facebook/react-native/pull/22161

Differential Revision: D12946899

Pulled By: TheSavior

fbshipit-source-id: c97ffa50dd90529dabf30a3d2cb09476acc568cb

* Allow overriding Metro server host with a system prop

Summary:
Allow a device to override the host to which to connect to for getting dev bundles, debugging etc.

This is read from a system prop so it can be shared across all React Native apps and persists between app installs.

Reviewed By: mdvacca

Differential Revision: D10842213

fbshipit-source-id: d15b7d0255130090744d60ffb239778cba15e49c

* iOS: Attempt to load lazy modules when asked from native

Summary:
Previously, asking for an instance of NativeModule from the native side gave `nil` if the lazy modules have not been loaded, which is not consistent with the access from JS. This at least attempts to force load the lazy modules when asked from native.

p.s. one asks for a module by doing `[bridge moduleForClass:[FooBar class]]`.

Reviewed By: spredolac

Differential Revision: D12931640

fbshipit-source-id: 15d2dc574067d3386ef921512ce4bc837749dabd

* Fix build error caused by -Werror=class-memaccess (#823)

Summary:
OS: Arch Linux
GCC Version: gcc (GCC) 8.2.1 20180831
Clang Version: 6.0.1 (tags/RELEASE_601/final)

Build Log Before Fix:

command: `buck build //:yoga`
```
Not using buckd because watchman isn't installed.
yoga/Yoga.cpp: In function ‘void YGZeroOutLayoutRecursivly(YGNodeRef)’:
yoga/Yoga.cpp:1854:51: error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct YGLayout’; use assignment or value-initialization instead [-Werror=class-memaccess]
   memset(&(node->getLayout()), 0, sizeof(YGLayout));
                                                   ^
In file included from yoga/YGNode.h:11,
                 from yoga/Utils.h:9,
                 from yoga/Yoga.cpp:13:
yoga/YGLayout.h:12:8: note: ‘struct YGLayout’ declared here
 struct YGLayout {
        ^~~~~~~~
cc1plus: all warnings being treated as errors
Build failed: Command failed with exit code 1.
stderr: yoga/Yoga.cpp: In function ‘void YGZeroOutLayoutRecursivly(YGNodeRef)’:
yoga/Yoga.cpp:1854:51: error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct YGLayout’; use assignment or value-initialization instead [-Werror=class-memaccess]
   memset(&(node->getLayout()), 0, sizeof(YGLayout));
                                                   ^
In file included from yoga/YGNode.h:11,
                 from yoga/Utils.h:9,
                 from yoga/Yoga.cpp:13:
yoga/YGLayout.h:12:8: note: ‘struct YGLayout’ declared here
 struct YGLayout {
        ^~~~~~~~
cc1plus: all warnings being treated as errors
    When running <c++ preprocess_and_compile>.
    When building rule //:yoga#compile-Yoga.cpp.o9b5477b5,default.
Parsing buck files: finished in 0.8 sec (100%)
Building: finished in 2.2 sec (100%) 10/10 jobs, 1 updated
  Total time: 3.3 sec
```

Build Log After Fix

command: `buck build //:yoga`
```
Not using buckd because watchman isn't installed.
Parsing buck files: finished in 0.8 sec (100%)
Building: finished in 0.6 sec (100%) 1/1 jobs, 0 updated
  Total time: 1.6 sec
```

All tests are passing
Pull Request resolved: https://github.com/facebook/yoga/pull/823

Reviewed By: davidaurelio

Differential Revision: D10486023

Pulled By: passy

fbshipit-source-id: e9de734c3ce6c45ea4a8edd5d78206901d85ca84

* Add Yoga JNI bindings to libcoldstart

Summary:
Yoga's JNI bindings are usually loaded during class loading, and can stall the UI thread.

Here, we try to mitigate the problem by adding the bindings to libcoldstart.

Reviewed By: michalgr

Differential Revision: D12956818

fbshipit-source-id: 9dda5cb6d26c2bae64606bc2d7c98ab8f7c05a30

* console polyfill: pass unsupported messages to original console

Summary: Some console methods (like `groupCollapsed` or `clear`) are not supported by console.js polyfill and are not passed to the original console objects.

Reviewed By: sahrens

Differential Revision: D12900996

fbshipit-source-id: 1b2f487028e418ae934f631996eaaf63abdced82

* Fix IllegalArgumentException when dismissing ReactModalHostView

Summary: This diff fixes an IllegalArgumentException when dismissing ReactModalHostView. I wasn't able to reproduce this error because this is likely created by a race condition.

Reviewed By: axe-fb

Differential Revision: D12916787

fbshipit-source-id: b071ffc4c251f2a613bb1270de005def56818376

* TextInput: Remove PropTypes, NativeMethodsMixin; Convert to ES6 class (#21885)

Summary:
This pull requests converts `TextInput` to an ES6 class, and in the process removes its usage of `prop-types` and `NativeMethodsMixin`.

The code (and some relevant types) for the native components have been moved to `TextInputNativeComponent.js`.

The rest of the flow proptypes have been moved to `TextInputTypes.js`.
Pull Request resolved: https://github.com/facebook/react-native/pull/21885

Reviewed By: RSNara

Differential Revision: D10515754

Pulled By: TheSavior

fbshipit-source-id: 5cfb25344385904b37a49582008c2a4b46db809d

* Fix internal types on top of TextInput refactor

Summary:
Types were moved out of TextInput into TextInputTypes for better re-use. Fixing the internal callsites.

This isn't much of a worry externally because these types aren't exposed as part of the public API

Reviewed By: RSNara

Differential Revision: D10517066

fbshipit-source-id: bade4285eafb3d7ab5ab1e4b0730c22d45925509

* Fixing TextInput related jest tests

Reviewed By: yungsters

Differential Revision: D10519823

fbshipit-source-id: 02368b670953a0275fa6495b0c73ef84403598cb

* TextInput add back propTypes

Reviewed By: yungsters

Differential Revision: D12969854

fbshipit-source-id: c2fe2c46e538f8b5e3ea46257aef70d00bf14364

* React sync for revisions 4773fdf...3ff2c7c

Summary:
@public
This sync includes the following changes:
- **[3ff2c7ccd](https://github.com/facebook/react/commit/3ff2c7ccd)**: Invalid actualDuration+treeBaseDuration for hidden+suspended trees (#14065) //<Brian Vaughn>//
- **[5afa1c4ed](https://github.com/facebook/react/commit/5afa1c4ed)**: Tag MemoComponent with PerformedWork effectTag for DevTools Profiler (#14141) //<Brian Vaughn>//
- **[e27720d7f](https://github.com/facebook/react/commit/e27720d7f)**: [Synchronous Suspense] Reuse deletions from primary tree (#14133) //<Andrew Clark>//
- **[aa1ffe4e7](https://github.com/facebook/react/commit/aa1ffe4e7)**: Show deprecated context object warnings usage in ReactDOM server (#14033) //<Dominic Gannaway>//
- **[e3a7b9645](https://github.com/facebook/react/commit/e3a7b9645)**: Make react-debug-tools a private package //<Andrew Clark>//
- **[ba1984423](https://github.com/facebook/react/commit/ba1984423)**: Update bundle sizes for 16.6.1 release //<Andrew Clark>//
- **[b50e63ef5](https://github.com/facebook/react/commit/b50e63ef5)**: Updating package versions for release 16.6.1 //<Andrew Clark>//
- **[8f2c89e96](https://github.com/facebook/react/commit/8f2c89e96)**: Make react-debug-tools a private package //<Andrew Clark>//
- **[2aecbcd6f](https://github.com/facebook/react/commit/2aecbcd6f)**: "functional component" -> "function component" (#14123) //<locknono>//
- **[b4608dd24](https://github.com/facebook/react/commit/b4608dd24)**: Remove unused simulated flag parameter (#14127) //<Nadav Kaner>//
- **[3c69a1881](https://github.com/facebook/react/commit/3c69a1881)**: Recover from errors with a boundary in completion phase (#14104) //<Dan Abramov>//
- **[b020fb114](https://github.com/facebook/react/commit/b020fb114)**: Check correct commit phase props in fuzz tester (#14129) //<Andrew Clark>//
- **[b67c1a2ee](https://github.com/facebook/react/commit/b67c1a2ee)**: Add DEV-only checks for assumption about instance properties (#14128) //<Dan Abramov>//
- **[f777d196e](https://github.com/facebook/react/commit/f777d196e)**: Fix lazy() with defaultProps (#14112) //<Dan Abramov>//
- **[e4512991c](https://github.com/facebook/react/commit/e4512991c)**: Fix unhiding in IE11 (#14126) //<Sophie Alpert>//
- **[affb2b50c](https://github.com/facebook/react/commit/affb2b50c)**: Enable hooks in www test renderer, too //<Andrew Clark>//
- **[0a0f503d5](https://github.com/facebook/react/commit/0a0f503d5)**: Enable hooks in www build (#14116) //<Andrew Clark>//
- **[600651e68](https://github.com/facebook/react/commit/600651e68)**: Restore the Hooks dispatcher after using SSR (#14105) //<Dan Abramov>//
- **[e9a2ec915](https://github.com/facebook/react/commit/e9a2ec915)**: [suspense] Avoid double commit by re-rendering immediately and reusing primary children (#14083) //<Andrew Clark>//
- **[9d47143e8](https://github.com/facebook/react/commit/9d47143e8)**: Implement {,un}hideInstance on RN renderer (#14115) //<Sophie Alpert>//
- **[ebdb47d2c](https://github.com/facebook/react/commit/ebdb47d2c)**: DCE hooks code when flag is off (#14111) //<Sophie Alpert>//
- **[8b87ebf5b](https://github.com/facebook/react/commit/8b87ebf5b)**: Rename .internal tests that aren't using internals (#14109) //<Sophie Alpert>//
- **[da04058a9](https://github.com/facebook/react/commit/da04058a9)**: Use Function.prototype.apply in warningWithoutStack (#14107) //<Sophie Alpert>//
- **[fd1256a56](https://github.com/facebook/react/commit/fd1256a56)**: Add Debug Tools Package for Introspection of Hooks (#14085) //<Sebastian Markbåge>//
- **[b305c4e03](https://github.com/facebook/react/commit/b305c4e03)**: fix(react-dom): Fix crash during server render (#14103) //<Tiago Nunes>//
- **[d34d1c3ba](https://github.com/facebook/react/commit/d34d1c3ba)**: react-reconciler: Update README.md (#13953) //<Marcelo Jorge Vieira>//
- **[6c404d82a](https://github.com/facebook/react/commit/6c404d82a)**: Bugfix: Add back early return in setOffsets which was removed between 16.4.2 and 16.5.0. Fails in Edge in some scenarios. (#14095) //<einarq>//
- **[8eca0eff8](https://github.com/facebook/react/commit/8eca0eff8)**: chore(tests): don't rely on jest fake timers scheduling real timers (#14003) //<Simen Bekkhus>//
- **[293fed899](https://github.com/facebook/react/commit/293fed899)**: Warn for bad useEffect return value (#14069) //<Sophie Alpert>//
- **[ae196e84b](https://github.com/facebook/react/commit/ae196e84b)**: Rename inputsAreEqual to areHookInputsEqual & move it to shared (#14036) //<Mateusz Burzyński>//
- **[c898020e0](https://github.com/facebook/react/commit/c898020e0)**: Warn for forwardRef(memo(...)) (#14070) //<Sophie Alpert>//
- **[bf9fadfcf](https://github.com/facebook/react/commit/bf9fadfcf)**: [Hooks] Remove dispatch callbacks (#14037) //<Andrew Clark>//
- **[8c67bbf18](https://github.com/facebook/react/commit/8c67bbf18)**: [scheduler] Deadline object -> shouldYield (#14025) //<Andrew Clark>//
- **[e02086bfc](https://github.com/facebook/react/commit/e02086bfc)**: Warn about variable number of dependencies //<Andrew Clark>//
- **[b92cdef64](https://github.com/facebook/react/commit/b92cdef64)**: Rename ReactHooks test suite //<Andrew Clark>//
- **[6efbbe068](https://github.com/facebook/react/commit/6efbbe068)**: Prettier //<Sophie Alpert>//
- **[504576306](https://github.com/facebook/react/commit/504576306)**: Swap order of function member in hook union types //<Andrew Clark>//
- **[ddbfe2ed5](https://github.com/facebook/react/commit/ddbfe2ed5)**: Add ESLint rule for React Hooks //<Caleb Meredith>//
- **[acb489963](https://github.com/facebook/react/commit/acb489963)**: Clear effect tags from a fiber that suspends in non-concurrent mode //<Andrew Clark>//
- **[933b64710](https://github.com/facebook/react/commit/933b64710)**: Disable hook update callback (2nd arg to setState/dispatch) //<Andrew Clark>//
- **[5fc84efac](https://github.com/facebook/react/commit/5fc84efac)**: Skip updating effect tag when skipping effect //<Sophie Alpert>//
- **[9f34eb79a](https://github.com/facebook/react/commit/9f34eb79a)**: Add readContext to ReactPartialRendererHooks //<Alex Taylor>//
- **[f7cb9d2b2](https://github.com/facebook/react/commit/f7cb9d2b2)**: Warn about useContext(Consumer|Provider) //<Dan Abramov>//
- **[63cc7d2b3](https://github.com/facebook/react/commit/63cc7d2b3)**: Test useContext in pure, forwardRef, and PureComponent //<Dan Abramov>//
- **[3a7c6da8d](https://github.com/facebook/react/commit/3a7c6da8d)**: Make effects actually work with memo //<Sophie Alpert>//
- **[75a1c2e72](https://github.com/facebook/react/commit/75a1c2e72)**: The Lost Effect, chapter 3 //<Sophie Alpert>//
- **[55a4b1f37](https://github.com/facebook/react/commit/55a4b1f37)**: memo supports Hooks //<Sophie Alpert>//
- **[30aa4ad55](https://github.com/facebook/react/commit/30aa4ad55)**: The Lost Effect, chapter 2 //<Sophie Alpert>//
- **[b772e0e26](https://github.com/facebook/react/commit/b772e0e26)**: "functional component" -> "function component" in hooks error messages //<Sebastian Markbåge>//
- **[9e9e3970e](https://github.com/facebook/react/commit/9e9e3970e)**: Warn for Hook set-state on unmounted component //<Sophie Alpert>//
- **[6514697f0](https://github.com/facebook/react/commit/6514697f0)**: Make sure deletions don't stop passive effects //<Sophie Alpert>//
- **[dd019d34d](https://github.com/facebook/react/commit/dd019d34d)**: Add support for hooks to ReactDOMServer //<Alex Taylor>//
- **[11d0781ee](https://github.com/facebook/react/commit/11d0781ee)**: Defer useEffect until after paint //<Andrew Clark>//
- **[105f2de54](https://github.com/facebook/react/commit/105f2de54)**: Put hooks behind feature flag //<Andrew Clark>//
- **[7bee9fbdd](https://github.com/facebook/react/commit/7bee9fbdd)**: Initial hooks implementation //<Andrew Clark>//
- **[37c7fe0a5](https://github.com/facebook/react/commit/37c7fe0a5)**: Update createRoot warning message based on `enableStableConcurrentModeAPIs` (#14017) //<Rauno Freiberg>//
- **[95f98a187](https://github.com/facebook/react/commit/95f98a187)**: fix typo (#13955) //<Joseph>//
- **[e217f2f1a](https://github.com/facebook/react/commit/e217f2f1a)**: Updated comment for getEventModifierState (#13918) //<Patrick>//
- **[275e76e83](https://github.com/facebook/react/commit/275e76e83)**: Enable stable concurrent APIs flag for 16.7 alpha (#13928) //<Brian Vaughn>//
- **[8b97a9c36](https://github.com/facebook/react/commit/8b97a9c36)**: Update bundle sizes for 16.6.0 release //<Dan Abramov>//
- **[6c29eabf7](https://github.com/facebook/react/commit/6c29eabf7)**: Updating package versions for release 16.6.0 //<Dan Abramov>//
- **[d520b358d](https://github.com/facebook/react/commit/d520b358d)**: Revert all package versions to 16.5.2 state //<Dan Abramov>//
- **[8f1ec7649](https://github.com/facebook/react/commit/8f1ec7649)**: Bump versions to beta.0 //<Dan Abramov>//
- **[5055a83fa](https://github.com/facebook/react/commit/5055a83fa)**: Revert "Revert "Updating dependencies for react-noop-renderer"" //<Dan Abramov>//
- **[3e8b4a5b8](https://github.com/facebook/react/commit/3e8b4a5b8)**: Revert "Updating dependencies for react-noop-renderer" //<Brian Vaughn>//
- **[d8e03de4a](https://github.com/facebook/react/commit/d8e03de4a)**: [react-cache] Remove `cache` as argument to `read` (#13865) //<Andrew Clark>//
- **[fefa1269e](https://github.com/facebook/react/commit/fefa1269e)**: Revert accidentally committed existence check (#13931) //<Andrew Clark>//
- **[80a0c05ce](https://github.com/facebook/react/commit/80a0c05ce)**: Removed react-cache from the bundle list for now (#13930) //<BrianVaughn>//
- **[915e4eab5](https://github.com/facebook/react/commit/915e4eab5)**: Add "unstable_" prefix to react-cache and jest-react (#13929) //<Brian Vaughn>//
- **[cbbc2b6c4](https://github.com/facebook/react/commit/cbbc2b6c4)**: [Synchronous Suspense] Suspending a class outside concurrent mode (#13926) //<Andrew Clark>//
- **[4947fcd76](https://github.com/facebook/react/commit/4947fcd76)**: Fix lint (#13923) //<Sebastian Markbåge>//
- **[d75c69e0c](https://github.com/facebook/react/commit/d75c69e0c)**: Remove unstable_ prefix from Suspense (#13922) //<Sebastian Markbåge>//
- **[c8ef2feda](https://github.com/facebook/react/commit/c8ef2feda)**: Remove redundant word "the" (#13919) //<John Lin>//
- **[55444a6f4](https://github.com/facebook/react/commit/55444a6f4)**: Try rendering again if a timed out tree receives an update (#13921) //<Andrew Clark>//
- **[04c4f2fce](https://github.com/facebook/react/commit/04c4f2fce)**: [reconciler] ReactFiberNewContext import maxSigned31BitInt twice (#13857) //<yongningfu>//
- **[409e472fc](https://github.com/facebook/react/commit/409e472fc)**: Add flow types in ReactControlledComponent (#13669) //<Abdul Rauf>//
- **[663835a43](https://github.com/facebook/react/commit/663835a43)**: Add flow types in getEventModifierState (#13909) //<Abdul Rauf>//
- **[82710097f](https://github.com/facebook/react/commit/82710097f)**: Add flow types in getNodeForCharacterOffset (#13908) //<Abdul Rauf>//
- **[b753f76a7](https://github.com/facebook/react/commit/b753f76a7)**: Fix failing async tests in Node 10 //<Andrew Clark>//
- **[b5c0852fd](https://github.com/facebook/react/commit/b5c0852fd)**: Bump version to 16.6.0-beta.0 (#13906) //<Dan Abramov>//
- **[769b1f270](https://github.com/facebook/react/commit/769b1f270)**: pure -> memo (#13905) //<Dan Abramov>//
- **[8ecd4bd4f](https://github.com/facebook/react/commit/8ecd4bd4f)**: Add support for React.pure in ReactDOMServer (#13855) //<Alex Taylor>//
- **[15b11d23f](https://github.com/facebook/react/commit/15b11d23f)**: Allow arbitrary types to be wrapped in pure (#13903) //<Sebastian Markbåge>//
- **[e770af7a3](https://github.com/facebook/react/commit/e770af7a3)**: Add back accidentally deleted `break` to prevent fallthrough //<Andrew Clark>//
- **[95a313ec0](https://github.com/facebook/react/commit/95a313ec0)**: Unfork Lazy Component Branches (#13902) //<Sebastian Markbåge>//
- **[e16cdd5b1](https://github.com/facebook/react/commit/e16cdd5b1)**: Always bail out timed out children even if they receive an update (#13901) //<Andrew Clark>//
- **[7268d97d2](https://github.com/facebook/react/commit/7268d97d2)**: Centralize props memoization (#13900) //<Sebastian Markbåge>//
- **[0fc044679](https://github.com/facebook/react/commit/0fc044679)**: Class component can suspend without losing state outside concurrent mode (#13899) //<Andrew Clark>//
- **[36db53822](https://github.com/facebook/react/commit/36db53822)**: Bugfix for #13886 (#13896) //<Andrew Clark>//
- **[6938dcaac](https://github.com/facebook/react/commit/6938dcaac)**: SSR support for class contextType (#13889) //<Sebastian Markbåge>//
- **[fa65c58e1](https://github.com/facebook/react/commit/fa65c58e1)**: Add readContext to SSR (#13888) //<Sebastian Markbåge>//
- **[d9a3cc070](https://github.com/facebook/react/commit/d9a3cc070)**: React.lazy constructor must return result of a dynamic import (#13886) //<Andrew Clark>//
- **[d9659e499](https://github.com/facebook/react/commit/d9659e499)**: Lazy components must use React.lazy (#13885) //<Andrew Clark>//
- **[0648ca618](https://github.com/facebook/react/commit/0648ca618)**: Revert "React.pure automatically forwards ref" (#13887) //<Sophie Alpert>//
- **[4dd772ac1](https://github.com/facebook/react/commit/4dd772ac1)**: Prettier :( //<Andrew Clark>//
- **[98bab66c3](https://github.com/facebook/react/commit/98bab66c3)**: Fix lint //<Andrew Clark>//
- **[8ced545e3](https://github.com/facebook/react/commit/8ced545e3)**: Suspense component does not capture if `fallback` is not defined (#13879) //<Andrew Clark>//
- **[b738ced47](https://github.com/facebook/react/commit/b738ced47)**: Remove render prop option from Suspense (#13880) //<Andrew Clark>//
- **[55b827942](https://github.com/facebook/react/commit/55b827942)**: Strict mode and default mode should have same Suspense semantics (#13882) //<Andrew Clark>//
- **[dac9202a9](https://github.com/facebook/react/commit/dac9202a9)**: Hide timed-out children instead of deleting them so their state ispreserved (#13823) //<Andrew Clark>//
- **[4f0bd4590](https://github.com/facebook/react/commit/4f0bd4590)**: Replacement of old links, by the new ones of the documentation. (#13871) //<Pablo Javier D. A>//
- **[7685b55d2](https://github.com/facebook/react/commit/7685b55d2)**: Remove unstable_read() in favor of direct dispatcher call (#13861)//<Dan Abramov>//
- **[21a79a1d9](https://github.com/facebook/react/commit/21a79a1d9)**: [schedule] Call ensureHostCallbackIsScheduled without args (#13852) //<Trivikram Kamat>//
- **[9ea4bc6ed](https://github.com/facebook/react/commit/9ea4bc6ed)**: Fix false positive context warning when using an old React (#13850) //<Dan Abramov>//

Release Notes:
[GENERAL] [FEATURE] [React] - React sync for revisions 4773fdf...3ff2c7c

Reviewed By: sebmarkbage

Differential Revision: D12955345

fbshipit-source-id: db12076758fe85a519074ca4fe3aa5ede6f4fd49

* Fix args passed when measuring Androidwitch

Summary: The first argument to `View.MeasureSpec.makeMeasureSpec` should be positive, but was being passed WRAP_CONTENT, which is negative. This diff fixes that.

Reviewed By: achen1

Differential Revision: D6601683

fbshipit-source-id: 6d8499830f7b6da40848bab77d5ddbbb8a6fe44f

* Enable unused-private-field warning (#13450)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13450

Pull Request resolved: https://github.com/facebook/react-native/pull/22065

This diff enables -Wunused-private-field clang warning for Android builds and fixes all broken targets.

Reviewed By: gkmhub

Differential Revision: D12881793

fbshipit-source-id: 515555661e137be9e7b20eac9b5bdcb549d6a094

* Update oss lockfile

Summary: Updating lockfile to fix open source sanity test.

Reviewed By: hramos

Differential Revision: D12982917

fbshipit-source-id: 1e2f0abadf6e76b67215b70b8c71dea1c2c05bff

* Replace String with constants for Module names in Fb4aCoreInfraPackage

Summary: Using constants is safer than using strings. More details at D12843649

Reviewed By: sahrens

Differential Revision: D8226521

fbshipit-source-id: 4c78c8dfe0bd658f46c8f81e50ceae9299fc6f3c

* Give eagerly loaded modules precedent over lazily loaded one.

Summary: Before lazily-loading code existed, modules that were already loaded into memory took precedent over modules that were additionally registered. With lazily loading modules, instead of giving eagerly loaded modules precdence, it throws a redbox. This diff fixes that behavior.

Reviewed By: PeteTheHeat

Differential Revision: D12983805

fbshipit-source-id: fe4fcf35d5c2ca6f9f4e3f0d1d8c2ca35468fb1b

* Stop mounting of Views when there is an exception in Native

Summary: This diff fixes exception handling for Mounting of views, as soon as there is an exception we stop the mounting of views because from that point the UI View tree is going to be inconsistent with the ReactShadow tree from C++. We also stop the mounting of views when the host is paused, this allows us to not keep mounting views

Reviewed By: shergin

Differential Revision: D10510334

fbshipit-source-id: b0d3eba580ff92d8b8400244ec9d7c266db42ff9

* Temporary disable AndroidSwipeRefreshLayout

Summary: AndroidSwipeRefreshLayout is rendered in the "Marketplace Your Items" screen altough it is disabled. This diff just temporary implements the AndroidSwipeRefreshLayout component as a View (similar to the iOS counterpart RefreshControl).

Reviewed By: shergin

Differential Revision: D10524049

fbshipit-source-id: 5df38fbdf1339b3857138d82a7100ec7f15854b3

* Force navigation to use root tag

Summary: This diff ensures that JS uses rootTags during navigation. A redbox will be rendered in debug mode when a non-rootTag is used during navigation. This change enables proper navigation for Fabric.

Reviewed By: shergin

Differential Revision: D10855198

fbshipit-source-id: a82aaa706cd62ce92143fa86d0a422c1ae439a50

* Add systrace support in Fabric C++

Summary: This diff adds systrace support in the C++ side of Fabric

Reviewed By: ejanzer

Differential Revision: D12861373

fbshipit-source-id: 0291f3e406f239bbef3686ac0bba6e9f1c7eac57

* Refactor 'induce' of events in Fabric Android

Summary:
This diff refactors the exeuction of 'AsyncEventBeat.induce()' as part of the delivery of events of Fabric Android implementation.
The first part of the refactor moves the exeuction of onBatchEventDispatched out of the synchronization block for mEventsToDispatchLock. This lock is accessed from the UI Thread and executing the induce inside this synchronization block will affect UI,
The second part of the refactor is to ensure that the exeuction of the C++ method AsyncEventBeat.induce() always happen in the JS Thread.

Reviewed By: shergin

Differential Revision: D12861387

fbshipit-source-id: e1cd03467274a1c5fcd04b0ac7efdbe7169b14c3

* Expose rootTag / surfaceId as part of schedulerDidRequestPreliminaryViewAllocation method

Summary: This diff exposes rootTag as part of SchedulerDelegate.schedulerDidRequestPreliminaryViewAllocation(). This will be necessary to be able to pool views per Surface in Android

Reviewed By: shergin

Differential Revision: D12875656

fbshipit-source-id: d2a8c1f9bcc6b14c17b34bf59085da44ae3c3416

* Switch to synchronous strategy for unprotect

Summary:
Older versions of JSC (ios 11 and before) have a bug which I
believe the ProtectionQueue mechanism tickles:
https://bugs.webkit.org/show_bug.cgi?id=186827

This removes the ProtectionQueue and replaces it with an atomic flag
to avoid calling unprotect after VM shutdown.

This also fixes a race condition in shutdown.

Reviewed By: danzimm

Differential Revision: D12969953

fbshipit-source-id: fa3a14f3207be67a987ac3cf0fc1c9ce88837b0b

* Fix inline styles eslint warnings for examples (#22123)

Summary:
Fixes `react-native/no-inline-styles` warning for several examples. I'm limiting the size of this PR to make it simpler to review.
Pull Request resolved: https://github.com/facebook/react-native/pull/22123

Reviewed By: RSNara

Differential Revision: D12929701

Pulled By: TheSavior

fbshipit-source-id: 7a976f2208b557fcfda46d5b586b30652c550eb2

* Back out TextInput es6 conversion

Summary:
This was failing due to issues with refs, which we were able to fix and then finally due to some jest tests that were failing due to things being null that shouldn't be which I couldn't easily figure out. Reverting the stack until we can actually solve it, hopefully with additional tests.

This was created by running:

```
$ hg backout c2fe2c46e538
fetching tree '' b9bbfc1925c6daf85ba3227d12f177aca9c0c054, based on 4257c76aefa84aaa17279e65aa7ca1174f4401e7, found via 02368b670953
connected to hg015.frc2.facebook.com
60 trees fetched over 2.91s
fetching tree '' c3c304df13399f0f1a29a668242da454fc1d8a97, based on b9bbfc1925c6daf85ba3227d12f177aca9c0c054, found via c2fe2c46e538
7 trees fetched over 0.03s
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
commit 4270328:50a65c5c2e27 backs out commit 4266783:c2fe2c46e538
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over 0.57s
[twsvcscm@sandcastle3265.ftw1 /data/sandcastle/boxes/instance-ide/xplat/js (50a65c5)]$ hg backout 02368b670953
fetching tree '' a46c8ca065f5b92cf375d7ed899fc5ca268ba4da, based on b9bbfc1925c6daf85ba3227d12f177aca9c0c054, found via bade4285eafb
connected to hg024.frc2.facebook.com
27 trees fetched over 3.21s
fetching tree '' 361548a090e81d18bab6f4fc16036c518cb4d7c1, based on a46c8ca065f5b92cf375d7ed899fc5ca268ba4da, found via bade4285eafb
41 trees fetched over 0.10s
merging react-native-github/Libraries/Components/TextInput/TextInput.js
8 files updated, 1 files merged, 0 files removed, 0 files unresolved
commit 4270329:dbaca0daf0ac backs out commit 4266782:02368b670953
14 files fetched over 7 fetches - (14 misses, 0.00% hit ratio) over 1.72s
[twsvcscm@sandcastle3265.ftw1 /data/sandcastle/boxes/instance-ide/xplat/js (dbaca0d)]$ hg backout bade4285eafb
connected to hg030.frc2.facebook.com
fetching tree '' 1b4a17164fdbfcad40139e46da4a9bfa8aa8def3, based on 361548a090e81d18bab6f4fc16036c518cb4d7c1, found via 5cfb25344385
7 trees fetched over 0.06s
merging react-native-github/Libraries/Components/TextInput/TextInput.js
20 files updated, 1 files merged, 0 files removed, 0 files unresolved
commit 4270330:2951740e5b32 backs out commit 4266781:bade4285eafb
33 files fetched over 14 fetches - (33 misses, 0.00% hit ratio) over 4.50s
[twsvcscm@sandcastle3265.ftw1 /data/sandcastle/boxes/instance-ide/xplat/js (2951740)]$ hg backout 5cfb25344385
connected to hg035.frc2.facebook.com
merging react-native-github/Libraries/Components/TextInput/TextInput.js
0 files updated, 1 files merged, 2 files removed, 0 files unresolved
commit 4270331:fffb4629a397 backs out commit 4266780:5cfb25344385
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over 4.03s
```

Reviewed By: yungsters

Differential Revision: D12989604

fbshipit-source-id: 703a7c9c1f5bdd710077e515bdff06fdb34502ec

* `Removing UIManager.measureViewsInRect()`

Summary:
It does not supported on Android and nobody uses it.
I could find only one use cases: Very old versin of `SectionList` library (4 years ago).

Reviewed By: sahrens

Differential Revision: D12972361

fbshipit-source-id: a5dfef5e877e996adec2d4941417b4a2e727cfb7

* Turn off static linking for cxxreact:bridge

Summary: Remove `force_static=true` from cxxreact:bridge, add dependencies to targets that were pulling them in from a statically linked cxxreact:bridge.

Reviewed By: mhorowitz

Differential Revision: D12914861

fbshipit-source-id: ff335b70e80d014538a8d5dc8c0bb7b095e7940e

* Adds support for `publicPath` to enable serving assets from different locations. (#299)

Summary:
<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory. -->

**Summary**

<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->

This is an updated followup from https://github.com/facebook/metro/pull/280, which we would still need to address the following assumptions about `/assets/`:

https://github.com/facebook/metro/blob/e7deea19001d903a47868bb1fe6456bdc4b585e7/packages/metro/src/Server.js#L332

https://github.com/facebook/metro/blob/e7deea19001d903a47868bb1fe6456bdc4b585e7/packages/metro/src/Server.js#L379

https://github.com/facebook/metro/blob/e7deea19001d903a47868bb1fe6456bdc4b585e7/packages/metro/src/Server.js#L385

As pointed out by gdborton, there isn't currently a way to make this a configurable option. I am not certain how to find a proper workaround for `processRequest`.

We found a temporary solution to have our express app pick up serving the assets from a publicPath as a middleware. But the change in this PR is still necessary to get it working fully.

**Test plan**

<!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI. -->

- Will add tests once we figure out a comprehensive solution
Pull Request resolved: https://github.com/facebook/metro/pull/299

Reviewed By: rafeca

Differential Revision: D12939229

Pulled By: mjesun

fbshipit-source-id: 769c23468c5ac434f8319e5e7caaf46dd6453f2d

* Fix Shimmer in Fabric Android

Summary: ShimmeringView is called: RTShimmeringView Android and ShimmeringView in iOS. This diff adds a mapping into ComponentDescriptorRegistry to temporary enable ShimmeringView component until we can unify names in JS.

Reviewed By: sahrens

Differential Revision: D12991351

fbshipit-source-id: 48e08b8021116221ccfd5f2512c76f65145baa2a

* Use static constants instead of strings when referring to View Managers and Native Modules

Summary: Using strings to refer to Native Modules and View Managers in ReactPackages are prone to error. The compiler replaces the constants with the actual strings anyway, so using constants gives us  better type safety

Reviewed By: achen1

Differential Revision: D12843649

fbshipit-source-id: 7a7c6c854c8689193f40df92dc8426a3b37f82c8

* Fabric: Making EventEmitter::setEnabled additive

Summary: In the previous approach, when event emitter got disabled for split second, we could lose the EventTarget because JS GC can collect it before we re-enable this. Now we "over-enable" this first, and "under-disable" later.

Reviewed By: mdvacca

Differential Revision: D12990112

fbshipit-source-id: 4e3c0c0e05f03509ec72ca570f59ce16597353f0

* Add copyright header into ContextUtils class

Summary: Trivial diff to include copyright header into ContextUtils class

Reviewed By: achen1

Differential Revision: D13001556

fbshipit-source-id: 439f25647a094485381637ea2b59f62962b9c1ac

* Add another guard to lazilyLoadView

Summary:
it's possible that moduleForName won't return anything, so we should return.

Created from Diffusion's 'Open in Editor' feature.

Reviewed By: spredolac

Differential Revision: D12963342

fbshipit-source-id: c059595a68bfcaa38221e05fb62d70cc29887ca7

* iOS: ignore double registration of lazy modules with chrome attached

Summary: Depending on when Chrome debugger is attached, modules may get double registered. Simply ignore it for this case. The redbox was not a fatal error, which can be dismissed.

Reviewed By: shergin

Differential Revision: D12996107

fbshipit-source-id: 292f63102337077848842ca46b3daed08b1cae12

* Fix ReactInstanceManager deadlock

Summary:
D12829677 introduced a deadlock where onHostResume holds the lock on `moveToResumedLifecycleState()` then waits for the `mReactContext` lock, but at the same time setupReactContext holds the `mReactContext` lock and waits for `moveToResumedLifecycleState()` https://our.intern.facebook.com/intern/everpaste/?handle=GAgXFgLQH1ZlQikBAMQzo2LZ6h9TbiAxAAAz. The purpose of the previous diff was to make sure that detachRootoView and
setupReactContext did not interfere with each other, and implemented that by blocking on mReactContext. Since this overloads the usage of mReactContext, let's use a different lock `mAttachedRootViews` to implement this behavior instead

Reviewed By: mdvacca

Differential Revision: D12989555

fbshipit-source-id: c12e5fd9c5fa4c2037167e9400dc0c1578e38959

* Use nativeQPLTimestamp for InitializeCore marker point

Summary: It seems like `nativePerformanceNow` might not be getting installed in time to be used by InitializeCore on Android. Using PerformanceLogger.currentTimestamp instead, which uses nativeQPLTimestamp (which is what we should be using anyway)

Reviewed By: alexeylang

Differential Revision: D12875187

fbshipit-source-id: 6eda5d2ed7948ba48c63f76b40b2014511c32494

* Add a marker to indicate when JS thread priority is lowered

Summary:
When RN starts up, it lowers the default priority of the JS thread. This diff sets a point to see when the JS thread priority is lowered.

In subsequent diffs, we will be able to use this marker to play around with bumping the priority of the JS thread till TTI is done.

Reviewed By: alexeylang

Differential Revision: D8965457

fbshipit-source-id: 87cb1e3d3b370af183f388c411fd9a87a6cba250

* Fix ReactRootView attachRootView race condition

Summary:
Yet another issue with mAttachedRootViews. Every time at…
thymikee added a commit to thymikee/metro that referenced this pull request Mar 3, 2019
…ation

* upstream/master: (42 commits)
  Bump metro@0.49.1
  Fix entryFile always is assumed to end with `.js` extension (facebook#310)
  Adds support for `publicPath` to enable serving assets from different locations. (facebook#299)
  Make dynamic import interoperable for CJS and ESM
  Add custom serializer (facebook#309)
  React sync for revisions 4773fdf...3ff2c7c
  metro-buck: disable inline IDs in dev mode
  Simplify helper function
  Rewrite traverseDependency-integration-tests to make them module resolution unit tests
  RN: Revert React 16.6 Sync
  React sync for revisions 4773fdf...bf9fadf
  Bump react-deep-force-update
  Use getFileIterator() from jest-haste-map
  Deploy Flow v0.85 to xplat/js
  metro-buck: add explicit import() prefetch feature
  jest: remove jasmine usages
  jest: upgrade to 24.0.0-alpha.4
  Fix source map loading in the remote debugger
  Fix metro visualizer transformation
  Update babel to version 7
  ...
t-nanava pushed a commit to microsoft/react-native-macos that referenced this pull request Jun 17, 2019
… locations. (#299)

Summary:
<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory. -->

**Summary**

<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->

This is an updated followup from facebook/metro#280, which we would still need to address the following assumptions about `/assets/`:

https://github.com/facebook/metro/blob/e7deea19001d903a47868bb1fe6456bdc4b585e7/packages/metro/src/Server.js#L332

https://github.com/facebook/metro/blob/e7deea19001d903a47868bb1fe6456bdc4b585e7/packages/metro/src/Server.js#L379

https://github.com/facebook/metro/blob/e7deea19001d903a47868bb1fe6456bdc4b585e7/packages/metro/src/Server.js#L385

As pointed out by gdborton, there isn't currently a way to make this a configurable option. I am not certain how to find a proper workaround for `processRequest`.

We found a temporary solution to have our express app pick up serving the assets from a publicPath as a middleware. But the change in this PR is still necessary to get it working fully.

**Test plan**

<!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI. -->

- Will add tests once we figure out a comprehensive solution
Pull Request resolved: facebook/metro#299

Reviewed By: rafeca

Differential Revision: D12939229

Pulled By: mjesun

fbshipit-source-id: 769c23468c5ac434f8319e5e7caaf46dd6453f2d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants