Граф коммитов

15140 Коммитов

Автор SHA1 Сообщение Дата
Spencer Ahrens 7b5277bb75 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
2018-11-05 15:43:55 -08:00
Spencer Ahrens aab01608ba 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
2018-11-05 15:43:55 -08:00
nd-02110114 636e146c4a 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
2018-11-05 15:29:17 -08:00
flowkraD f9050e0908 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
2018-11-05 15:05:25 -08:00
soyanakagawa cc90c20bf6 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
2018-11-05 14:58:48 -08:00
Thomas BARRAS 6476151717 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
2018-11-05 14:49:57 -08:00
ifsnow 0d4f627f42 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
2018-11-05 14:22:38 -08:00
Tnarita0000 f8040ed16f 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
2018-11-05 14:02:02 -08:00
Victor Calvello ffd7195543 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
2018-11-05 13:57:47 -08:00
Thomas BARRAS 84c5416617 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
2018-11-05 13:54:41 -08:00
nd-02110114 0ea95e70a3 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
2018-11-05 11:25:14 -08:00
nd-02110114 147c38a7f2 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
2018-11-05 11:05:36 -08:00
Chad Austin 79712c35cb 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
2018-11-05 10:57:02 -08:00
Albert Sun 3a98318c91 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
2018-11-05 05:40:35 -08:00
Eric Samelson 54f7eb3424 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: 1a6666a116/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
2018-11-05 05:40:35 -08:00
nd-02110114 9d132339f7 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
2018-11-05 00:41:21 -08:00
nd-02110114 6f781d9c25 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
2018-11-05 00:37:26 -08:00
nd-02110114 0beb1cc55d 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
2018-11-05 00:34:04 -08:00
nd-02110114 fbc5a4f5e6 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
2018-11-04 23:05:54 -08:00
nd-02110114 3c0211b61a 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
2018-11-04 23:01:02 -08:00
Ignacio Olaciregui 7b10a028ca 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
2018-11-04 21:11:58 -08:00
Ryan Turner ce18036c35 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
2018-11-04 11:29:52 -08:00
mottox2 b01bf06dba 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
2018-11-04 11:03:09 -08:00
ggtmtmgg 368518eff1 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
2018-11-04 10:59:41 -08:00
yushimatenjin 3f069f3334 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
2018-11-04 10:55:37 -08:00
watanabeyu e835c6dc50 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
2018-11-04 10:52:09 -08:00
Ignacio Olaciregui 6ebee18d13 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
2018-11-04 10:41:46 -08:00
empyrical 01b7c48852 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
2018-11-04 01:56:39 -07:00
Tim Yung 6448f4e2f1 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
2018-11-04 01:08:40 -07:00
Tnarita0000 cf70870caa 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
2018-11-03 23:02:20 -07:00
Thomas BARRAS 499c195eba 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
2018-11-03 22:14:51 -07:00
MateusAndrade cc13a7367b 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
2018-11-03 18:44:53 -07:00
Ignacio Olaciregui b03b9d53af 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
2018-11-03 18:41:24 -07:00
wd39 a09aca5bb0 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
2018-11-03 18:37:25 -07:00
Tim Yung 4d16a0e84e RN: Copyright Header for `ReactInstanceManagerTest.java`
Summary: Missing when D12829677 landed.

Reviewed By: mdvacca

Differential Revision: D12903182

fbshipit-source-id: 1c142acb2a098b1118170f2f8ed8cf719fc14f90
2018-11-03 14:15:55 -07:00
David Vacca 83c7303a19 Trivial cleanup in ReactRootView
Summary: Trivial clanup of imports in ReactRootView

Reviewed By: fkgozali

Differential Revision: D12899430

fbshipit-source-id: 83bb052bbeee9e02e91157305420a2dd799e60e2
2018-11-03 01:14:07 -07:00
David Vacca 38e01a20c3 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
2018-11-03 01:14:07 -07:00
Tim Yung 8b275a8b8d React sync for revisions 4773fdf...bf9fadf
Summary:
@public
This sync includes the following changes:
- **[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...bf9fadf

Reviewed By: arcanis

Differential Revision: D12850275

fbshipit-source-id: b6d5c61a044c970c04c2ff3370fa77222afd1eb1
2018-11-02 18:35:04 -07:00
Peter Argany 1c3191992a Added locking around RN bridge cxx module registry to avoid crash
Summary:
D12904277 was my sad, optimistic attempt to fix this crash.

As @[100006577537606:Slobodan] mentioned on T35879909, the real issue is that moduleRegistry is being created (using _moduleDataByID dict) concurrently while we try to append to this dict.

I added locks around these usage of _moduleDataByID.

Reviewed By: fkgozali

Differential Revision: D12911108

fbshipit-source-id: 2435b7a477c27585898f351c4a0d4c1bd4056756
2018-11-02 18:18:50 -07:00
Spencer Ahrens 2486d12b81 lint autofixes
Summary: `find js/react-native-github | xargs arc lint -a`

Reviewed By: yungsters

Differential Revision: D12902940

fbshipit-source-id: fd1158f7a0ec322cf89bc4f727943bff4600b399
2018-11-02 12:44:59 -07:00
Spencer Ahrens 10d41d4225 more lint auto fixing
Summary: ran `find js/react-native-github/ReactCommon | xargs arc lint -a`

Reviewed By: fkgozali

Differential Revision: D12902865

fbshipit-source-id: 9c68c0f7e28893e76df966ad4110299e89895454
2018-11-02 12:44:59 -07:00
Thomas BARRAS 81e5d64bfe Remove createReactClass from ProgressBarAndroidExample (#21874)
Summary:
Related to #21581

This PR was already opened here https://github.com/facebook/react-native/pull/21600 but seems to be inactive.

Remove createReactClass from ProgressBarAndroidExample.

- `yarn run flow` && `yarn run flow-check-android` succeed.
- RNTester app ProgressBarAndroidExample on Android.

[GENERAL] [ENHANCEMENT] [ProgressBarAndroidExample.android.js] - rm createReactClass
Pull Request resolved: https://github.com/facebook/react-native/pull/21874

Reviewed By: TheSavior

Differential Revision: D12827689

Pulled By: RSNara

fbshipit-source-id: 46c70ea67dddf5d928fe936a28ef4a0a929d127f
2018-11-02 12:14:29 -07:00
Peter Argany 6770b53f8d Added lock around RN module initialization to fix crash
Summary:
T35879909 is a UBN caused by a race condition in RN initialization. I haven't been able to repro, but the crash logs point to a bad memory access in this method. Another thread must be deallocating something concurrently.

This is a quick fix to patch into v197.

Reviewed By: fkgozali

Differential Revision: D12904277

fbshipit-source-id: 5740183f9a7c8f2c45ca627662891cb0c1048764
2018-11-02 11:29:18 -07:00
empyrical 28de61e9f0 CheckBox: Convert NativeMethodsMixin to forwardedRef, convert to class (#21585)
Summary:
This PR converts the use of `NativeMethodsMixin` in `CheckBox.android.js`, and converts it to an ES6-style class.
Pull Request resolved: https://github.com/facebook/react-native/pull/21585

Reviewed By: TheSavior

Differential Revision: D12827768

Pulled By: RSNara

fbshipit-source-id: c113c221335e61e015a20bbb6bcff5f9837f9022
2018-11-02 10:32:01 -07:00
Thomas BARRAS 14e1628ba8 Remove createReactClass from SwipeableRow (#21876)
Summary:
Related to #21581

Remove createReactClass from SwipeableRow.

- All flow tests succeed.
-RNTester > SwipeableFlatList, scroll, swipe left, swipe right
-RNTester > SwipeableListView, scroll, swipe left, swipe right

[GENERAL] [ENHANCEMENT] [SwipeableRow.js] - rm createReactClass
Pull Request resolved: https://github.com/facebook/react-native/pull/21876

Reviewed By: TheSavior

Differential Revision: D12828034

Pulled By: RSNara

fbshipit-source-id: df02ed14e72bf6b0ad3cff33076a6f40870266a8
2018-11-02 07:27:46 -07:00
Sam Goldman adc8a33fcf Deploy Flow v0.85 to xplat/js
Reviewed By: fishythefish

Differential Revision: D12898653

fbshipit-source-id: 2ed11ce569600fe4c12528939a350dd827c9a29a
2018-11-02 00:28:28 -07:00
Kevin Gozali 04ea9762e2 iOS: register lazy nativemodules on startup when Chrome is attached
Summary:
@public
This allows apps to specify custom lazy modules that they need to load during chrome debugging. This is because lazy modules won't be available on start up, hence these modules will be missing in JS land, causing problems.

Reviewed By: shergin

Differential Revision: D12899408

fbshipit-source-id: dca313648e994b22e3ee5afec856ef76470065f9
2018-11-02 00:16:16 -07:00
Kevin Gozali 5431607c6d iOS: supress yellow box about missing export for native modules
Summary: Simply changing RCTLogWarn() to RCTLogInfo(), since some modules can be loaded without explicit export (experimental).

Reviewed By: mdvacca

Differential Revision: D12899442

fbshipit-source-id: 524d345265eda4a601101d878d51c244a8441fb5
2018-11-01 23:12:03 -07:00
Radovan Šmitala 7f79254cfe Remove AndroidManifest.xml from UIManager (#22044)
Summary:
AndroidManifest.xml file in UIManager only defines minimum SDK version for whole namespace "com.facebook". But it is always redefined by build.gradle file because Gradle file has precedence.

https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle#L273

Anyway Gradle is prefered way to define it. So i think it should be removed if it is not used for another purpose.
Pull Request resolved: https://github.com/facebook/react-native/pull/22044

Differential Revision: D12898251

Pulled By: hramos

fbshipit-source-id: 087b5cc45495109b5626c9cb232d0546c53fb709
2018-11-01 20:11:09 -07:00
Fernando Ruiz efc9506a8e Modified declarations from vars to const (#22070)
Summary:
Replaces the keywords `var` with `const` in `Libraries/Lists/ListView/ListViewDataSource.js`
Pull Request resolved: https://github.com/facebook/react-native/pull/22070

Differential Revision: D12895068

Pulled By: TheSavior

fbshipit-source-id: f191158396a0f03bb78942a57b08ec96348a9b32
2018-11-01 17:13:17 -07:00