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

4698 Коммитов

Автор SHA1 Сообщение Дата
Valentin Shergin d6236796b2 `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
2018-11-08 22:22:46 -08:00
Eli White f386f831d2 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
2018-11-08 17:59:10 -08:00
Tim Yung 0cb59b5c23 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
2018-11-07 19:36:04 -08:00
Eli White e6a8dca6f7 TextInput add back propTypes
Reviewed By: yungsters

Differential Revision: D12969854

fbshipit-source-id: c2fe2c46e538f8b5e3ea46257aef70d00bf14364
2018-11-07 18:44:40 -08:00
Eli White 7e818aed9a Fixing TextInput related jest tests
Reviewed By: yungsters

Differential Revision: D10519823

fbshipit-source-id: 02368b670953a0275fa6495b0c73ef84403598cb
2018-11-07 18:44:40 -08:00
Eli White ad7d8f89ef 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
2018-11-07 18:44:40 -08:00
empyrical 70e9e2665b 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
2018-11-07 18:44:40 -08:00
Nurzhan Bakibayev bccc4548e4 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
2018-11-07 11:21:55 -08:00
Ignacio Olaciregui 41eb2da33b 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
2018-11-06 14:32:43 -08:00
Thomas BARRAS 69213eea95 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
2018-11-06 14:07:05 -08:00
Thomas BARRAS c03fc4087f 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
2018-11-06 13:55:03 -08:00
Naman Goel 7dd2b0b5ea Types for BackHandler
Summary: Improve types for BackHandler

Reviewed By: benjaffe

Differential Revision: D9838175

fbshipit-source-id: 839a5a695b468974aadb7bc0da1a23ef844fdd7f
2018-11-06 12:37:31 -08:00
nabettu 0a39cda39a 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
2018-11-05 16:15:54 -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
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
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 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
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 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
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
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
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
Naman Goel 17fd1bceb5 Improved Types
Summary: Improves the types for Easing and bezier to make them script.

Differential Revision: D10346234

fbshipit-source-id: e941110c62f7dcd17b0d022497cf29e0935db5a3
2018-11-01 16:22:31 -07:00
Ignacio Olaciregui ae8ec39397 Fix linting issues (#22062)
Summary:
Fixes lots of ESLint warnings. Many of them where in PR #20877 by janicduplessis which requested to split the linting fixes from configuration and package changes.

I solved only the issues that I was most certain about but I would love to get hands on all of them with a little bit of input.
Pull Request resolved: https://github.com/facebook/react-native/pull/22062

Differential Revision: D12889447

Pulled By: TheSavior

fbshipit-source-id: 35f7a08104a5b859c860afdde4af2b32c0685c50
2018-11-01 14:29:16 -07:00
Evan Worley 136dfc8312 Flow strictifying AdsManagerAudienceImages.js
Reviewed By: gkz

Differential Revision: D10414273

fbshipit-source-id: 24c7e8955d78aeede8b0644cc9934e0b7fb5aa27
2018-11-01 09:52:41 -07:00
Adam Comella 798517a267 Fix relayout of inline views (#21968)
Summary:
If a view inside of an inline view became dirty (e.g. its top/left prop changed), its position would not update on screen. This is because Yoga didn't know the view needed to be relaid out because Yoga's dirty signal didn't propagate all the way up to the root.

The problem is that inline views don't have a parent in the Yoga tree causing Yoga's dirtiness signal propagation to get cut off early. The fix is, when an inline views gets dirty, mark the parent Text's Yoga node as dirty. This will cause Yoga's dirtiness signal to propagate all the way up to the root node.

Yoga has a hook to inform you when your node is marked as dirty: `YGNodeSetDirtiedFunc`. We leverage this to find out when an inline view's Yoga node gets dirtied.

React Native almost handled this case. Everything worked fine as long as the inline view was nested inside of a virtual text node like this:

```
<Text>
  <Text>
    <InlineView />
  </Text>
</Text>
```

However, the bug repros when the inline view is nested in a non-virtual text node:

```
<Text>
  <InlineView />
</Text>
```

The fix is to move the special dirtiness propagation logic from `RCTVirtualTextShadowView` to `RCTBaseTextShadowView`.

**Test Plan**

Created an inline view. Tested the following kinds of updates on the inline view's content:
  - Moved the content
  - Removed the content
  - Added the content

Tested this for an inline view that is directly inside of a text node as well as one that is nested under a virtual text node.

Here's the code I used for the inline view that moved its content after 2 seconds:

```
const RN = require('react-native');
const React = require('react');

export default class InlineView extends React.Component {
  constructor(props, context) {
    super(props, context);
    this.state = { posBottom: false };
  }

  componentDidMount() {
    super.componentDidMount && super.componentDidMount();
    setTimeout(() => { this.setState({ posBottom: true }); }, 2000);
  }

  render() {
    const pos = this.state.posBottom ? 25 : 0;
    const color = this.state.posBottom ? 'pink' : 'green';
    return (
      <RN.View style={{ width: 50, height: 50, backgroundColor: 'steelblue'}}>
        <RN.View style={{ width: 25, height: 25, top: pos, left: pos, backgroundColor: color }} />
      </RN.View>
    );
  }
}
```

**Release Notes**

[IOS] [BUGFIX] [Text] - Fix case where content of inline views didn't get relaid out

Adam Comella
Microsoft Corp.
Pull Request resolved: https://github.com/facebook/react-native/pull/21968

Differential Revision: D12873795

Pulled By: shergin

fbshipit-source-id: bbc9f5d3ef25063b0015cec8c4aaf2e41ecd60a8
2018-10-31 16:13:01 -07:00
Tim Yung a689711f68 RN: Missing Copyright Headers
Summary: Adds copyright headers to all files that are missing them.

Reviewed By: hramos

Differential Revision: D12837494

fbshipit-source-id: 6330a18919676dec9ff2c03b7c9329ed9127d930
2018-10-31 01:37:26 -07:00
Wen-Chien Chen 5803772017 Wrap measureLayoutRelativeToContainingList in try-catch to mitigate crash
Summary: This function sometimes causes an "Unable to find node on an unmounted component" crash during pagination for reasons that still need to be investigated; in the meanwhile, wrap this in a try-catch block to mitigate the crash.

Reviewed By: sahrens

Differential Revision: D12829971

fbshipit-source-id: bc9fe5b9b8c03430ff890bfbb27c39aa270c9eb7
2018-10-30 17:05:00 -07:00
Juuso Heikkinen cdbf719307 Bump fbjs-scripts to ^1.0.0 (#21880)
Summary:
This PR bumps also fbjs-scripts to latest version. Benefit is smaller node_modules and less deps to download as newer version doesn't depend on babel6 anymore.
Pull Request resolved: https://github.com/facebook/react-native/pull/21880

Differential Revision: D12832002

Pulled By: hramos

fbshipit-source-id: fa801aeb70a2f22be6f9c05cd6d981d0af0a0da9
2018-10-30 13:36:59 -07:00
nd-02110114 a06c0da828 Remove var in Libraries/Component (#22020)
Summary:
I removed `var` in Libraries/Component.

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

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

Differential Revision: D12843058

Pulled By: TheSavior

fbshipit-source-id: 90723f3905191cbd29cb18474c700ac65f2503cd
2018-10-30 12:41:04 -07:00
Rajiv Shah 7a914fcef4 Fix View/Text displayName (#21950)
Summary:
Adds the displayName prop to `View` and `Text` components. Because these now use `React.forwardRef`, they were showing as `Component` instead of their actual names.

Thanks to ljharb for helping to pinpoint the source of the issue!

Fixes #21937
Pull Request resolved: https://github.com/facebook/react-native/pull/21950

Differential Revision: D12827060

Pulled By: TheSavior

fbshipit-source-id: d812cae14d53ad821ab5873e737db63ad1a989e3
2018-10-29 12:42:10 -07:00
Emily Janzer df2eaa9eb6 Modularize InitializeCore
Summary: Split up InitializeCore into a bunch of modules. The idea here is to make it easier for apps to just get the initialization logic they want and leave behind what they don't; for example, if you don't want the Map/Set polyfills, instead of requiring InitializeCore you can require the modules you want from it.

Reviewed By: yungsters

Differential Revision: D10842564

fbshipit-source-id: 3b12d54fddea8c4ee75886022338c214987a015c
2018-10-28 15:45:14 -07:00
Avik Chaudhuri 11552a7a7a @allow-large-files flow 0.84 xplat deploy
Reviewed By: samwgoldman

Differential Revision: D10851695

fbshipit-source-id: 951c628844bbbc7331d4e75f62485db88e5ba7c4
2018-10-25 18:16:30 -07:00
Emily Janzer 9687090b5b Add end point for initializecore
Summary: Instead of having a single point at the top of InitializeCore, let's just create a subspan for it. Initially I just wanted to use this point to track JS start time, but it'll be useful to see how long initializeCore takes, too.

Reviewed By: alexeylang

Differential Revision: D10521595

fbshipit-source-id: 3025c34ffab39b79efc966f0c0eb6f502c91c550
2018-10-25 16:15:19 -07:00
Eli White af4903ed73 Cleanup legacyImplementation code from FlatList
Summary:
This functionality was removed here: 636d01bbd0

This is just a step of cleanup

Reviewed By: yungsters

Differential Revision: D10515512

fbshipit-source-id: 6d24cc9c53c71924a82c67a4058585ee978de2d9
2018-10-24 14:22:54 -07:00
Matt Hargett 174644846d Add deprecation warnings for a few IOS components
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/21901

Differential Revision: D10502816

Pulled By: TheSavior

fbshipit-source-id: 1890aa35251cff0ac2c15760ecd5aabeb7652558
2018-10-22 23:17:13 -07:00
Ramanpreet Nara 614d773e51 Refactor
Summary: I did a bit more refactoring to NetworkOverlay.

Reviewed By: TheSavior

Differential Revision: D10476158

fbshipit-source-id: da26251f8dfd12dd592da3ae5367efa37ec07669
2018-10-22 17:11:50 -07:00
alanfoster efa6016c0d Convert network overlay to use flatlist
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/21837

Reviewed By: TheSavior

Differential Revision: D10449940

Pulled By: RSNara

fbshipit-source-id: 28dcd5906c64070ef50867425ae7517d391300e2
2018-10-22 17:11:50 -07:00
Emily Janzer a07de97754 Add point to InitializeCore
Summary: Adding perf marker point to the beginning of InitializeCore.

Reviewed By: TheSavior

Differential Revision: D10496350

fbshipit-source-id: 56c77414e0c31cf918377e95e3b0c236a5672e35
2018-10-22 16:13:25 -07:00
Eli White 0ceda1b0a5 Add back removal notice of BackAndroid
Summary:
This was deleted as part of 774cd73663

I forgot that we normally keep the getter at the bottom of the module with an invariant so that people get clearer messages when they upgrade.

Reviewed By: yungsters

Differential Revision: D10475667

fbshipit-source-id: fcc527cd8117a506096a910a602272e092b8672d
2018-10-22 11:46:03 -07:00
nd-02110114 2014ce49ed remove createReactClass from ProgressViewIOS.ios.js (#21887)
Summary:
Related to #21581 .
Removed createReactClass from the Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js

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

Differential Revision: D10491704

Pulled By: RSNara

fbshipit-source-id: a38f87b9c151aaac8885edd22ce852ee2f2cf746
2018-10-22 10:34:35 -07:00
Rafael Oleza 2a7e02edf6 Fix polyfilling of regeneratorRuntime to avoid setting it to undefined in some situations
Summary:
This diff fixes an issue that caused the problem with `regeneratorRuntime` last Friday (more info: https://fb.facebook.com/groups/frontendsupport/permalink/2427883350560427/).

The root issue is that both `InitializeCore` and `FBInitializeCore` are included in the same bundle, this fix just prevents the bundle from being invalid once this happens..

*copied from: https://our.intern.facebook.com/intern/diff/D10444264/?transaction_id=595485237532887*

The way that `regeneratorRuntime` is polyfilled is not correct:

```
polyfillGlobal('regeneratorRuntime', () => {
  // The require just sets up the global, so make sure when we first
  // invoke it the global does not exist
  delete global.regeneratorRuntime;
  require('regenerator-runtime/runtime');
  return global.regeneratorRuntime;
});
```

Since a `require`d module is only evaluated once (no matter how many times it's required), defining (and calling) a getter for `global.regeneratorRuntime` twice will end up storing `undefined` to `global.regeneratorRuntime`.

There were no issues before this diff because the ordering of requires made things work by coincidence, e.g the following code will work:

```
// Set up regenerator for the first time
polyfillGlobal('regeneratorRuntime', () => {
  delete global.regeneratorRuntime;
  require('regenerator-runtime/runtime');
  return global.regeneratorRuntime;
});

// Set up regenerator for the second time. This will just override the previous getter (which has not even got executed so
// the `regenerator-runtime/runtime` module has not been evaluated yet.
polyfillGlobal('regeneratorRuntime', () => {
  // The require just sets up the global, so make sure when we first
  // invoke it the global does not exist
  delete global.regeneratorRuntime;
  require('regenerator-runtime/runtime');
  return global.regeneratorRuntime;
});

// Now access regenerator
global.regeneratorRuntime;
```

But the following code won't work:

```
// Set up regenerator for the first time
polyfillGlobal('regeneratorRuntime', () => {
  delete global.regeneratorRuntime;
  require('regenerator-runtime/runtime');
  return global.regeneratorRuntime;
});

// Access regenerator. This will cause the previous getter to be called, and the `regenerator-runtime/runtime` module will get evaluated.
// Here, `global.regeneratorRuntime` will have a correct value.
global.regeneratorRuntime;

// Set up regenerator for the second time. This will define a new getter for `global.regeneratorRuntime`, which will delete `delete global.regeneratorRuntime`
// and return undefined (note that `require('regenerator-runtime/runtime');` is a noop since the module has been already evaluated).
polyfillGlobal('regeneratorRuntime', () => {
  // The require just sets up the global, so make sure when we first
  // invoke it the global does not exist
  delete global.regeneratorRuntime;
  require('regenerator-runtime/runtime');
  return global.regeneratorRuntime;
});
```

Reviewed By: fromcelticpark

Differential Revision: D10483975

fbshipit-source-id: 5b3ef6e11c4fc4f79e3857c1ade9e7bc2beb6a39
2018-10-22 07:29:05 -07:00
Tim Yung b51a1d5791 RN: Export ImageLoadEvent Type
Summary: Exports the `ImageLoadEvent` type so that components passing through the `onLoad` callback can be properly typed.

Reviewed By: TheSavior

Differential Revision: D10481050

fbshipit-source-id: f0a48163c6221087b0f9869c033c653316471af9
2018-10-21 00:43:53 -07:00
Ryan Dy 774cd73663 Remove BackAndroid, which has had a deprecation warning (#21866)
Summary:
Remove BackAndroid, which has had a deprecation warning and only forwarded to BackHandler since March 2018.

Test Plan
---------
React-native init bundle and RNTester bundle works.

Release Notes:
--------------
[ ANDROID  ] [ BREAKING ] [ BackAndroid ] - Deprecate BackAndroid since BackHandler should be used in its place.
Pull Request resolved: https://github.com/facebook/react-native/pull/21866

Differential Revision: D10472419

Pulled By: TheSavior

fbshipit-source-id: 3d76e1ce4c74bb783fee7fd8232bb366f2e7ea12
2018-10-19 16:02:48 -07:00
Héctor Ramos 47fb387455 Update copyright headers
Summary: Use MIT License copyright headers in JSI source code.

Reviewed By: axe-fb

Differential Revision: D10454031

fbshipit-source-id: d584073bb885fb7d977df1a45a6666ef6f52dcd6
2018-10-19 11:08:57 -07:00
Emily Janzer c95071e7d2 Remove explicit requires of Map and Set
Summary: Removing explicit requires of Map and Set (since those are polyfilled), and fixing resulting flow errors.

Reviewed By: yungsters

Differential Revision: D10350673

fbshipit-source-id: 2fefe8ed1ae1f2cc9e5b7923ad630e73eda9e856
2018-10-19 10:57:24 -07:00
Eli White 99471f87b9 Add deprecation notice to SwipeableListView
Summary: ListView is deprecated and SwipeableListView uses ListView. Thus, it is deprecated as well.

Reviewed By: RSNara

Differential Revision: D10437408

fbshipit-source-id: a08391d5b099e74b6ec179cd940ac404b2e702f4
2018-10-18 15:38:39 -07:00
Ramanpreet Nara 4d917c8207 Additional Flow changes to files that use this component
Summary:
This diff includes:
1. Touchups to the `CameraRollView` typings.
2. Typings for `CameraRollViewExmaple`.
3. Flow fixes for internal callsites.

Reviewed By: yungsters

Differential Revision: D10362686

fbshipit-source-id: 48bf3fba0566e9c5c062aee3342d669f6c143d9f
2018-10-18 12:28:28 -07:00
Ramanpreet Nara 8465094523 Remove createReactClass from CameraRollView
Summary:
Related to #21581

Remove createReactClass from CameraRollView.

Reviewed By: TheSavior

Differential Revision: D10351036

fbshipit-source-id: 394545ac143917e3b483dfc6186e5f45732c602a
2018-10-18 12:28:28 -07:00
Mehdi Mulani 67afaefa78 Remove previously scheduled NetInfo callbacks if they haven't fired
Summary:
@public
If you call NetInfo.getCurrentConnectivity multiple times in succession, we'll create a bunch of callbacks but lose them in the ether.
With this fix, we'll unschedule them before creating a new one, which should resolve some crashes we're seeing.

Reviewed By: PeteTheHeat

Differential Revision: D10409486

fbshipit-source-id: 6065b09fa626f7f06aed9bf0e278c0a6a6169f58
2018-10-18 12:15:44 -07:00
Marc Horowitz 3341adac40 Ensure HelloWorld xcodeproj template works
Summary: The only thing extra that we need to do is to include `JavaScriptCore.framework` inside the HelloWorld.xcodeproj file.

Reviewed By: hramos

Differential Revision: D9893035

fbshipit-source-id: 2a29d1fd645eafa2e09109ad14d09f812dfa2601
2018-10-18 01:06:25 -07:00
Eli White c95fdb0505 Don't use local alias in react-native-implementation
Summary: Nuclide's export detection for modules doesn't resolve local aliases. Lets just export the object directly.

Reviewed By: mostafaeweda

Differential Revision: D10443054

fbshipit-source-id: 880aa1eadff554903eb765d7104ecf3c3b72cbce
2018-10-17 22:24:34 -07:00
empyrical d6c8f189e7 Introduce 'setAndForwardRef' helper function (#21823)
Summary:
This PR introduces a new helper function called `setAndForwardRef`. It is intended to help with moving components that depend on `NativeMethodsMixin` off of `createReactClass`.

It allows for classes that depend on having a ref to a native component to be able to also forward the native component ref to user code.

Usage is like this:

```js
class MyView extends React.Component {
  _nativeRef = null;
  _setNativeRef = setAndForwardRef({
    getForwardedRef: () => this.props.forwardedRef,
    setLocalRef: ref => {
      this._nativeRef = ref;
    },
  });
  render() {
    return <View ref={this._setNativeRef} />;
  }
}
const MyViewWithRef = React.forwardRef((props, ref) => (
  <MyView {...props} forwardedRef={ref} />
));
module.exports = MyViewWithRef;
```
Pull Request resolved: https://github.com/facebook/react-native/pull/21823

Differential Revision: D10436673

Pulled By: TheSavior

fbshipit-source-id: 32e167bb3ea3234f08d5715168b0e61e4e035a7c
2018-10-17 22:00:21 -07:00
Emily Janzer 36507e4a3c Fix issue when inserting text at 0 when maxLength is set
Summary:
1. The user inserts a character ('0') at index 0. Because the range matches 0, 0, predictedText is set to that character that was inserted.
2. In textInputDidChange, it discovers a mismatch between the rendered text ('1234') and predicted text ('0')
3. This triggers textInputShouldChangeTextInRange to be called again with the 'new' text that it thinks was just added ('1234')
4. It goes to insert this text, but runs into the maxLength limit, so it gets truncated and then inserted.

(I'm not totally sure why only happens if maxLength is set - I need to look into that.)

One fix for this is to just get rid of the range check, but that'll regress #18374. I decided to just check and see if the rendered text is empty instead of checking the range where text could be inserted, since that seems like it should properly handle both cases.

Reviewed By: shergin

Differential Revision: D10392176

fbshipit-source-id: 84fb3b6cac9b0aa25b3c1a127d43f9cdc5a1c6a8
2018-10-16 19:44:28 -07:00
Thomas BARRAS 70b5eb3aa2 ListView requestAnimationFrame leak (#21802)
Summary:
Related to https://github.com/facebook/react-native/pull/21488
Disclaimer: I made this PR.

I think there's some requestAnimationFrame events that are not cleared on unmount because of bad use of `splice` method.

- All flow tests succeed.
- RNTester: iOS (this change should only affect iOS because calculateChildFrames is iOS only)
Show perf monitor, show ListView* screen, start scrolling. UI frame Rate is used at the beginning. When scrolling there is no drop in FPS rate.
- TODO: I'll write a load test for ListView

[GENERAL] [ENHANCEMENT] [ListView.js] - rm TimerMixin
Pull Request resolved: https://github.com/facebook/react-native/pull/21802

Differential Revision: D10391812

Pulled By: RSNara

fbshipit-source-id: 49f0b0a4641ec29bcb4cc04bd3bafb42b3842b69
2018-10-15 18:09:16 -07:00
Andy Huang 8a3a0ad2d0 Fix pull to refresh refresh component clipping on Android
Summary: Currently the pull to refresh icon on browse feed is super cut off on Android. Expose the progressViewOffset prop from FBPullToRefresh to support offsetting the PTR component to make the component more visible.

Reviewed By: yungsters

Differential Revision: D10274679

fbshipit-source-id: 1735c4d2d98523ccc3d1ec3733465028ae33df7b
2018-10-15 12:41:00 -07:00
Marshall Roch 7b150690b6 @allow-large-files [flow] update to v0.83
Reviewed By: fishythefish

Differential Revision: D10362346

fbshipit-source-id: 0f4cc9977cfaa947e3b23112dd1cf482642e2319
2018-10-13 01:32:48 -07:00
Tim Yung 8325e09e5c React sync for revisions d836010...4773fdf
Summary:
@public
This sync includes the following changes:
- **[4773fdf7c](https://github.com/facebook/react/commit/4773fdf7c)**: Deprecate findDOMNode in StrictMode (#13841) //<Sebastian Markbåge>//
- **[c9be16f5b](https://github.com/facebook/react/commit/c9be16f5b)**: [scheduler] Rename priority levels (#13842) //<Andrew Clark>//
- **[3b7ee2692](https://github.com/facebook/react/commit/3b7ee2692)**: Deprecate context object as a consumer and add a warning message (#13829) //<Dominic Gannaway>//
- **[8ca8a594e](https://github.com/facebook/react/commit/8ca8a594e)**: Error gracefully for unsupported SSR features (#13839) //<Dan Abramov>//
- **[4a635785f](https://github.com/facebook/react/commit/4a635785f)**: Fix User Timing oddities with Suspense, pure, and lazy (#13833) //<Dan Abramov>//
- **[a165cf747](https://github.com/facebook/react/commit/a165cf747)**: Renamed 4 Internal React Modules //<Nadia Osipova>//
- **[a68ca9a5b](https://github.com/facebook/react/commit/a68ca9a5b)**: React.pure automatically forwards ref (#13822) //<Sophie Alpert>//
- **[c73497c3c](https://github.com/facebook/react/commit/c73497c3c)**: Update bundle sizes for 16.6.0-alpha.8af6728 release //<Dan Abramov>//
- **[1a57dc668](https://github.com/facebook/react/commit/1a57dc668)**: Updating dependencies for react-noop-renderer //<Dan Abramov>//
- **[77f8dfd81](https://github.com/facebook/react/commit/77f8dfd81)**: Updating package versions for release 16.6.0-alpha.8af6728 //<Dan Abramov>//
- **[8af6728c6](https://github.com/facebook/react/commit/8af6728c6)**: Enable Suspense + rename Placeholder (#13799) //<Dan Abramov>//
- **[f47a958ea](https://github.com/facebook/react/commit/f47a958ea)**: Don’t add onclick listener to React root (#13778) //<Philipp>//
- **[b2cea9078](https://github.com/facebook/react/commit/b2cea9078)**: [scheduler] Eagerly schedule rAF at beginning of frame (#13785) //<Andrew Clark>//
- **[e2e7cb9f4](https://github.com/facebook/react/commit/e2e7cb9f4)**: [scheduler] add a test documenting current behavior (#13687) //<plievone>//

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

Reviewed By: acdlite

Differential Revision: D10350869

fbshipit-source-id: ea8ad4b5d914c870be1fc80aa1005b224d37f5e5
2018-10-12 17:44:56 -07:00
Ramanpreet Nara 62e0d508d6 Move createStrictShapeTypeChecker to deprecated
Summary:
Related to #21342

Move createStrictShapeTypeChecker to DeprecatedCreateStrictShapeTypeChecker.

Reviewed By: hramos

Differential Revision: D10341526

fbshipit-source-id: 30e7f22ae574af620ead9c1a0766f00611b282b6
2018-10-12 15:17:02 -07:00
empyrical 93e6ae1c0a ProgressViewIOS: Remove PropTypes and NativeMethodsMixin, convert to functional component (#21588)
Summary:
This PR converts `ProgressViewIOS` from a `createReactClass` component to a functional component, and removes the remaining proptypes. Its use of `NativeMethodsMixin` has been ported to a `forwardRef` to the native component.
Pull Request resolved: https://github.com/facebook/react-native/pull/21588

Reviewed By: hramos

Differential Revision: D10338888

Pulled By: RSNara

fbshipit-source-id: c49807e97a0e2cf774971d9aa5a8426f15a3e48d
2018-10-12 13:49:39 -07:00
Andrey Lunyov 7541655398 Do not use fbjs/emptyObject
Summary: Remove dependency on fbjs/emptyObject in React Native

Reviewed By: yungsters

Differential Revision: D10342631

fbshipit-source-id: 312bb545b66dd5b2132ca67bbaf91cc98a0c6c8a
2018-10-12 11:33:49 -07:00
Mehdi Mulani 4f757095a8 Avoid calling lazilyLoadView when running in the debugger
Summary:
@public
The Chrome debugger can't handle synchronous method calls, so we should avoid doing them.
Double wrapped the if with a DEV check so that it's removed when bundling in non-dev mode.

Reviewed By: fkgozali

Differential Revision: D10345056

fbshipit-source-id: 7a7a2c73f089693da5edafdf3ecf7a3e5d767e52
2018-10-12 09:03:28 -07:00
Albert Sun b4a532e1d1 Update comments to getViewManagerConfig() function name
Summary: This change updates the comments and warning to match the function name.

Reviewed By: achen1

Differential Revision: D10345724

fbshipit-source-id: 05b1c60703da97ed083d7de492559bafb46ad813
2018-10-11 14:01:48 -07:00
Eli White afa6d9ba7b Remove Subscribable.Mixin from React Native core
Summary: There are no longer any callsites to this in React Native so we can remove it from the repo!

Reviewed By: RSNara

Differential Revision: D10316313

fbshipit-source-id: bd63c823c56bb1914e4249d972e0ce503aa189f8
2018-10-10 17:33:14 -07:00
Radovan Šmitala 4b6f02ea75 Normalize scheme for URL on Android (#21561)
Summary:
Android requires lowercase for URL scheme. This commit d00bdb9bb8 fixed it but on React Native side.
Because it is Android specific, it should be fixed on Android side.

Android has method to normalize url scheme: https://developer.android.com/reference/android/net/Uri.html#normalizeScheme()
Pull Request resolved: https://github.com/facebook/react-native/pull/21561

Differential Revision: D10287868

Pulled By: hramos

fbshipit-source-id: f5e474164fdb2cfd49bd8ee51da17de3f1341a9c
2018-10-09 23:32:24 -07:00
nd-02110114 9965ea5a2e remove mixin on Libraries/Components/ScrollResponder.js (#21589)
Summary:
Related to #21485.
Removed Subscribable.Mixin from the Libraries/Components/ScrollResponder.js

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

[GENERAL] [ENHANCEMENT] [Libraries/Components/ScrollResponder.js] - remove Subscribable.Mixin dependency
Pull Request resolved: https://github.com/facebook/react-native/pull/21589

Differential Revision: D10275517

Pulled By: RSNara

fbshipit-source-id: 28af7f0944e978609a1b3be05b8a51557e67bc1b
2018-10-09 23:17:26 -07:00
Eli White 4a5221884f Remove MetroListView from SectionList
Reviewed By: yungsters

Differential Revision: D10251054

fbshipit-source-id: dc801817dfcf2722e4625178117006ab51e57255
2018-10-09 17:31:27 -07:00
Eli White 636d01bbd0 Remove legacyImplementation from FlatList and SectionList
Summary:
`legacyImplementation` has caused a warning in FlatList for a long time. FlatList supports the use cases of the legacy implementation and should be adopted.

We will be removing the deprecated MetroListView and ListView components to reduce bundle sizes and the complexity of the codebase.

Reviewed By: yungsters

Differential Revision: D10245824

fbshipit-source-id: 60ff0d54974649b57bac9f9f29b769f34ca2701c
2018-10-09 17:31:27 -07:00
Eli White e90f5fa263 Add Deprecation Warning to ListView
Summary: This component has long been deprecated in the docs. Adding a warning to the code.

Reviewed By: sahrens

Differential Revision: D10261155

fbshipit-source-id: 462ce30a97f35e52477cfc135fb50c976b56e9cb
2018-10-09 16:31:47 -07:00
Mehdi Mulani 751be26015 Allow UIManager to load native view managers lazily
Summary:
This adds a synchronous method that JS can call to load view managers.
Notably, we don't have an exact way to go from a JS name to the native view manager, so this naively adds 'Manager' to the end.

After lazily loading the view, it makes sure to cache all its values in native and JS, as further calls from JS will fail.

Reviewed By: PeteTheHeat

Differential Revision: D10204314

fbshipit-source-id: ebf42a85dcc467f3b4c5d6e18e49e04f9e8aa4f9
2018-10-09 14:16:20 -07:00
Julius Lundang bbb6a0754c � Improve Button component stylesheet; removed duplicate styles (#21535)
Summary:
Updated Button component inspiration. Refactored code takes advantage of Platform Specific Code, as we want to re-use as much code as possible.

1. Import Button component
2. Button should work the same

https://github.com/facebook/react-native/pull/19752

[GENERAL] [ENHANCEMENT] [Button] - Uses spread operator for platform specific code in creating styles
Pull Request resolved: https://github.com/facebook/react-native/pull/21535

Differential Revision: D10248048

Pulled By: TheSavior

fbshipit-source-id: 7260fa56f15b70b7c9499c8da418db7b2214b0dd
2018-10-08 23:35:23 -07:00
Richard Cann 31d6a69fc9 Removing TimerMixin on TextInput (#21522)
Summary:
Related to #21485.
Removed TimerMixin from Libraries/Components/TextInput/TextInput.js
Pull Request resolved: https://github.com/facebook/react-native/pull/21522

Differential Revision: D10229669

Pulled By: RSNara

fbshipit-source-id: 45de331203eddce06b8fb7ddf4080869c07b6c55
2018-10-08 11:01:59 -07:00
Guilherme Varandas de416e7d06 Removing TimerMixin on SwipeableRow (#21499)
Summary:
Related to #21485.
Removed TimerMixin from the SwipeableRow component since it is currently not used.
Added a test case for `SwipeableRow` animation in the `SwipeableListViewSimpleExample`, by adding the `bounceFirstRowOnMount` prop, to check for any runtime issues with the setTimeout method.

- [x] `npm run prettier`
- [x] `npm run flow-check-ios`
- [x] `npm run flow-check-android`
- [x] runtime tests using `SwipeableFlatListExample` on Android and iOS
- [x] runtime tests using `SwipeableListViewSimpleExample` on Android and iOS

**RNTester steps**

- [x] Run RNTester.
- [x] Navigate to `SwipeableFlatListExample` and check if the `_animateBounceBack` animation executes when the `shouldBounceOnMount` props is passed.
- [x] Swipe the row and check if the events ran correctly
- [x] Navigate to `SwipeableListViewSimpleExample` and check if the `_animateBounceBack` animation executes when the `shouldBounceOnMount` props is passed.
- [x] Swipe the row and check if the events ran correctly

[GENERAL] [ENHANCEMENT] [Libraries/Experimental/SwipeableRow/SwipeableRow.js] - remove TimerMixin dependency
[GENERAL] [ENHANCEMENT] [RNTester/js/SwipeableListViewSimpleExample.js] - Add bounceFirstRowOnMount to guarantee the SwipeableRow correct behavior.
Pull Request resolved: https://github.com/facebook/react-native/pull/21499

Reviewed By: TheSavior

Differential Revision: D10218361

Pulled By: RSNara

fbshipit-source-id: c8e6d5ced4c1237e48bb4c43592016684b2c6360
2018-10-08 10:31:35 -07:00
Emily Janzer d279b7c74d Add point at beginning of InitializeCore
Summary: Also add an optional timestamp param to PerformanceLogger.markPoint() so you can backdate a point

Reviewed By: alexeylang

Differential Revision: D10149337

fbshipit-source-id: 6cc5f95b34b3293589e7cb41b99cee17bf128163
2018-10-05 18:33:59 -07:00
Tim Yung 7142e9b1c5 React sync for revisions ade5e69...d836010
Summary:
This sync includes the following changes:
- **[d83601080](https://github.com/facebook/react/commit/d83601080)**: Wrap retrySuspendedRoot using SchedulerTracing (#13776) //<Sophie Alpert>//
- **[40a521aa7](https://github.com/facebook/react/commit/40a521aa7)**: Terminology: Functional -> Function Component (#13775) //<Dan Abramov>//
- **[605ab10a4](https://github.com/facebook/react/commit/605ab10a4)**: Add envify transform to scheduler package (#13766) //<Michael Ridgway>//
- **[acc7f404c](https://github.com/facebook/react/commit/acc7f404c)**: Restart from root if promise pings before end of render phase (#13774) //<Andrew Clark>//
- **[cbc224028](https://github.com/facebook/react/commit/cbc224028)**: fix - small misspelling (#13768) //<Spencer Davies>//
- **[4eabeef11](https://github.com/facebook/react/commit/4eabeef11)**: Rename ReactSuspenseWithTestRenderer-test -> ReactSuspense-test //<Andrew Clark>//
- **[95a3e1c2e](https://github.com/facebook/react/commit/95a3e1c2e)**: Rename ReactSuspense-test -> ReactSuspenseWithNoopRenderer-test //<Andrew Clark>//
- **[96bcae9d5](https://github.com/facebook/react/commit/96bcae9d5)**: Jest + test renderer helpers for concurrent mode (#13751) //<Andrew Clark>//
- **[5c783ee75](https://github.com/facebook/react/commit/5c783ee75)**: Remove unreachable code (#13762) //<Heaven>//
- **[36c5d69ca](https://github.com/facebook/react/commit/36c5d69ca)**: Always warn about legacy context within StrictMode tree (#13760) //<Brian Vaughn>//
- **[3e9a5de88](https://github.com/facebook/react/commit/3e9a5de88)**: UMD react-cache build (#13761) //<Maksim Markelov>//
- **[8315a30b9](https://github.com/facebook/react/commit/8315a30b9)**: --save is no longer needed (#13756) //<Joe Cortopassi>//
- **[ce96e2df4](https://github.com/facebook/react/commit/ce96e2df4)**: Rename simple-cache-provider to react-cache (#13755) //<Andrew Clark>//
- **[c5212646f](https://github.com/facebook/react/commit/c5212646f)**: Removed extra typeof checks for contextType.unstable_read (#13736) //<Brian Vaughn>//
- **[806eebdae](https://github.com/facebook/react/commit/806eebdae)**: Enable getDerivedStateFromError (#13746) //<Brian Vaughn>//
- **[a0733fe13](https://github.com/facebook/react/commit/a0733fe13)**: pure (#13748) //<Andrew Clark>//
- **[4d17c3f05](https://github.com/facebook/react/commit/4d17c3f05)**: [scheduler] Improve naive fallback version used in non-DOM environments //<Andrew Clark>//
- **[469005d87](https://github.com/facebook/react/commit/469005d87)**: Revise `AttributeType` React Native Flow Type (#13737) //<Timothy Yung>//
- **[0dc0ddc1e](https://github.com/facebook/react/commit/0dc0ddc1e)**: Rename AsyncMode -> ConcurrentMode (#13732) //<Dominic Gannaway>//
- **[7601c3765](https://github.com/facebook/react/commit/7601c3765)**: Ensure "addEventListener" exists on "window" for "scheduler" package (#13731) //<Dominic Gannaway>//
- **[d0c0ec98e](https://github.com/facebook/react/commit/d0c0ec98e)**: Added a PureComponent contextType test (#13729) //<Brian Vaughn>//
- **[4b68a6498](https://github.com/facebook/react/commit/4b68a6498)**: Support class component static contextType attribute (#13728) //<Brian Vaughn>//
- **[f305d2a48](https://github.com/facebook/react/commit/f305d2a48)**: [scheduler] Priority levels, continuations, and wrapped callbacks (#13720) //<Andrew Clark>//
- **[970a34bae](https://github.com/facebook/react/commit/970a34bae)**: Bump babel-eslint and remove flow supressions (#13727) //<Brian Ng>//
- **[13965b4d3](https://github.com/facebook/react/commit/13965b4d3)**: Interaction tracking ref-counting bug fixes (WIP) (#13590) //<Brian Vaughn>//
- **[17e703cb9](https://github.com/facebook/react/commit/17e703cb9)**: Restore global window.event after event dispatching (#13688) (#13697) //<Sergei Startsev>//
- **[a775a767a](https://github.com/facebook/react/commit/a775a767a)**: Remove redundant logic (#13502) //<Heaven>//
- **[e1a067dea](https://github.com/facebook/react/commit/e1a067dea)**: Fix circular dependency in TracingSubscriptions (#13689) //<Maksim Markelov>//
- **[518812eeb](https://github.com/facebook/react/commit/518812eeb)**: Clarify comment (#13684) //<Heaven>//
- **[eeb817785](https://github.com/facebook/react/commit/eeb817785)**: Remove some old files from stats //<Dan>//
- **[7ea3ca1d1](https://github.com/facebook/react/commit/7ea3ca1d1)**: Rename schedule to scheduler (#13683) //<Dan Abramov>//
- **[bec2ddaf1](https://github.com/facebook/react/commit/bec2ddaf1)**: Update bundle sizes for 16.5.2 release //<Brian Vaughn>//
- **[4269fafb0](https://github.com/facebook/react/commit/4269fafb0)**: Updating package versions for release 16.5.2 //<Brian Vaughn>//
- **[4380f9ba1](https://github.com/facebook/react/commit/4380f9ba1)**: Revert "Updating package versions for release 16.6.0-alpha.0" //<Brian Vaughn>//
- **[72fad84e7](https://github.com/facebook/react/commit/72fad84e7)**: Revert "Updating dependencies for react-noop-renderer" //<Brian Vaughn>//
- **[c3fad5acf](https://github.com/facebook/react/commit/c3fad5acf)**: Revert "Update bundle sizes for 16.6.0-alpha.0 release" //<Brian Vaughn>//
- **[dd9120561](https://github.com/facebook/react/commit/dd9120561)**: Kepp calling peformWork consistent (#13596) //<Heaven>//
- **[42d12317a](https://github.com/facebook/react/commit/42d12317a)**: Update bundle sizes for 16.6.0-alpha.0 release //<Brian Vaughn>//
- **[489614c4f](https://github.com/facebook/react/commit/489614c4f)**: Updating dependencies for react-noop-renderer //<Brian Vaughn>//
- **[351c9015c](https://github.com/facebook/react/commit/351c9015c)**: Updating package versions for release 16.6.0-alpha.0 //<Brian Vaughn>//
- **[a210b5b44](https://github.com/facebook/react/commit/a210b5b44)**: Revert "Do not bind topLevelType to dispatch" (#13674) //<Dan Abramov>//
- **[1d8a75fef](https://github.com/facebook/react/commit/1d8a75fef)**: remove flow typings from Schedule.js (#13662) //<Alexey Raspopov>//
- **[d92114b98](https://github.com/facebook/react/commit/d92114b98)**: Resubmit: Fix updateWrapper causing re-render textarea, even though their data (#13643) //<Nathan Hunzaker>//
- **[0c9c591bf](https://github.com/facebook/react/commit/0c9c591bf)**: Do not bind topLevelType to dispatch (#13618) //<Nathan Hunzaker>//
- **[9f819a5ea](https://github.com/facebook/react/commit/9f819a5ea)**: [schedule] Refactor Schedule, remove React-isms (#13582) //<Andrew Clark>//
- **[9c961c0a2](https://github.com/facebook/react/commit/9c961c0a2)**: Fix some iframe edge cases (#13650) //<Jérôme Steunou>//
- **[8bc0bcabe](https://github.com/facebook/react/commit/8bc0bcabe)**: Add UMD production+profiling entry points (#13642) //<Brian Vaughn>//
- **[b488a5d9c](https://github.com/facebook/react/commit/b488a5d9c)**: Fix test comment typo (#13568) //<Heaven>//
- **[4bcee5621](https://github.com/facebook/react/commit/4bcee5621)**: Rename "tracking" API to "tracing" (#13641) //<Brian Vaughn>//
- **[72217d081](https://github.com/facebook/react/commit/72217d081)**: Update bundle sizes for 16.5.1 release //<Dan Abramov>//
- **[8b93a60c5](https://github.com/facebook/react/commit/8b93a60c5)**: Updating package versions for release 16.5.1 //<Dan Abramov>//
- **[ecbf7af40](https://github.com/facebook/react/commit/ecbf7af40)**: Enhance dev warnings for forwardRef render function (#13627) (#13636) //<Andres Rojas>//
- **[228240085](https://github.com/facebook/react/commit/228240085)**: Delete TapEventPlugin (#13630) //<Dan Abramov>//
- **[a079011f9](https://github.com/facebook/react/commit/a079011f9)**: ð Stop syncing the value attribute on inputs (behind a feature flag) (#13526) //<Nathan Hunzaker>//
- **[a7bd7c3c0](https://github.com/facebook/react/commit/a7bd7c3c0)**: Allow reading default feature flags from bundle tests (#13629) //<Dan Abramov>//
- **[d3bbfe09c](https://github.com/facebook/react/commit/d3bbfe09c)**: Fix IE version in comment //<Dan Abramov>//
- **[1b2646a40](https://github.com/facebook/react/commit/1b2646a40)**: Fix warning without stack for ie9 (#13620) //<Aliaksandr Manzhula>//
- **[e49f3ca08](https://github.com/facebook/react/commit/e49f3ca08)**:  honor displayName set on ForwardRef if available (#13615) //<Evan Jacobs>//

Release Notes:
[GENERAL] [FEATURE] [React] - React sync for revisions ade5e69...d836010

Reviewed By: bvaughn

Differential Revision: D10118547

fbshipit-source-id: ecde7ada80331abdc8bd7d279e0f3dbe9acde071
2018-10-05 18:19:54 -07:00
Dani 9282c9de39 Remove TimerMixin from TouchableOpacity (#21520)
Summary:
Related to #21485
This PR removes TimerMixin from TouchableOpacity
Pull Request resolved: https://github.com/facebook/react-native/pull/21520

Differential Revision: D10223753

Pulled By: RSNara

fbshipit-source-id: fc02077de7e73ee968b7944c0178892825099063
2018-10-05 17:25:40 -07:00
Eli White 5bfa39ece0 Skip flaky Animated test
Summary:
This test is disabled internally and flaky in open source causing CI to fail. Skipping it for now.

Related to: https://github.com/facebook/react-native/issues/21517

Reviewed By: RSNara

Differential Revision: D10223498

fbshipit-source-id: 37a3798c0abb7de829bc5b59e02f23d8943da882
2018-10-05 15:03:15 -07:00
Thomas Carlson 6c20017152 Remove TimerMixin from TouchableWithoutFeedback (#21493)
Summary:
Related to #21485.
Removed `TimerMixin` from the `TouchableWithoutFeedback` component since it is currently not used.
Added tests cases for `TouchableWithoutFeedback` to check for any runtime issues.
Pull Request resolved: https://github.com/facebook/react-native/pull/21493

Differential Revision: D10219098

Pulled By: RSNara

fbshipit-source-id: d9517b2bd5b72b0450fa864f3556673ae3181552
2018-10-05 13:34:12 -07:00
Thomas BARRAS 8ceb1586ee Remove TimerMixin from ListView (#21488)
Summary:
Related to #21485

- Remove TimerMixin from ListView

- All flow tests succeed.
- RNTester: <ListView> iOS (this change should only affect iOS because calculateChildFrames is iOS only)
Show perf monitor, show ListView* screen, start scrolling. UI frame Rate is used at the beginning. When scrolling there is no drop in FPS rate.

TODO: I think a load test would be more relevant:
- Update props multiple times and scroll

[GENERAL] [ENHANCEMENT] [ListView.js] - rm TimerMixin
Pull Request resolved: https://github.com/facebook/react-native/pull/21488

Differential Revision: D10219088

Pulled By: RSNara

fbshipit-source-id: 946e4fc1319324c5bf4947a2060b18bebb6fc493
2018-10-05 12:20:24 -07:00
Eli White 3aa8f09b44 Deprecate legacyImplementation
Summary: The legacy implementation doesn't provide additional functionality and has a negative impact on performance and user experience. The legacyImplementation prop is deprecated and will be removed in a future release.

Reviewed By: yungsters

Differential Revision: D10212762

fbshipit-source-id: 9b3416434ba392827b538c984c7ab4bcbe156e60
2018-10-05 10:23:21 -07:00
danibonilha 0de99bc8f5 Split ViewAccessibility into DeprecatedViewAccessibility and rename r… (#21422)
Summary:
This PR splits and renames all references of ViewAccessibility to DeprecatedViewAccessibility
Related to #21342
Pull Request resolved: https://github.com/facebook/react-native/pull/21422

Reviewed By: yungsters

Differential Revision: D10132659

Pulled By: RSNara

fbshipit-source-id: 68c371230c69ed37c3e44bf8a36043adb04afc78
2018-10-05 10:03:10 -07:00
Eli White 7536c9bdee Fix Incremental children flow type
Summary: Incremental appears to be causing flow errors on Github master causing CI to fail.

Reviewed By: RSNara

Differential Revision: D10205146

fbshipit-source-id: b86c2d099a2041ab1429b9aacb78ff1b382dca41
2018-10-04 14:33:56 -07:00
Radek Czemerys 997f382adc Fix deprecation warning message in Switch
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/21479

Differential Revision: D10205122

Pulled By: TheSavior

fbshipit-source-id: a7bbdae3b5dd6b47c4dc995e3c2e8e40abb64f13
2018-10-04 14:33:56 -07:00
Grégoire Rit fdfe4220e0 Update flow Props declaration in TouchableWithoutFeedBack for onFocus and onBlur (#21462)
Summary:
Simple fix to avoid thoses flow error when using Touchables with onFocus & onBlur.

```
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/components/HomeMenu/MenuItem.js:32:8

Cannot create TouchableOpacity element because property onFocus is missing in object type [1] but exists in props [2].

     src/components/HomeMenu/MenuItem.js
      29│   render() {
      30│     const { text, style } = this.props
      31│     return (
 [2]  32│       <TouchableOpacity
      33│         hasTVPreferredFocus
      34│         style={style.item}
      35│         onFocus={() => this.onFocus()}
      36│         onPress={() => Alert.alert(`You pressed ${text}`)}
      37│       >
      38│         <ImageBackground source={separator} style={style.itemBackground}>
      39│           <Text style={style.text}>{text}</Text>
      40│         </ImageBackground>
      41│       </TouchableOpacity>
      42│     )
      43│   }
      44│ }

     node_modules/react-native/Libraries/Components/Touchable/TouchableOpacity.js
 [1] 286│ }): any): React.ComponentType<Props>);
```
Pull Request resolved: https://github.com/facebook/react-native/pull/21462

Differential Revision: D10179260

Pulled By: TheSavior

fbshipit-source-id: e6c5d1136bdde36c8bcbd4df8897a390dcba8e82
2018-10-03 14:02:49 -07:00
Andrew Chen (Eng) 5be0dff433 Avoid view manager class loads (take 2)
Summary:
Second attempt at landing D9930713. Notes about the previous issue is mentioned as an inline comment below.

===========

We are currently iterating through each view manager to get its class name to pass to JS. JS uses this list to define lazy property accesses for each view manager to grab the constants synchronously. This results in each view manager's class loading immediately -- causing a small perf hit.

Let's avoid this view managers list entirely. JS is able to access each view manager directly by calling getConstantsForViewManager(name)

Reviewed By: axe-fb

Differential Revision: D10118711

fbshipit-source-id: 78de8f34db364a64f5ce6af70e3d8691353b0d4d
2018-10-02 14:03:24 -07:00
Mehdi Mulani e7e63fd409 Dealloc first time RCTNetInfo reachability callback
Summary:
@public
We're seeing a crasher where `self` on line 54 isn't an `RCTNetInfo`. The timing looks related to D9798488, so my theory is that this class is being deallocated before it resolves, and thus causes a crash.

Reviewed By: PeteTheHeat

Differential Revision: D10127341

fbshipit-source-id: 94eaba7def6b118092adcf6b4cce841ccc7d0b59
2018-10-02 14:03:23 -07:00
JenLindsay 408207b356 Split ImageProps into DeprecatedPropTypes (#21411)
Summary:
Related to #21342

- Split ImageProps.js: moved propType declarations to DeprecatedImageProps.js
- Renamed ImageProps references to DeprecatedImageProps in Image.ios.js
Pull Request resolved: https://github.com/facebook/react-native/pull/21411

Reviewed By: TheSavior

Differential Revision: D10146178

Pulled By: RSNara

fbshipit-source-id: 4db15eaaa8822e834af347d1927991dff1c427cb
2018-10-02 13:47:44 -07:00
Sam Goldman 8a4975051e Upgrade xplat/js to Flow v0.82
Reviewed By: yungsters

Differential Revision: D10139929

fbshipit-source-id: ae44a8af7cab28c4acfd7c97e636467e44adcf37
2018-10-01 22:23:18 -07:00
BingBing c1561ab441 iOS: fix the baseline issue when displaying a mixture of different-language characters (#19653)
Summary:
This fixes #19193

Characters of different languages may have different height and different baseline, even with a same font and same font-size. When they mixed together, iOS will adjust their baselines automatically, to display a suitable view of text.

The problem is the behavior of dealing with the text-style property 'lineHeight'.

It once to be a right way at version 0.52.3, to setting a base-line-offset attribute for the whole range of the string. However, in current version, it enumerated the string, and set a different  base-line-offset for different font-height characters.

And this behavior broke the baseline adjustment made by the iOS. It just make every character's baseline aligned to a same line. But it is not supposed to displaying characters of different languages like that. Chinese characters' baseline is the bottom of each, however, it is not for English characters.

So maybe it is the better way to give a same value of base-line-offset attribute for the whole string. And this PR just did that: found the biggest value of font-height in the text, and calculate the offset with that biggest value, then set to the whole string. This will keep the origin baseline adjustment for different languages' chars made by iOS.

Since I always got an error when running the snapshot test locally, I can't even pass the them with the unmodified code in master branch.

The error is "Nesting of \<View\> within \<Text\> is not currently supported."

After I comment all of the check of that error from the source code, I got a different snapshot from the reference ones. It seems that all components which will cause that error are not rendered in the reference images.

Since this PR changed the behavior of 'lineHeight' property, it's better to add a new snapshot case for the situation of different-language-characters' mixture. So maybe somebody could help me with that or maybe it should be a issue?

[IOS] [BUGFIX] [Text] - fix the baseline issue when displaying a mixture of different-language characters
Pull Request resolved: https://github.com/facebook/react-native/pull/19653

Differential Revision: D10140131

Pulled By: shergin

fbshipit-source-id: 646a9c4046d497b78a980d82a015168cf940646b
2018-10-01 21:19:40 -07:00
Ramanpreet Nara 07ac31eb3f Make Flow types more strict
Summary: Many of the optional types from the PR could have been made non-optional. I just made the change because it was simple enough to make and verify.

Reviewed By: TheSavior

Differential Revision: D10131969

fbshipit-source-id: b84693b5549708d7948fe3fd54295bc80be93790
2018-10-01 14:32:27 -07:00
Dishant Kaushik c8705330d7 InspectorPanel -> Delete PropTypes (#21392)
Summary:
Related to #21342
Pull Request resolved: https://github.com/facebook/react-native/pull/21392

Reviewed By: TheSavior

Differential Revision: D10129812

Pulled By: RSNara

fbshipit-source-id: 79e900b56eb043452ce8e13e998a9ad8d4443897
2018-10-01 14:32:27 -07:00
Ronaldo Lima 80066db654 Replace DeprecatedViewPropTypes.style for ViewStyleProp on IntegrationTestHarnessTest and InputAccessoryView (#21397)
Summary:
related #21342
Pull Request resolved: https://github.com/facebook/react-native/pull/21397

Reviewed By: TheSavior

Differential Revision: D10119623

Pulled By: RSNara

fbshipit-source-id: 16bdb3d5bf90c24b597bbc12fc416a50a0aa2bb1
2018-10-01 14:08:29 -07:00
Daiki Nishikawa b6b0fc1f27 Move and Rename custom propType definitions in LayoutPropTypes (#21370)
Summary:
related #21342

TODO
* move LayoutPropType.js
* fix flow error

CheckList
 - [x] `yarn prettier`
 - [x] `yarn flow-check-android`
 - [x] `yarn flow-check-ios`

All flow checks pass.

[GENERAL] [ENHANCEMENT] [DeprecatedLayoutPropTypes.js] - Created.
[GENERAL] [ENHANCEMENT] [StyleSheetTypes.js] - add comments.
Pull Request resolved: https://github.com/facebook/react-native/pull/21370

Differential Revision: D10099715

Pulled By: RSNara

fbshipit-source-id: d0515fe0d56d9ed2fde50cc0bfb75b63aded1f5d
2018-10-01 12:19:15 -07:00
Thomas Carlson d6f3d37802 Rename and move ViewStylePropTypes (#21415)
Summary:
Related to #21342
* Renamed ViewStyleProps to DeprecatedViewStyleProps.
* Moved propType declaration to `react-native/Libraries/DeprecatedPropTypes`
*  ImageProps.js: moved propType declarations to DeprecatedImageProps.js.
Pull Request resolved: https://github.com/facebook/react-native/pull/21415

Reviewed By: TheSavior

Differential Revision: D10119599

Pulled By: RSNara

fbshipit-source-id: 67674039a88dcd570973c7062f86ebdbd6987d28
2018-10-01 12:19:15 -07:00
Hyunjong Lee d00bdb9bb8 Resolve protocol http, https when not in lowercase (#21396)
Summary:
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.

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!_
Pull Request resolved: https://github.com/facebook/react-native/pull/21396

Differential Revision: D10119630

Pulled By: RSNara

fbshipit-source-id: d0fe193eee976b9b18a2eb467b5f3af48bd7d2de
2018-09-29 12:02:11 -07:00
Tim Yung ee034596fe FBJS: Upgrade to ^1.0.0
Summary: Upgrades all dependents of `fbjs` to the latest version.

Reviewed By: mjesun

Differential Revision: D10100661

fbshipit-source-id: 2e2af616cb2b5eab560872b6c6c60ed264e986b2
2018-09-29 03:17:27 -07:00
Ramanpreet Nara e7ddc59019 Renames of ImageSource, ImageStyle, and TextProps propTypes
Reviewed By: TheSavior

Differential Revision: D10101195

fbshipit-source-id: 5c8cde81f92cac87b6cfe3fc1a36c78e4862c5ff
2018-09-28 23:21:40 -07:00
nd-02110114 84f18341aa Move ImageSourcePropType.js, ImageStylePropTypes.js, TextPropTypes.js (#21387)
Summary:
related #21342

TODO
* move ImageSourcePropType.js, ImageStylePropTypes.js, TextPropTypes.js
* fix flow error

CheckList
 - [x] `yarn prettier`
 - [x] `yarn flow-check-android`
 - [x] `yarn flow-check-ios`

All flow checks pass.

[GENERAL] [ENHANCEMENT] [DeprecatedImageSourcePropType.js] - Created.
[GENERAL] [ENHANCEMENT] [DeprecatedImageStylePropTypes.js] - Created.
[GENERAL] [ENHANCEMENT] [DeprecatedTextPropTypes.js] - Created.
Pull Request resolved: https://github.com/facebook/react-native/pull/21387

Reviewed By: TheSavior

Differential Revision: D10099753

Pulled By: RSNara

fbshipit-source-id: c907af6d1549ee42de1a2e17f278998e8422110f
2018-09-28 23:21:38 -07:00
Emily Janzer e2210ab752 Fix flow in InitializeCore
Reviewed By: yungsters

Differential Revision: D10115867

fbshipit-source-id: be619b9d6fc30e318cbc0e0fc6e741d80dd94a4b
2018-09-28 17:16:55 -07:00
Andrew Chen (Eng) e082a61324 Revert D9930713: Avoid view manager class loads
Differential Revision:
D9930713

Original commit changeset: 4aa013f8398d

fbshipit-source-id: 1fed02b41fa9d91f54d1a19f710bdb666701a4a0
2018-09-28 15:20:35 -07:00
Fred Liu 6715268794 Revert D10100555: [react-native][PR] SwipeableRow: Remove PropTypes, convert to ES6 class
Differential Revision:
D10100555

Original commit changeset: ab350546f4fa

fbshipit-source-id: 7afd51aacceac209564c06462ae60c4a12cf4815
2018-09-28 10:48:02 -07:00
Spencer Ahrens ae4be91cac fix broken animation tests
Summary: UIAnimationDragCoefficient is 10.0 in tests for some reason, but we need it to be 1.0 for our tests.

Reviewed By: PeteTheHeat

Differential Revision: D10096375

fbshipit-source-id: 9acd042a3d87a9c6a253745fe48145f0442f6567
2018-09-28 09:17:17 -07:00
Tim Yung 199c918dbe RN: Fix `ReactNativeViewAttributes` Type Bugs
Summary: Fixes the runtime value of `ReactNativeStyleAttributes` to correctly map to `true` instead of strings (as returned by `keyMirror`).

Reviewed By: TheSavior

Differential Revision: D10057235

fbshipit-source-id: dc855cff3a114761098ed5176b2e6e25412481dc
2018-09-28 01:08:09 -07:00
Tim Yung e873809222 RN: Remove Prop Types from `LayoutAnimation`
Summary:
Removes the prop types from `LayoutAnimation` and refines the Flow types.

This also disables `LayoutAnimation.checkConfig` with a `console.error`.

Reviewed By: bvaughn

Differential Revision: D10057234

fbshipit-source-id: a386f3d7dd5deafa1d4681d1f49821821fda9a6a
2018-09-28 01:07:45 -07:00
Tim Yung d16ec74236 RN: Replace `ImageResizeMode` w/ Flow Type
Summary:
Replaces `ImageResizeMode` with a Flow type.

JavaScript enums provide little value when you have a type system.

Reviewed By: bvaughn, TheSavior

Differential Revision: D10057237

fbshipit-source-id: f108b60795a6d82a6786421e4ac72aeedc53bee8
2018-09-28 01:07:30 -07:00
empyrical 9104b04261 SwipeableFlatList, SwipeableQuickActions: Remove PropTypes (#21384)
Summary:
Part of: https://github.com/facebook/react-native/issues/21342

This PR removes the prop types for the components `SwipeableFlatList` and `SwipeableQuickActions`.

The props for `SwipeableFlatList` have been left as not $ReadOnly, because it needs the types in `Libraries/Lists/*` to also be cleaned up. A todo notice has been added.
Pull Request resolved: https://github.com/facebook/react-native/pull/21384

Differential Revision: D10099694

Pulled By: TheSavior

fbshipit-source-id: 424b900942c9a7889b664f351f79abee55923430
2018-09-28 00:19:28 -07:00
empyrical 16f06bcb80 SwipeableRow: Remove PropTypes, convert to ES6 class (#21386)
Summary:
Part of: https://github.com/facebook/react-native/issues/21342

This PR removes prop types from `SwipeableRow`, and converts it from a `createReactClass` to an ES6 class.
Pull Request resolved: https://github.com/facebook/react-native/pull/21386

Differential Revision: D10100555

Pulled By: TheSavior

fbshipit-source-id: ab350546f4fa6f1ed3fdeae07e342890af6d9a22
2018-09-28 00:19:27 -07:00
Dani d8b40cc541 Move and rename StyleSheetPropType to DeprecatedStyleSheetPropType (#21380)
Summary:
This PR moves and renames all references of StyleSheetPropType  to DeprecatedStyleSheetPropType
Related to #21342
Pull Request resolved: https://github.com/facebook/react-native/pull/21380

Differential Revision: D10098216

Pulled By: TheSavior

fbshipit-source-id: da8d927f87bd37cdabc315e0aa17b6ae208f7124
2018-09-27 23:04:20 -07:00
Guilherme Varandas f94d2ade86 Move and Rename propType definitions in ShadowPropTypesIOS (#21379)
Summary:
related #21342

move TransformPropTypes.js
fix flow error

- [x] yarn prettier
- [x] yarn flow-check-android
- [x] yarn flow-check-ios

All flow checks pass.

[GENERAL] [ENHANCEMENT] [DeprecatedShadowPropTypesIOS.js] - Created.
Pull Request resolved: https://github.com/facebook/react-native/pull/21379

Differential Revision: D10098750

Pulled By: TheSavior

fbshipit-source-id: f7f2e4bf7b837c00a14b1fbd930d1b29ffb63549
2018-09-27 19:46:45 -07:00
nd-02110114 c18458b394 Move and Rename custom propType definitions in ColorPropTypes (#21371)
Summary:
related #21342

TODO
* move ColorPropType.js
* fix flow error

CheckList
 - [x] `yarn prettier`
 - [x] `yarn flow-check-android`
 - [x] `yarn flow-check-ios`

All flow checks pass.

[GENERAL] [ENHANCEMENT] [DeprecatedColorPropType.js] - Created.
Pull Request resolved: https://github.com/facebook/react-native/pull/21371

Reviewed By: RSNara

Differential Revision: D10087818

Pulled By: TheSavior

fbshipit-source-id: 48088b441699886eef1fff3aafc2ca6015455006
2018-09-27 17:33:40 -07:00
nd-02110114 00b1f93fae Remove PropTypes from ViewerPagerAndroid.android.js (#21347)
Summary:
related #21342

This is a first PR for this repo.
So, if there are any problem, please tell me 🙇

TODO
* delete props types
* apply read only interface

CheckList
 - [x] `yarn prettier`
 - [x] `yarn flow-check-android`
Pull Request resolved: https://github.com/facebook/react-native/pull/21347

Differential Revision: D10095503

Pulled By: TheSavior

fbshipit-source-id: fd1adb5edf19234ae8ae9f3fe732b03a521eb82b
2018-09-27 17:17:47 -07:00
Thomas BARRAS e3ae85d7c7 TVViewPropTypes, PlatformViewPropTypes, DeprecatedTVViewPropTypes (#21372)
Summary:
Related to #21342

- Split TVViewPropTypes
- PlatformViewPropTypes (dependencies) flow types and old prop-type definitions
- ViewStylePropTypes (dependencies) rm prop-type

Flow tests succeed

[GENERAL] [ENHANCEMENT] [TVViewPropTypes.js] - rm prop-types
[GENERAL] [ENHANCEMENT] [PlatformViewPropTypes.android.js] - replace prop-types by Flow
[GENERAL] [ENHANCEMENT] [PlatformViewPropTypes.ios.js] - replace prop-types by Flow
[GENERAL] [ENHANCEMENT] [DeprecatedTVViewPropTypes.js] - old prop-types
Pull Request resolved: https://github.com/facebook/react-native/pull/21372

Differential Revision: D10095528

Pulled By: TheSavior

fbshipit-source-id: 4fc52ab194f680f95aabefedcbf119d6897672b7
2018-09-27 16:35:42 -07:00
Guilherme Varandas 0da7e8d9ae Move and Rename propType definitions in TransformPropTypes (#21375)
Summary:
related #21342

move TransformPropTypes.js
fix flow error

- [x] yarn prettier
- [x] yarn flow-check-android
- [x] yarn flow-check-ios

All flow checks pass.

[GENERAL] [ENHANCEMENT] [DeprecatedTransformPropTypes.js] - Created.
Pull Request resolved: https://github.com/facebook/react-native/pull/21375

Differential Revision: D10095453

Pulled By: TheSavior

fbshipit-source-id: fbf677a000e3c6c0bd31e915dcafbd2d561be6e3
2018-09-27 16:18:32 -07:00
Andrew Chen (Eng) 95174d4ea8 Avoid view manager class loads
Summary:
We are currently iterating through each view manager to get its class name to pass to JS. JS uses this list to define lazy property accesses for each view manager to grab the constants synchronously. This results in each view manager's class loading immediately -- causing a small perf hit.

Let's avoid this view managers list entirely. JS is able to access each view manager directly by calling getConstantsForViewManager(name)

Reviewed By: TheSavior

Differential Revision: D9930713

fbshipit-source-id: 4aa013f8398d4f51b7eef07937d2977ba1950726
2018-09-27 16:03:24 -07:00
Andrew Chen (Eng) aac7c4d5d2 Refactor UIManager view manager accesses
Summary: Replaced each view manager access with a getViewManager() function call. This will later be used to lazily load view manager classes by allowing java to avoid sending the entire list of view managers to JS.

Reviewed By: QueryConnectionException

Differential Revision: D9695788

fbshipit-source-id: 949858aa2f0b0b00b68e260461ba8f1d085cf07f
2018-09-27 16:03:22 -07:00
Timothy Kukulski 471e8c168a Add @flow to BackHandler
Summary:
Add flow to BackHandler
Fixed callsites

Reviewed By: TheSavior

Differential Revision: D8994015

fbshipit-source-id: 2b910f14b4462020a37a33a8bcff67cef07500a3
2018-09-27 15:47:42 -07:00
Ramanpreet Nara 39f6264a84 Fix internal flow typings
Summary: Fixing internal flow typings so that D10085505 can land.

Reviewed By: TheSavior

Differential Revision: D10090690

fbshipit-source-id: cace32332e85e9e9be243bcc49fba471ae1d2864
2018-09-27 14:32:21 -07:00
empyrical 0fb713909b SwipeableListView: Remove PropTypes (#21298)
Summary:
This PR removes the remaining proptypes from `SwipeableListView`, and cleans up its flow types a bit. Its RNTester example has also been cleaned up, and turned into an ES6 class.

`ListView`'s props have been exported so this can use it.
Pull Request resolved: https://github.com/facebook/react-native/pull/21298

Reviewed By: TheSavior

Differential Revision: D10085505

Pulled By: RSNara

fbshipit-source-id: 20300d582f33b83dfc13cc5ddc71de5ab44bb90b
2018-09-27 14:32:21 -07:00
Ramanpreet Nara f40e744b64 Fix internal flow problems
Summary: D10013265 introduces flow types for `PanResponder`. This diff fixes the facebook-internal flow errors that surface as a result.

Reviewed By: TheSavior

Differential Revision: D10035046

fbshipit-source-id: fbba3d61e68851dda2da4f8e98238e0fdb35a27e
2018-09-27 14:18:31 -07:00
empyrical 3f79b2a4e9 Add flow types to PanResponder (#21291)
Summary:
This PR adds flow types to the `PanResponder` module. It is part of my effort to flowtype the `Swipable*` classes.

A new `touchHistory` field had to be added to `SyntheticEvent` as well.
Pull Request resolved: https://github.com/facebook/react-native/pull/21291

Reviewed By: TheSavior

Differential Revision: D10013265

Pulled By: RSNara

fbshipit-source-id: 3cd65a0eae41c756d1605e6771588d820f040e2a
2018-09-27 14:18:30 -07:00
Alexey Lang 77e6c5e7cf Support logging points from JS
Summary: We want to be able to log individual points from JS.

Reviewed By: ejanzer

Differential Revision: D10050400

fbshipit-source-id: eadd81a8cf70082998950c19a98c3de979eb148a
2018-09-27 12:27:17 -07:00
Jordan Brown 0ee23d0beb Remove unused suppressions in xplat/js
Summary:
There were approximately 350 unused suppressions in xplat/js when checking with .flowconfig.android

The flow team is partially responsible for this, since our release process hasn't changed since we added the flowconfig. In the diff beneath this one, I added the functionality necessary for us to not add any more unused suppressions. To test it, I made this diff. The steps were:

1. Start iOS server
2. Start android server
3. remove unused ios suppressions
4. remove unused android suppressions
5. add ios suppressions with site=react_native_ios_fb
6. add android suppressions with site=react_native_android_fb
7. remove unused ios suppressions. The ones that are unused are ones where an android comment was inserted as well, since the ios comment no longer is next to the error
8. add suppressions using ios flowconfig with site=react_native_fb
9. remove unused android suppressions. The unused ones are ones that were moved up when the cross-platform suppressions were inserted.

I'm going to make this into a script to make sure we don't contribute anymore unused suppressions from our side.

The controller you requested could not be found. nolint

Reviewed By: TheSavior

Differential Revision: D10053893

fbshipit-source-id: 7bee212062f8b2153c6ba906a30cf40df2224019
2018-09-27 11:47:04 -07:00
Richard Cann 236bb018ab StaticRenderer: Removed prop types (#21348)
Summary:
related #21342

 The `render` function, I was not able to specifically type since the props passed to it may vary. At the moment only `renderRow` function from ListView component is using StaticRenderer, and the type of the renderRow function is `Function`.
Let me know what your thoughts are on this. Thank you
Pull Request resolved: https://github.com/facebook/react-native/pull/21348

Differential Revision: D10084990

Pulled By: TheSavior

fbshipit-source-id: a87a8d4976c6ffaf83dc0fddc758869dbc2e2803
2018-09-27 11:17:47 -07:00
danibonilha f68b0c9d79 Split EdgeInsets in DeprecatedPropTypes and flow types (#21351)
Summary:
This PR splits EdgeInsetsPropTypes into EdgeInsetsPropTypes with only flow types and DeprecatedEdgeInsetsPropTypes inside DeprecatedProptypes with only PropTypes.

Related to #21342
Pull Request resolved: https://github.com/facebook/react-native/pull/21351

Reviewed By: RSNara

Differential Revision: D10081512

Pulled By: TheSavior

fbshipit-source-id: 267a6fbb455e02dd7f2b0f3b59790e96387eaa09
2018-09-27 11:02:13 -07:00
Eli White b3bf7e0cf9 Fix react-native export for PointPropType
Summary: PointPropType was split in f3c8027595 but we forgot to change this reference. It was previously requiring PointPropType which now only exports a flow type.

Reviewed By: RSNara

Differential Revision: D10082048

fbshipit-source-id: 6dbfe434873d00d1203aaea65fb3129dee5a00c1
2018-09-27 10:47:58 -07:00
Julio Xavier 0625c348cc Remove PropTypes from IncrementalPresenter (#21343)
Summary:
Related to https://github.com/facebook/react-native/issues/21342
Pull Request resolved: https://github.com/facebook/react-native/pull/21343

Reviewed By: RSNara

Differential Revision: D10080219

Pulled By: TheSavior

fbshipit-source-id: 3a9108208fe6aaa7a30b99f24ceef03e884ec48a
2018-09-27 10:47:57 -07:00
kdastan 9f8fc8f1eb Remove PropTypes from InspectorOverlay (#21345)
Summary:
Related to #21342
Pull Request resolved: https://github.com/facebook/react-native/pull/21345

Differential Revision: D10081976

Pulled By: TheSavior

fbshipit-source-id: d6a905704fc5c2f10a6a8552f04e9c3feaeb147b
2018-09-27 00:14:23 -07:00
nd-02110114 8487e8fc45 Remove PropTypes from MaskedViewIOS.ios.js (#21346)
Summary:
related #21342

This is a first PR for this repo.
So, if there are any problem, please tell me 🙇

TODO
* delete props types
* apply read only interface

CheckList
 - [x] `yarn prettier`
 - [x] `yarn flow-check-ios`
Pull Request resolved: https://github.com/facebook/react-native/pull/21346

Differential Revision: D10081962

Pulled By: TheSavior

fbshipit-source-id: 32387c58f180b9aa5f854e323a4bb29aa73f04c8
2018-09-27 00:14:22 -07:00
kdastan c650407fe9 Remove PropTypes from ElementProperties (#21350)
Summary:
Related to #21342
Pull Request resolved: https://github.com/facebook/react-native/pull/21350

Differential Revision: D10081454

Pulled By: TheSavior

fbshipit-source-id: db27a1f23c643b7d6d73136254eff91625419583
2018-09-26 22:35:13 -07:00
Rafael Nunes G. da Silveira f3c8027595 Split PointPropType (#21355)
Summary:
This PR split PointPropType.js into PointPropType.js with Flow definition and  Libraries/DeprecatedPointPropType.js remaining with PropTypes definition.

Related to #21342
Pull Request resolved: https://github.com/facebook/react-native/pull/21355

Differential Revision: D10081399

Pulled By: TheSavior

fbshipit-source-id: 2283ff3fbda6b0f525742336f92fd6279250b874
2018-09-26 22:35:11 -07:00
empyrical 1b909085fd Move DeprecatedViewPropTypes to DeprecatedViewProps (#21349)
Summary:
This PR moves `DeprecatedViewPropTypes` to a new `DeprecatedViewProps` folder, and copies all documentation comments to the relevant Flow types file.
Pull Request resolved: https://github.com/facebook/react-native/pull/21349

Differential Revision: D10080802

Pulled By: TheSavior

fbshipit-source-id: af4881f3b12e8a1e675b849e0fcf0cc57a68e57f
2018-09-26 20:47:07 -07:00
anthony 7e9c3f77cc Fix HEAD request failing with `Invalid response for blob` (#19567)
Summary:
Fixes #18223

This is a fairly simple solution to what seems to be a recurring issue where certain requests that result in an empty body where JSON is expected throw an error rather than being handled gracefully. Client side error handling is not being hit as this is being thrown at a lower level.
Make a http request that results in an empty blob: ""

[INTERNAL] [BUGFIX] [XMLHttpRequest.js] - Line 262
Pull Request resolved: https://github.com/facebook/react-native/pull/19567

Differential Revision: D8314416

Pulled By: hramos

fbshipit-source-id: a17c49f3620f0abbb936f3a1c2b01aa1b64820fd
2018-09-26 13:50:17 -07:00
empyrical 2da60a8f45 Prettify remaining unprettified files (#21327)
Summary:
This PR is the result of running `yarn prettify` on the codebase - which caught a few files that were not prettified. This will make instructing people to run prettify a bit less complicated, since unrelated files will not show up in diffs.
Pull Request resolved: https://github.com/facebook/react-native/pull/21327

Differential Revision: D10046057

Pulled By: TheSavior

fbshipit-source-id: 2c771a3c758c72816c707e32ee2f4587e466f277
2018-09-25 19:50:08 -07:00
empyrical 0a04bb7030 TabBarIOS: Remove PropTypes (#21315)
Summary:
Part of: https://github.com/react-native-community/discussions-and-proposals/issues/29

This PR removes the prop types from the TabBarIOS files, and cleans up their flow types.
Pull Request resolved: https://github.com/facebook/react-native/pull/21315

Reviewed By: TheSavior

Differential Revision: D10031191

Pulled By: rsnara

fbshipit-source-id: 50dc26b858ea5b065a3934080af7e6b0e36c7f46
2018-09-25 11:02:10 -07:00
Alican Çubukçuoğlu 783cb8e4a6 Export ImageURISource type (#21305)
Summary:
Exporting ImageURISource because we needed to use it in a custom Image component. This should be a case for other people too since handling of `number` ImageSources and `ImageURISource` ImageSources are way different.

Release Notes:
--------------

[GENERAL] [ENHANCEMENT] [Image] - Export "ImageURISource" Flow type
Pull Request resolved: https://github.com/facebook/react-native/pull/21305

Differential Revision: D10024160

Pulled By: rsnara

fbshipit-source-id: f074148345285217014b6ba6735cfdf3508563b5
2018-09-24 20:48:20 -07:00
empyrical 6b892141cc Remove PropTypes from Modal.js (#21279)
Summary:
This PR converts the Prop Types in `Modal` to Flow Types, and fills out the callback types a bit more.

Context Types are left in for now.
Pull Request resolved: https://github.com/facebook/react-native/pull/21279

Reviewed By: yungsters

Differential Revision: D10006795

Pulled By: TheSavior

fbshipit-source-id: ac885f2e5f068b0991009a9b1cbb3886e34941af
2018-09-24 15:20:58 -07:00
empyrical cd1d3ceffe StatusBar: Remove PropTypes (#21293)
Summary:
Part of: https://github.com/react-native-community/discussions-and-proposals/issues/29

This PR removes the remaining PropTypes from `StatusBar` and moves its flowtypes to its own definition.
Pull Request resolved: https://github.com/facebook/react-native/pull/21293

Differential Revision: D10012963

Pulled By: TheSavior

fbshipit-source-id: 7fb4e416eb49e7860809a3e2aaf157590908687d
2018-09-24 13:23:54 -07:00
empyrical 93717e3f17 SnapshotViewIOS: Remove PropTypes (#21294)
Summary:
Part of: https://github.com/react-native-community/discussions-and-proposals/issues/29

This PR removes all PropTypes from `SnapshotViewIOS`, and fills out the flow types for its event callbacks.
Pull Request resolved: https://github.com/facebook/react-native/pull/21294

Differential Revision: D10011659

Pulled By: TheSavior

fbshipit-source-id: 28bfa0ab58c0655f9b905d3cb6530b57166c67f9
2018-09-24 11:02:21 -07:00
empyrical 421667ccae Picker: Remove PropTypes (#21281)
Summary:
Part of: https://github.com/react-native-community/discussions-and-proposals/issues/29

This pull request removes all PropTypes from the various files for `Picker` and cleans up their flow types.
Pull Request resolved: https://github.com/facebook/react-native/pull/21281

Differential Revision: D10007224

Pulled By: TheSavior

fbshipit-source-id: 5b8b7918cc918dd77e7ab27c9e3921ffbeb4ff73
2018-09-23 22:50:40 -07:00
empyrical afb7fc2aab Button: Remove PropTypes (#21280)
Summary:
Part of: https://github.com/react-native-community/discussions-and-proposals/issues/29

This PR removes the `prop-types` from the `Button` component, and cleans up its flow type definitions.
Pull Request resolved: https://github.com/facebook/react-native/pull/21280

Differential Revision: D10007108

Pulled By: TheSavior

fbshipit-source-id: 6206f7e8aab5b56abc5e8e0790a1020494eb2bf0
2018-09-23 19:32:46 -07:00
Janic Duplessis 53bb283fb3 Fix flow type for maxFontSizeMultiplier on TextInput (#21271)
Summary:
This flow type is wrong, probably just a copy paste mistake.
Pull Request resolved: https://github.com/facebook/react-native/pull/21271

Differential Revision: D10006741

Pulled By: TheSavior

fbshipit-source-id: eba0116ec39ba00f000d9bf789ae9214990355a1
2018-09-23 16:11:24 -07:00
Janic Duplessis 3956ee163b Create Renderer README (#21251)
Summary:
I've seen quite a few PRs try to change sync'ed files so let's add this warning and hope people read it.

Not sure if it's better / possible to put it in the oss folder instead.
Pull Request resolved: https://github.com/facebook/react-native/pull/21251

Differential Revision: D9993401

Pulled By: hramos

fbshipit-source-id: 05d22c7f8da1eba97a83d2b7dbc66d9324695a1b
2018-09-21 13:19:35 -07:00
Riley Dulin bbb2d9a5b3 Change new Date() to Date.now() to save on date allocations
Summary:
`new Date().getTime()` is equal to `Date.now()`.
`Date.now()` avoids an allocation, which can save some GC time.

This micro-optimization isn't worth it in most places, but since MessageQueue is one of the hottest pieces of JS in RN, it's worth it.

Reviewed By: javache

Differential Revision: D9972334

fbshipit-source-id: 05d78fd65304f0f27115d76b8b52db11a52c86a0
2018-09-21 11:11:33 -07:00
Valentin Shergin f409fd8d6e Fixed threading issue in RCTImageLoader
Summary: This will probably not fix the crash but the current implementation certenly is/was not thread-safe.

Reviewed By: javache

Differential Revision: D9977538

fbshipit-source-id: a9cac05c313ff51efefbd7c228a1160a3aa75b54
2018-09-21 09:21:17 -07:00
Warren Knox 2271d1f912 Update RCTLinkingManager.h to explicitly state the 'nullability' of parameters (#20798)
Summary:
Fixes #20797

As mentioned in #20797 when running `react-native run-ios Xcode 9.2 will complain about the nullability of pointers in `RCTLinkingManager.h`.
Pull Request resolved: https://github.com/facebook/react-native/pull/20798

Differential Revision: D9988581

Pulled By: hramos

fbshipit-source-id: e3ce7736da97d314a421c2c1ab71577864081642
2018-09-21 06:18:39 -07:00
Janic Duplessis 40bcc38d91 Support the `Slow Animations` option of the iOS simulator (#21157)
Summary:
RN animations currently ignore the `Slow Animations` option on the iOS simulator because we don't use UIKit animations directly. This uses a private api to get the slow coefficient and use it in the native animated driver. We only compile the private api code on simulator so this won't cause issues for app store approval. One possible issue is that the api changes in new iOS versions but I think it's reasonable to do this.

Note that this won't work with JS driven animations, we could expose the slow coefficient as a constant and use that in JS but I decided not to implement it.
Pull Request resolved: https://github.com/facebook/react-native/pull/21157

Differential Revision: D9980306

Pulled By: sahrens

fbshipit-source-id: bdbce2e469261a75cb4b9a251e8e8f212bb9c4e7
2018-09-20 16:18:03 -07:00
Tim Yung d7b34dd38d RN: Ignore StyleSheetValidation if Profiling
Summary: Removes `StyleSheetValidation` when profiling because it creates noise and looks pretty expensive.

Reviewed By: TheSavior

Differential Revision: D9890117

fbshipit-source-id: cc1b8d4e4bc40be2333f09321892317bc841aae0
2018-09-19 16:27:23 -07:00
James Reggio 9733b92f3d Add `onScrollToTop` to ScrollView for iOS (#21204)
Summary:
This PR exposes the `onScrollToTop` event on iOS using the same event-forwarding infrastructure as other ScrollView events. (As such, its `nativeEvent` object reflects the same fields as other ScrollView events.)

Motivation:
----------

If your app is only interested in knowing the position of a ScrollView after a scroll has completed, it can use `onScrollEndDrag` and `onMomentumScrollEnd` to inspect the `contentOffset` after a drag-initiated scroll has finished. (This is much less expensive than observing the `onScroll` event if you only want to know the end position.) However, neither of these `End` events fire if the ScrollView is scrolled to the top by tapping the status bar.

By exposing `onScrollToTop`, it is now possible for an app to cheaply know when such a scroll has completed.
Pull Request resolved: https://github.com/facebook/react-native/pull/21204

Differential Revision: D9943618

Pulled By: hramos

fbshipit-source-id: ac5ee42b7f12d94655ffda617f8f811138da7f6f
2018-09-19 11:17:30 -07:00
Thibault Malbranche ea124a044c Remove extra WKWebView file not used (#21182)
Summary:
This file was created recently but is not used as the WKWebview was integrated directly into the Webview.ios.js

Removing this file to clarify the situation
Pull Request resolved: https://github.com/facebook/react-native/pull/21182

Differential Revision: D9942905

Pulled By: hramos

fbshipit-source-id: 19e9fba94280428edd1deab4a54f8c5dc42a6bfa
2018-09-19 10:09:00 -07:00
Janic Duplessis 2191eecf54 Fix InputAccessoryView safe area when not attached to a TextInput (#21179)
Summary:
When using an InputAccessoryView attached to a TextInput the safe area insets are not applied properly. This uses different autolayout constraints that works in all cases I tested, roughly based on the technique used here https://github.com/stockx/SafeAreaInputAccessoryViewWrapperView/blob/master/SafeAreaInputAccessoryViewWrapperView/Classes/SafeAreaInputAccessoryViewWrapperView.swift#L38.
Pull Request resolved: https://github.com/facebook/react-native/pull/21179

Differential Revision: D9928503

Pulled By: hramos

fbshipit-source-id: b1b623334558093042fd94ac85e1b52dd16aa1a0
2018-09-18 18:31:51 -07:00
Janic Duplessis a0f7d6090f Fix warning in InputAccessoryView (#21174)
Summary:
Currently the warning is always triggered, even on iOS. This simply adds a platform check and tweak the message.
Pull Request resolved: https://github.com/facebook/react-native/pull/21174

Differential Revision: D9929679

Pulled By: hramos

fbshipit-source-id: 383f4a820cf5bf261dbfdcff3b950f9812a65e00
2018-09-18 18:31:51 -07:00
Rafael Oleza c58fb3b73a Remove some automocks from tests
Summary:
They are bad :D

And they affect us when trying to migrate to the babel runtime helpers

Reviewed By: pvdz

Differential Revision: D9829462

fbshipit-source-id: 15240a56e707e13775d57714646e4960cfe202df
2018-09-18 04:18:11 -07:00
Riley Dulin 85505fdd3e Fix map polyfill to use a deterministic key for the hash
Summary:
Prepack does not understand how to use a random key as an object property. Instead, at build time, it generates a deterministic property name based on a deterministic seed for `Math.random()`.

Prepack would like to move away from this, and keep all the `Math.random()` unevaluated and left in the bundle.

Since this is the only usage of `Math.random()` that can't be handled by the abstract interpreter, it should be changed.

Note that the randomness is not required here at all, it just has to be *some* unique key.

Reviewed By: davidaurelio

Differential Revision: D9882757

fbshipit-source-id: 21c213db9716d2faeb8745d811a620b088a83781
2018-09-17 15:02:24 -07:00
Jun Wu e82a2178af Optimize gitignores
Summary:
Use `tools/scm/optimize-gitignore.py` to optimize gitignores in fbcode,
fbandroid, and fbobjc, by moving rules to subdirectories.

Reviewed By: phillco

Differential Revision: D9660076

fbshipit-source-id: 3321ebaafb93e387a11fab000ba9e80afc88b210
2018-09-15 09:01:59 -07:00
Chris Williams 644fc57fad Add iOS 12 textContentType options (#21079)
Summary:
Adding the new `textContentType` options from iOS 12. `newPassword` helps the OS know to put a password field into the keychain, and `oneTimeCode` hints that the field will take input from an SMS one time code.
Pull Request resolved: https://github.com/facebook/react-native/pull/21079

Differential Revision: D9813328

Pulled By: TheSavior

fbshipit-source-id: d2c04b41121b32f185af38ea4c642924e261a043
2018-09-13 14:48:05 -07:00
Marc Horowitz 7f1fcb67e5 Improve the bridge params validator, and its invariant string
Summary:
NaN is not handled consistently by the bridge in all cases,
so detect it and complain.  In order to make the complaint more
obvious, use JSON.stringify on the value, and a replacer so that some
of the censoring which normally takes place doesn't get in the way of
clarity.

Reviewed By: mmmulani

Differential Revision: D9779799

fbshipit-source-id: 6c1a6bfe05ecaa3aeb558acc49dfd54461e1ba74
2018-09-12 19:10:16 -07:00
Emily Janzer ab97b9f602 Fix dev-only redbox in polyfillfunctions
Summary: Fixes a redbox about setting both the accessor and the value for an object. It looks like it's actually coming from PolyfillFunctions, where we set the value as well as spreading in the object descriptor for modules in DEV.

Reviewed By: yungsters

Differential Revision: D9792991

fbshipit-source-id: a2fa5d1820c5eddfd8244722771e76de62f89976
2018-09-12 16:32:50 -07:00
Karan Thakkar 36199d3dda fix RCTNetInfo first time connection status (#20820)
Summary:
Fixes #20804, #8615, https://github.com/facebook/react-native/issues/18368#issuecomment-400610022
Pull Request resolved: https://github.com/facebook/react-native/pull/20820

Differential Revision: D9798488

Pulled By: hramos

fbshipit-source-id: bd93a857b622edfbefdbd1baea746f27658f1366
2018-09-12 14:01:50 -07:00
Yue Xu 2b1d8cc54b Add js engine information in React Native error reporting
Summary:
To avoid "js engine: ..." appearing everywhere, only add this information
to the error message when react native is reporting errors to the server.

Reviewed By: yungsters

Differential Revision: D9754371

fbshipit-source-id: a8001480c75ccf93c953c79f26470df678871cb3
2018-09-12 14:01:50 -07:00
Logan Daniels 6e980a826e Back out "Change ImageBackground to work with percentage image sizes"
Summary:
Original commit changeset: cec3802d30b7

See my comment on original diff: D9307123

The diff regresses ImageBackground in some cases, so I'm reverting until we can re-work the diff to handle existing usages in an expected way.

Differential Revision: D9790698

fbshipit-source-id: 23ad670e004980f22bd1413eca3692f51beff717
2018-09-12 12:31:52 -07:00
David Vacca 0c576ef84a Expose AllowFileAccess property in WebView
Summary: This diff adds a new property in ReactWebView to be able to configure allowFileAccess

Reviewed By: achen1

Differential Revision: D9789466

fbshipit-source-id: 39d042ac6ef69e44f006a4c4b0c2dd900f84dbc9
2018-09-12 11:49:20 -07:00
Valentin Shergin 454aa02210 SafeAreaView: A new prop `emulateUnlessSupported` that turns off the custom implementation of `safeAreaInsets` insets
Summary: In some cases, the custom implementation of this prop is undesirable, so this allows to turn it off.

Reviewed By: yungsters

Differential Revision: D9759228

fbshipit-source-id: 4f61cd900c2da9046977c11a61606a4f5f961177
2018-09-11 21:19:18 -07:00
Tim Yung d6b9ec1c1f YellowBox: Allow Retrying Symbolication
Summary: When symbolication fails, allow retrying without having to reload the current JS VM.

Reviewed By: ejanzer

Differential Revision: D9760666

fbshipit-source-id: 63837c81fe77a9b0b897a858e3d64bc7dcf2c3bd
2018-09-11 20:47:03 -07:00
Tim Yung 5e6e5e92ca YellowBox: Use Feather Icons for Navigation
Summary: Changes YellowBox to use feather icons for the left and right navigation so that we are not dependent on the system's (sometimes funky) unicode icons.

Reviewed By: ejanzer

Differential Revision: D9759134

fbshipit-source-id: b957c24afdccc04bfe78ae4750777c387c2acef4
2018-09-11 20:47:03 -07:00
Héctor Ramos 1151c096da Update copyright headers to yearless format
Summary: This change drops the year from the copyright headers and the LICENSE file.

Reviewed By: yungsters

Differential Revision: D9727774

fbshipit-source-id: df4fc1e4390733fe774b1a160dd41b4a3d83302a
2018-09-11 15:33:07 -07:00
lukedurrant eef8d47a37 Correct RCTAnimation import (#18050)
Summary:
Fixing error
node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h:12:9: 'RCTAnimation/RCTValueAnimatedNode.h' file not found

I'm integrating react native into an existing app through cocoa pods and similar to other PRs
PR https://github.com/facebook/react-native/pull/16192
PR https://github.com/facebook/react-native/pull/16271
PR https://github.com/facebook/react-native/pull/17764
When integrating with cocoa pods
```
pod 'React', :path => './node_modules/react-native', :subspecs => [
    'Core',
    'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket', # needed for debugging
    'RCTImage',
    'RCTWebSocket',
    'BatchedBridge',
    'RCTLinkingIOS',
    'RCTActionSheet',
    'RCTAnimation'
    ]
```
With `RCTAnimation` being the important part for this PR.

Also note without this PR and the other PR's above if anyone is trying to integrate react native into an existing app i.e. through cocoa pods they won't be able too. I think the latest working version is

My app wouldn't build without changing this line

PR https://github.com/facebook/react-native/pull/16192
PR https://github.com/facebook/react-native/pull/16271
PR https://github.com/facebook/react-native/pull/17764

 [IOS] [BREAKING] [PODS] - Fixed RCTAnimation import for integrating with cocoapods
Pull Request resolved: https://github.com/facebook/react-native/pull/18050

Differential Revision: D9235162

Pulled By: hramos

fbshipit-source-id: 426daccf8d8952658e262d5a0e4623c72c38542c
2018-09-11 13:32:20 -07:00
Mehdi Mulani adaeba296e Fix buildStyleInterpolator
Summary: This relied on NaN being turned into null (through JSON.stringify), which would then be handled by Yoga gracefully. But in some cases we do not call JSON.stringify and thus pass NaN directly to Yoga causing a problem.

Reviewed By: fkgozali

Differential Revision: D9764488

fbshipit-source-id: 021c9ffafba8f9bcef2476756a12df33c367bcb1
2018-09-11 11:31:53 -07:00
Kody Greenbaum 159adfb826 Adding Missing Optional Fields to ScrollEvent Type
Summary: Adding Velocity and targetContentOffset Fields to Scroll Event Type

Reviewed By: yungsters

Differential Revision: D9731754

fbshipit-source-id: e4ad89d66d0bb4344c717cf2d94027c54d346375
2018-09-11 10:22:39 -07:00
magicien 2307ea60d0 Fix #18272 TextInput.setNativeProps({text: ''}) to work (#18278)
Summary:
Fix #18272. Calling textInputRef.setNativeProps({text: ''}) or textInputRef.clear() should clear the text input.

- All tests of `yarn run test` are passed
- Test with [the sample app](https://github.com/magicien/react-native-textinput-clear).
    - TextInput.clear() and TextInput.setNativeProps({ text: '***' }) worked
    - When clear() or setNativeProps() called, onChange/onChangeText wasn't called
        - Same behavior as react 0.53.0
    - When non-string values are given to `setNativeProps({text: ___})`, its behavior is the same as react 0.53.0.
        - Value Type | Result
          ---------- | ------------
          null       | same as empty string ''
          undefined  | nothing changes
          number     | throw error
          function   | throw error
          object     | throw error
    - When clear() or setNativeProps() called, attributed text keeps the attributes
    - When `value` prop is set, the text can't be changed

- `clear()` doesn't work from the second time
- `setNativeProps({text '***'})` doesn't work from the second time
- Even when `value` prop is set, you can change the text

![ScreenShot_0.54.0](https://raw.githubusercontent.com/magicien/react-native-textinput-clear/master/screenshot/0.54.0_test.gif)

- `clear()` works every time
- `setNativeProps({text '****'})` works every time

![ScreenShot_Clear_1](https://raw.githubusercontent.com/magicien/react-native-textinput-clear/master/screenshot/clear_test_1.gif)

![ScreenShot_Clear_2](https://raw.githubusercontent.com/magicien/react-native-textinput-clear/master/screenshot/clear_test_2.gif)

- The text keeps the attributes (font family, size, color, text align)

![ScreenShot_Slider](https://raw.githubusercontent.com/magicien/react-native-textinput-clear/master/screenshot/attributed_text_test.gif)

- If `value` prop is set, the text should not be changed

![ScreenShot_Value](https://raw.githubusercontent.com/magicien/react-native-textinput-clear/master/screenshot/value_test.gif)

[IOS] [BUGFIX] [TextInput] - Fix TextInput.clear() and TextInput.setNativeProps({text: ''}) to work
Pull Request resolved: https://github.com/facebook/react-native/pull/18278

Reviewed By: shergin

Differential Revision: D9692561

Pulled By: hramos

fbshipit-source-id: b7ce8f6740fdf666e71d6a85743331ca4805edcb
2018-09-10 17:49:27 -07:00
Tim Yung 672528ffde React sync for revisions bc1ea9c...ade5e69
Summary:
This sync includes the following changes:
- **[ade5e6928](https://github.com/facebook/react/commit/ade5e6928)**: Manually update schedule dep in react-native-renderer (#13609) //<Brian Vaughn>//
- **[f260b14a8](https://github.com/facebook/react/commit/f260b14a8)**: Fix host bailout for the persistent mode (#13611) //<Dan Abramov>//
- **[4a40d7624](https://github.com/facebook/react/commit/4a40d7624)**: Fix a regression related to isReactComponent prototype check (#13608) //<Dan Abramov>//
- **[03ab1efeb](https://github.com/facebook/react/commit/03ab1efeb)**: Improve DX when combining react-dom/profiling and schedule/tracking (#13605) //<Brian Vaughn>//
- **[144328fe8](https://github.com/facebook/react/commit/144328fe8)**: Enable no-use-before-define rule (#13606) //<Dan Abramov>//
- **[8a8d973d3](https://github.com/facebook/react/commit/8a8d973d3)**: Use clearer wording //<Dan>//
- **[7d1169b2d](https://github.com/facebook/react/commit/7d1169b2d)**: Remove injectComponentTree from unstable-native-dependencies, add EventPluginHub (#13598) //<Brandon Dail>//
- **[8d1038fc6](https://github.com/facebook/react/commit/8d1038fc6)**: Break up ReactDOMServerIntegrationForm-test (#13600) //<Nathan Hunzaker>//
- **[b87aabdfe](https://github.com/facebook/react/commit/b87aabdfe)**: Drop the year from Facebook copyright headers and the LICENSE file. (#13593) //<Héctor Ramos>//
- **[e417e0bf7](https://github.com/facebook/react/commit/e417e0bf7)**: Update ReactNativeViewConfigRegistry Flow Types (#13579) //<Timothy Yung>//
- **[71c0e05ba](https://github.com/facebook/react/commit/71c0e05ba)**: Update bundle sizes for 16.5.0 release //<Brian Vaughn>//
- **[6255cc394](https://github.com/facebook/react/commit/6255cc394)**: Updating package versions for release 16.5.0 //<Brian Vaughn>//
- **[28cb37978](https://github.com/facebook/react/commit/28cb37978)**: Added a test for Profiler onRender that throws (#13575) //<Brian Vaughn>//
- **[8963118b3](https://github.com/facebook/react/commit/8963118b3)**: Update react-dom README //<Dan Abramov>//
- **[b47a28cb9](https://github.com/facebook/react/commit/b47a28cb9)**: Tweak react-dom README //<Dan Abramov>//
- **[f765f0225](https://github.com/facebook/react/commit/f765f0225)**: When a root expires, flush all expired work in a single batch (#13503) //<Andrew Clark>//
- **[550dd1d2e](https://github.com/facebook/react/commit/550dd1d2e)**: Call Profiler onRender after mutations (#13572) //<Brian Vaughn>//
- **[34348a45b](https://github.com/facebook/react/commit/34348a45b)**: Add enableSuspenseServerRenderer feature flag (#13573) //<Alex Taylor>//
- **[4e744be6e](https://github.com/facebook/react/commit/4e744be6e)**: Added react-dom/profiling entry point to NPM package (#13570) //<Brian Vaughn>//
- **[bb627228e](https://github.com/facebook/react/commit/bb627228e)**: test: add test for fragement props (#13565) //<laoxiong>//
- **[9a110ebd8](https://github.com/facebook/react/commit/9a110ebd8)**: Cleaned up 'schedule' API wrt interactions and subscriber ref: (#13561) //<Brian Vaughn>//
- **[fb88fd9d8](https://github.com/facebook/react/commit/fb88fd9d8)**: Fixed schedule/tracking require for www sync script (#13556) //<Brian Vaughn>//
- **[955393cab](https://github.com/facebook/react/commit/955393cab)**: refactor: remove emove type judgment when defining warning props (#13553) //<laoxiong>//
- **[ff9399602](https://github.com/facebook/react/commit/ff9399602)**: Fix import of ReactDOM in server env //<Dan Abramov>//
- **[281bd64c0](https://github.com/facebook/react/commit/281bd64c0)**: Fix test file name //<Dan Abramov>//
- **[d6b59e3d2](https://github.com/facebook/react/commit/d6b59e3d2)**: Check document.documentMode once //<Dan Abramov>//
- **[52633c84e](https://github.com/facebook/react/commit/52633c84e)**: Try/finally //<Dan Abramov>//
- **[2d4705e75](https://github.com/facebook/react/commit/2d4705e75)**: Make IE 11 not complain about non-crucial style attribute hydration mismatch (#13534) //<Michał Gołębiowski-Owczarek>//
- **[25d48a728](https://github.com/facebook/react/commit/25d48a728)**: Add gridArea to unitless CSS properties (#13550) //<Michał Gołębiowski-Owczarek>//
- **[877f8bc6b](https://github.com/facebook/react/commit/877f8bc6b)**: Renamed schedule UMD forwarding methods to stay in-sync with SECRET_INTERNALS change (#13549) //<Brian Vaughn>//
- **[0a96f9057](https://github.com/facebook/react/commit/0a96f9057)**: Revert "Extract common logic" (#13547) //<Dan Abramov>//
- **[17a57adde](https://github.com/facebook/react/commit/17a57adde)**: Fix test //<Dan Abramov>//
- **[605da8b42](https://github.com/facebook/react/commit/605da8b42)**: Extract common logic (#13535) //<Heaven>//
- **[69f9f4127](https://github.com/facebook/react/commit/69f9f4127)**: Document event bubble order (#13546) //<Philipp>//
- **[c1ba7b8cf](https://github.com/facebook/react/commit/c1ba7b8cf)**: Remove www scheduler fork (#13545) //<Dan Abramov>//
- **[b473d5f86](https://github.com/facebook/react/commit/b473d5f86)**: Secret exports: Scheduler => Schedule (#13544) //<Dan Abramov>//
- **[6312efc34](https://github.com/facebook/react/commit/6312efc34)**: Tweak README and description //<Dan Abramov>//
- **[b92f947af](https://github.com/facebook/react/commit/b92f947af)**: Rename "react-scheduler" package to "schedule" (#13543) //<Brian Vaughn>//
- **[3c1dcd349](https://github.com/facebook/react/commit/3c1dcd349)**: Expose less internals for TestUtils (#13539) //<Dan Abramov>//
- **[0b74e95d7](https://github.com/facebook/react/commit/0b74e95d7)**: Ignore noscript content on the client (#13537) //<Fredrik Höglund>//
- **[8a1e3962a](https://github.com/facebook/react/commit/8a1e3962a)**: Remove negative lookbehind from Rollup plugin that broke Node <= v8.9 (#13538) //<Brian Vaughn>//
- **[9604d26ae](https://github.com/facebook/react/commit/9604d26ae)**: Rename ReactDOMFiber* to ReactDOM* (#13540) //<Dan Abramov>//
- **[28b928902](https://github.com/facebook/react/commit/28b928902)**: Tidied up scheduling UMD API forwarding test (#13533) //<Brian Vaughn>//
- **[bf8aa6092](https://github.com/facebook/react/commit/bf8aa6092)**: Added Jest test to verify UMD API-forwarding for scheduling package (#13532) //<Brian Vaughn>//
- **[0040efc8d](https://github.com/facebook/react/commit/0040efc8d)**: Fix a typo (#13531) //<Heaven>//
- **[46950a3df](https://github.com/facebook/react/commit/46950a3df)**: Interaction tracking follow up (#13509) //<Brian Vaughn>//
- **[0452c9bba](https://github.com/facebook/react/commit/0452c9bba)**: Add a regression test for #4618 //<Dan Abramov>//
- **[c21bab694](https://github.com/facebook/react/commit/c21bab694)**: Add SSR regression test for #6119 //<Dan Abramov>//
- **[0d3fc9de1](https://github.com/facebook/react/commit/0d3fc9de1)**: Add regression test for #6119 //<Dan Abramov>//
- **[0f050ad7c](https://github.com/facebook/react/commit/0f050ad7c)**: Make regression test better //<Dan Abramov>//
- **[f94342323](https://github.com/facebook/react/commit/f94342323)**: Add a more precise regression test for #6219 //<Dan Abramov>//
- **[a3e4d0008](https://github.com/facebook/react/commit/a3e4d0008)**: Fixed typo (#13519) //<Ivan>//
- **[b3d8c5376](https://github.com/facebook/react/commit/b3d8c5376)**: [RN] Remove isMounted() false positive warning (#13511) //<Dan Abramov>//
- **[d2123d656](https://github.com/facebook/react/commit/d2123d656)**: Sync React Native Flow Changes (#13513) //<Timothy Yung>//
- **[1c0ba70b4](https://github.com/facebook/react/commit/1c0ba70b4)**: Fix test to use AsyncMode //<Dan>//
- **[6e4f7c788](https://github.com/facebook/react/commit/6e4f7c788)**: Profiler integration with interaction-tracking package (#13253) //<Brian Vaughn>//
- **[2967ebdbe](https://github.com/facebook/react/commit/2967ebdbe)**: Remove buggy unstable_deferredUpdates() (#13488) //<Dan Abramov>//
- **[1664b08f0](https://github.com/facebook/react/commit/1664b08f0)**: added flow types to setInnerHTML (#13495) //<Bryan M>//
- **[672e859d3](https://github.com/facebook/react/commit/672e859d3)**: Add warning to prevent setting this.state to this.props referentially (#11658) //<Veekas Shrivastava>//
- **[29287f088](https://github.com/facebook/react/commit/29287f088)**: Rename lowestPendingInteractiveExpirationTime (#13484) //<Heaven>//
- **[d400d6d5e](https://github.com/facebook/react/commit/d400d6d5e)**: Replace magic number 1 with ELEMENT_NODE (#13479) //<Heaven>//
- **[340bfd939](https://github.com/facebook/react/commit/340bfd939)**: Rename ReactTypeOfWork to ReactWorkTags, ReactTypeOfSideEffect to ReactSideEffectTags (#13476) //<Sophie Alpert>//
- **[5cefd9b1e](https://github.com/facebook/react/commit/5cefd9b1e)**: Stringify <option> children (#13465) //<Dan Abramov>//
- **[3661616c2](https://github.com/facebook/react/commit/3661616c2)**: Improve test harness of submit events (#13463) //<Philipp Spieß>//
- **[a1be17140](https://github.com/facebook/react/commit/a1be17140)**: Revert "Rely on bubbling for submit and reset events (#13358)" (#13462) //<Dan Abramov>//
- **[90c92c700](https://github.com/facebook/react/commit/90c92c700)**: Fix warning message //<Dan Abramov>//
- **[5cb0f2bf5](https://github.com/facebook/react/commit/5cb0f2bf5)**: Change www error shim API (#13454) //<Dan Abramov>//
- **[e106b8c44](https://github.com/facebook/react/commit/e106b8c44)**: Warn about unsafe toWarnDev() nesting in tests (#12457) //<Brian Vaughn>//
- **[026aa9c97](https://github.com/facebook/react/commit/026aa9c97)**: Bumped version to 16.4.3-alpha.0 (#13448) //<Brian Vaughn>//
- **[d670bdc6b](https://github.com/facebook/react/commit/d670bdc6b)**: Warn about ReactDOM.createPortal usage within ReactTestRenderer (#12895) //<Brian Vaughn>//
- **[bf1abf478](https://github.com/facebook/react/commit/bf1abf478)**: Fix React.lazy(forwardRef) (#13446) //<Dan Abramov>//
- **[e8571c798](https://github.com/facebook/react/commit/e8571c798)**: Tweak ReactTypeOfWork order (#13444) //<Dan Abramov>//
- **[973496b40](https://github.com/facebook/react/commit/973496b40)**: Fix component name for React.lazy (#13443) //<Dan Abramov>//
- **[0beb2ee76](https://github.com/facebook/react/commit/0beb2ee76)**: Fix incorrect legacy context for factory components (#13441) //<Dan Abramov>//
- **[004cb21bb](https://github.com/facebook/react/commit/004cb21bb)**: Short circuit the logic for exporting a module (#13392) //<Joseph>//
- **[f7a538c91](https://github.com/facebook/react/commit/f7a538c91)**: Remove getTextContentAccessor (#13434) //<Brandon Dail>//
- **[d1c42d2f1](https://github.com/facebook/react/commit/d1c42d2f1)**: Remove addEventListener check in isEventSupported (#13435) //<Brandon Dail>//
- **[a869f992a](https://github.com/facebook/react/commit/a869f992a)**: Remove helper object from FallbackCompositionState (#13430) //<Brandon Dail>//
- **[0cd8d470d](https://github.com/facebook/react/commit/0cd8d470d)**: Do not toLowerCase lists of lowercase words (#13428) //<Nathan Hunzaker>//
- **[b3a4cfea5](https://github.com/facebook/react/commit/b3a4cfea5)**: Trap click events for portal root (#11927) //<Brandon Dail>//
- **[0da5102cf](https://github.com/facebook/react/commit/0da5102cf)**: Add interaction-tracking/subscriptions (#13426) //<Brian Vaughn>//
- **[4b32f525e](https://github.com/facebook/react/commit/4b32f525e)**: Refactor away some namespace imports (#13427) //<Dan Abramov>//
- **[d2f5c3fbc](https://github.com/facebook/react/commit/d2f5c3fbc)**: Don't diff memoized host components in completion phase (#13423) //<Dan Abramov>//
- **[5e0f073d5](https://github.com/facebook/react/commit/5e0f073d5)**: interaction-tracking package (#13234) //<Brian Vaughn>//
- **[d14e443d6](https://github.com/facebook/react/commit/d14e443d6)**: Resume onSelect tracking after dragend (#13422) //<Dan Abramov>//
- **[d5edc1f51](https://github.com/facebook/react/commit/d5edc1f51)**: Remove unused ReactCall & ReactReturn types (#13419) //<Esteban>//
- **[4fa20b53b](https://github.com/facebook/react/commit/4fa20b53b)**: Don't pass instanceHandle to clones (#13125) //<Sebastian Markbåge>//
- **[fe959eea7](https://github.com/facebook/react/commit/fe959eea7)**: React.lazy (#13398) //<Andrew Clark>//
- **[2b3082800](https://github.com/facebook/react/commit/2b3082800)**: Fix wrong Flow return type //<Andrew Clark>//
- **[5031ebf6b](https://github.com/facebook/react/commit/5031ebf6b)**: Accept promise as element type (#13397) //<Andrew Clark>//
- **[77b7a660b](https://github.com/facebook/react/commit/77b7a660b)**: fix: do not reconcile children that are iterable functions (#13416) //<Rauno Freiberg>//
- **[cb7745c6c](https://github.com/facebook/react/commit/cb7745c6c)**: remove unused state initialValue from ReactDOMFiberSelect (#13412) //<Kartik Lad>//
- **[9832a1b6d](https://github.com/facebook/react/commit/9832a1b6d)**: Avoid setting empty value on reset & submit inputs (#12780) //<Ellis Clayton>//
- **[8862172fa](https://github.com/facebook/react/commit/8862172fa)**: Provide a better error message (#12421) //<Aaron Brager>//
- **[581682917](https://github.com/facebook/react/commit/581682917)**: De-duplicate commitUpdateQueue effect commit (#13403) //<Ruud Burger>//
- **[1bc975d07](https://github.com/facebook/react/commit/1bc975d07)**: Don't stop context traversal at matching consumers (#13391) //<Andrew Clark>//
- **[83e446e1d](https://github.com/facebook/react/commit/83e446e1d)**: Refactor ReactErrorUtils (#13406) //<Dan Abramov>//
- **[13fa96a54](https://github.com/facebook/react/commit/13fa96a54)**: Improve bad ref invariant (#13408) //<Dan Abramov>//
- **[b2adcfba3](https://github.com/facebook/react/commit/b2adcfba3)**: Don't suppress jsdom error reporting in our tests (#13401) //<Dan Abramov>//
- **[69e2a0d73](https://github.com/facebook/react/commit/69e2a0d73)**: Ability to access window.event in development (#11687) (#11696) //<Conrad Irwin>//
- **[ade4dd3f6](https://github.com/facebook/react/commit/ade4dd3f6)**: Fix typo in a comment (#13373) //<davidblnc>//
- **[2c59076d2](https://github.com/facebook/react/commit/2c59076d2)**: Warn when "false" or "true" is the value of a boolean DOM prop (#13372) //<Moti Zilberman>//
- **[de5102c4c](https://github.com/facebook/react/commit/de5102c4c)**: Ignore symbols and functions in select tag (#13389) //<Rauno Freiberg>//
- **[d04d03e47](https://github.com/facebook/react/commit/d04d03e47)**: Fix passing symbols and functions to textarea (#13362) //<Rauno Freiberg>//
- **[5550ed4a8](https://github.com/facebook/react/commit/5550ed4a8)**: Ensure arguments are coerced to strings in warnings (#13385) //<Nathan Hunzaker>//
- **[3938ccc88](https://github.com/facebook/react/commit/3938ccc88)**: Allow the user to opt out of seeing "The above error..." addendum (#13384) //<Dan Abramov>//
- **[47e217a77](https://github.com/facebook/react/commit/47e217a77)**: Provide component reference in ReactDOMFiberTextarea warnings (#13361) //<Rauno Freiberg>//
- **[a0190f828](https://github.com/facebook/react/commit/a0190f828)**: Rename SafeValue to ToStringValue (#13376) //<Philipp Spieß>//
- **[33602d435](https://github.com/facebook/react/commit/33602d435)**: Improve soundness of ReactDOMFiberInput typings (#13367) //<Philipp Spieß>//
- **[ae855cec2](https://github.com/facebook/react/commit/ae855cec2)**: Support tangentialPressure and twist fields of pointer events (#13374) //<Moti Zilberman>//
- **[725e499cf](https://github.com/facebook/react/commit/725e499cf)**: Rely on bubbling for submit and reset events (#13358) //<Philipp Spieß>//
- **[e07a3cd28](https://github.com/facebook/react/commit/e07a3cd28)**: fix typo on inline comment (#13364) //<Alex Rohleder>//
- **[e0204084a](https://github.com/facebook/react/commit/e0204084a)**: Fix typos detected by github.com/client9/misspell (#13349) //<Kazuhiro Sera>//
- **[be4533af7](https://github.com/facebook/react/commit/be4533af7)**: Fix hydration of non-string dangerousSetInnerHTML.__html (#13353) //<Dan Abramov>//
- **[0072b5998](https://github.com/facebook/react/commit/0072b5998)**: Improve scry() error message for bad first argument (#13351) //<Dan Abramov>//
- **[d59b993a7](https://github.com/facebook/react/commit/d59b993a7)**: Make nicer stacks DEV-only //<Dan>//
- **[54d86eb82](https://github.com/facebook/react/commit/54d86eb82)**: Improve display of filenames in component stack (#12059) //<Billy Janitsch>//
- **[067cc24f5](https://github.com/facebook/react/commit/067cc24f5)**: Profiler actualDuration bugfix (#13313) //<Brian Vaughn>//
- **[3cfab14b9](https://github.com/facebook/react/commit/3cfab14b9)**: Treat focusable as enumerated boolean SVG attribute (#13339) //<Dan Abramov>//
- **[3b3b7fcbb](https://github.com/facebook/react/commit/3b3b7fcbb)**: Don't search beyond Sync roots for highest priority work (#13335) //<Dan Abramov>//
- **[08e32263f](https://github.com/facebook/react/commit/08e32263f)**: Fix Prettier "No parser" warning while building (#13323) //<Bartosz Kaszubowski>//
- **[ac7238856](https://github.com/facebook/react/commit/ac7238856)**: Add support for auxclick event (#11571) //<Jason Quense>//
- **[75491a8f4](https://github.com/facebook/react/commit/75491a8f4)**: Add a regression test for #12200 (#12242) //<Gareth Small>//
- **[2d0356a52](https://github.com/facebook/react/commit/2d0356a52)**: Make sure that `select` has `multiple` attribute set to appropriate state before appending options (#13270) //<Dmytro Zasyadko>//
- **[b179bae0a](https://github.com/facebook/react/commit/b179bae0a)**: Enhance get derived state from props state warning - #12670 (#13317) //<Felix Wu>//
- **[15a8f0318](https://github.com/facebook/react/commit/15a8f0318)**: Fix ambiguity in doc comment for isValidElement (#12826) //<Alexey>//
- **[5cff21207](https://github.com/facebook/react/commit/5cff21207)**: add flowtype to function signature (#13285) //<ryota-murakami>//
- **[b565f4953](https://github.com/facebook/react/commit/b565f4953)**: Minimally support iframes (nested browsing contexts) in selection event handling (#12037) //<Andrew Patton>//
- **[1609cf343](https://github.com/facebook/react/commit/1609cf343)**: Warn about rendering Generators (#13312) //<Dan Abramov>//
- **[46d5afc54](https://github.com/facebook/react/commit/46d5afc54)**: Replace console.error() with a throw in setTimeout() as last resort exception logging (#13310) //<Dan Abramov>//
- **[b3b80a483](https://github.com/facebook/react/commit/b3b80a483)**: Inject react-art renderer into react-devtools (#13173) //<Yunchan Cho>//
- **[5e8beec84](https://github.com/facebook/react/commit/5e8beec84)**: Add a regression test for #11602 //<Dan Abramov>//
- **[470377bbd](https://github.com/facebook/react/commit/470377bbd)**: Remove extraneous condition //<Dan Abramov>//
- **[6db080154](https://github.com/facebook/react/commit/6db080154)**: Remove irrelevant suggestion of a legacy method from a warning (#13169) //<Ideveloper>//
- **[f60a7f722](https://github.com/facebook/react/commit/f60a7f722)**: Fix SSR crash on a hasOwnProperty attribute (#13303) //<Dan Abramov>//
- **[ff41519ec](https://github.com/facebook/react/commit/ff41519ec)**: Sanitize unknown attribute names for SSR (#13302) //<Dan Abramov>//
- **[c44c2a216](https://github.com/facebook/react/commit/c44c2a216)**: More helpful message when passing an element to createElement() (#13131) //<Dylan Cutler>//
- **[28cd494bd](https://github.com/facebook/react/commit/28cd494bd)**: Refactor validateDOMNesting a bit (#13300) //<Dan Abramov>//
- **[b381f4141](https://github.com/facebook/react/commit/b381f4141)**: Allow Electrons <webview> tag (#13301) //<Philipp Spieß>//
- **[0182a7463](https://github.com/facebook/react/commit/0182a7463)**: Fix a crash when using dynamic children in <option> tag (#13261) //<Konstantin Yakushin>//
- **[2a2ef7e0f](https://github.com/facebook/react/commit/2a2ef7e0f)**: Remove unnecessary branching from updateContextProvider (#13282) //<Andrew Clark>//
- **[840cb1a26](https://github.com/facebook/react/commit/840cb1a26)**: Add an invariant to createRoot() to validate containers (#13279) //<Dan Abramov>//

Release Notes:
[GENERAL] [FEATURE] [React] - React sync for revisions bc1ea9c...ade5e69

Reviewed By: bvaughn

Differential Revision: D9561644

fbshipit-source-id: 3be120d7450f310af458897d54993a6c086cff2f
2018-09-10 14:47:11 -07:00
Jamiboy Mohammad dbec6e1096 Change ImageBackground to work with percentage image sizes
Summary: ImageBackground assigned its Image the same `width` and `height` styles as itself. This became an issue for ImageBackground instances that were assigned (non 100%) percentage size values. For example, if the `width` and/or `height` of the ImageBackground was set to be 50%, it would be half the size of the current component it is in (as intended), but the Image would be 50% of the ImageBackground, which is only 25% the size of the ImageBackground's parent component.

Reviewed By: shergin

Differential Revision: D9307123

fbshipit-source-id: cec3802d30b72c44f66dd3a53693ebd669cc8db4
2018-09-10 13:47:28 -07:00
Tim Yung 5023b105e4 JS: Switch to `nullthrows` Package [1/4]
Summary:
Switches to the `nullthrows` package instead of using `fbjs/lib/nullthrows`.

The version of `nullthrows` in `fbjs` is outdated and already missing features that exist in the standalone `nullthrows` package.

Also, this mitigates the inevitable collision between `nullthrows` (as a Haste module) and `nullthrows` (as a `node_modules` dependency).

Reviewed By: zertosh

Differential Revision: D9733178

fbshipit-source-id: 1b589d48c1ed57cebf2088b796ad72e212534c0a
2018-09-10 01:46:48 -07:00
Christoph Jerolimov c3e42b5531 Fix that BackHandler was not called on Android (#19077)
Summary:
This fixes issues #18954 and #15497

The transformation from Set to (an reversed) Array does not work on Android devices when the remote debugging was started with `react-native run-android`.

<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->

Add the following code to your App.js and run the app with `react-native run-android` in an Android device:

```
  componentDidMount() {
    BackHandler.addEventListener('hardwareBackPress', () => {
      console.warn('Callback called. Do not close app. Do nothing at all.');
      return true; // Do not close the app.
    });
  }
```

After adding this, the app should NOT close when you press the back button. Without this fix, the app closes (which is the default behaviour).

See also the comments from Victoriayangx in #18954 and #15497.

<!--
  Does this PR require a documentation change?
  Create a PR at https://github.com/facebook/react-native-website and add a link to it here.
-->

<!--
  Required.
  Help reviewers and the release process by writing your own release notes. See below for an example.
-->

[ANDROID] [BUGFIX] [BackHandler] - Fix that BackHandler was not called on Android

<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Pull Request resolved: https://github.com/facebook/react-native/pull/19077

Reviewed By: yns88

Differential Revision: D9692298

Pulled By: hramos

fbshipit-source-id: 4526b07a4924055ebc9c42e02615c27aa5c97fbb
2018-09-07 10:26:20 -07:00
Kevin Gozali 0df92afc1c Remove NavigatorIOS
Summary:
Legacy navigator impl. There are other alternatives that should be used instead.

Part of the slimmening effort as described here: https://github.com/react-native-community/discussions-and-proposals/issues/6

Reviewed By: TheSavior

Differential Revision: D9677824

fbshipit-source-id: 24ae500751d2a8c398f246d36604a58f0b3c113b
2018-09-07 10:26:20 -07:00
Zack Gomez 5eaa2d29c0 Fix inability to remove 'Disabled' state from AccessibilityStates
Summary:
D8842691 split AccessibilityTraits into multiple RN properties.  However, the accessor code did not support REMOVING traits.
This results in buttons that were disabled (AccessibilityTraits & NotEnabled === true) never being enabled.

Fix the issue by making the split accessors properly mask in the bits, allowing you unset them without disturbing bits managed by the other accessor.

NOTE: setting AccessibilityTraits and AccessibilityRole or AccessibilityStates will still result in bugs.

Reviewed By: shergin

Differential Revision: D9661970

fbshipit-source-id: 77d70dd0754f2eaf8cbf895bfc13757c697a76d8
2018-09-07 10:26:19 -07:00
Adam Comella 01d5eff425 iOS: Add a maxFontSizeMultiplier prop to <Text> and <TextInput> (#20915)
Summary:
**Motivation**

Whenever a user changes the system font size to its maximum allowable setting, React Native apps that allow font scaling can become unusable because the text gets too big. Experimenting with a native app like iMessage on iOS, the font size used for non-body text (e.g. header, navigational elements) is capped while the body text (e.g. text in the message bubbles) is allowed to grow.

This PR introduces a new prop on `<Text>` and `<TextInput>` called `maxFontSizeMultiplier`. This enables devs to set the maximum allowed text scale factor on a Text/TextInput. The default is 0 which means no limit.

Another PR will add this feature to Android.

**Test Plan**

I created a test app which utilizes all categories of values of `maxFontSizeMultiplier`:
  - `undefined`: inherit from parent
  - `0`: no limit
  - `1`, `1.2`: fixed limits

I tried this with `Text`, `TextInput` with `value`, and `TextInput` with children. For `Text`, I also verified that nesting works properly (if a child `Text` doesn't specify `maxFontSizeMultiplier`, it inherits it from its parent).

Lastly, we've been using a version of this in Skype for several months.

**Release Notes**

[GENERAL] [ENHANCEMENT] [Text/TextInput] - Added maxFontSizeMultiplier prop to prevent some text from getting unusably large as user increases OS's font scale setting (iOS)

Adam Comella
Microsoft Corp.
Pull Request resolved: https://github.com/facebook/react-native/pull/20915

Differential Revision: D9646739

Pulled By: shergin

fbshipit-source-id: c823f59c1e342c22d6297b88b2cb11c5a1f10310
2018-09-04 17:50:42 -07:00
Oleg Lokhvitsky 5f48d28119 ScrollView snapToStart/snapToEnd
Summary: Added `snapToStart` and `snapToEnd` props to ScrollView which work together with `snapToOffsets` and determine whether the beginning and end of the list automatically count as snap offsets or not. If not, the list is allowed to free-scroll between its start/end and the first/last snap offset.

Reviewed By: sahrens

Differential Revision: D9442386

fbshipit-source-id: 47a5fdb20f884542434b01b1f0a486ed2b478c6e
2018-08-30 13:04:50 -07:00
Oleg Lokhvitsky fd744dd56c ScrollView snapToOffsets
Summary:
* Added snapToOffsets prop to ScrollView. Allows snapping at arbitrary points.

* Fixed pagingEnabled not being overridden by snapToInterval on iOS.

* Fixed Android *requiring* pagingEnabled to be defined alongside snapToInterval.
* Added support for decelerationRate on Android.

* Fixed snapping implementation. It was not calculating end position correctly at all (velocity is not a linear offset).
  * Resolves https://github.com/facebook/react-native/issues/20155
* Added support for new content being added during scroll (mirrors existing functionality in vertical ScrollView).

* Added support for snapToInterval.
  * Resolves https://github.com/facebook/react-native/issues/19552

Reviewed By: yungsters

Differential Revision: D9405703

fbshipit-source-id: b3c367b8079e6810794b0165dfdbcff4abff2eda
2018-08-30 13:04:50 -07:00
Emily Janzer 1736be5811 Add onTextLayout to TextProps
Summary: Splitting this into a separate diff for OSS

Reviewed By: yungsters

Differential Revision: D9551085

fbshipit-source-id: 8ca08351c6b89cd0011aab3c47ef6cc28b763450
2018-08-30 09:33:05 -07:00
Tim Yung 19a8a578dc RN: Improve ViewPropTypes
Summary:
Makes a couple improvements to `ViewPropTypes`.

- Remove deprecated transform props. We are now using exact object types, so they are already disallowed.
- Remove garbage types for `accessibilityLabel`.

Reviewed By: TheSavior

Differential Revision: D9542088

fbshipit-source-id: f9128353e19cff22caf52c896c9c137f01aea276
2018-08-29 17:49:24 -07:00
David Vacca eb225fa173 Revert changes of the name for AndroidHorizontalScrollView
Summary: This diff reverts the changes in the name for AndroidHorizontalScrollView and AndroidHorizontalScrollContentView that caused a redbox for continuous OTA users

Reviewed By: fkgozali

Differential Revision: D9561972

fbshipit-source-id: 3d8e9ee8bb6081107bc8d315af16885bb003148e
2018-08-29 15:48:59 -07:00
David Vacca 575f7d478d Implement HorizontalScrollView component
Summary: This diff implements the HorizontalScrollView component for Android Fabric C++, as part of this diff I also re-named the components AndroidHorizontalScrollContentView for RCTAndroidHorizontalScrollContentView and AndroidHorizontalScrollView for RCTAndroidHorizontalScrollView. This might sound against our plan of removing the RCT preffix, but it is to make it simpler to map components between current implementation of RN and Fabric (otherwise we don't know when to add the RCT preffix in Android side to find the right View Manager), later we can just remove the preffix from C++, Android, iOS and JS.

Reviewed By: shergin, achen1

Differential Revision: D9122729

fbshipit-source-id: e9299552857c6dd0c18abfa5fa49a3d50e221729
2018-08-28 23:03:33 -07:00
Logan Daniels 122dc37afe Deeply compare viewabilityConfigs to avoid triggering invariant unnecessarily
Summary:
Currently, modifying a component that renders a FlatLists while Hot Reloading is enabled will trigger an invariant inside FlatList for changing viewabilityConfig on the fly. This happens because it checks object equality between the configs.

By checking equality of the config's *properties* instead, we maintain the efficacy of the invariant but keep it from falsely triggering during development.

Reviewed By: sahrens

Differential Revision: D9466129

fbshipit-source-id: 67149e9e70ad7b2e2584bb7ec03e2dea26ef45e8
2018-08-24 14:32:07 -07:00
Eli White d2c27f5bff Remove view configs from JS
Summary: Apparently different apps have different implementations of view managers that support different props. This is a problem that we will need to address. Unfortunately, this means we can't have a static config defined in JS. We will need to find another approach to this problem.

Reviewed By: sahrens

Differential Revision: D9500178

fbshipit-source-id: b591559164fcf29f5fd43e13a0f2da15011491c6
2018-08-24 14:04:09 -07:00
Eli White 035597566f Explain why and how to keep JS<->Naitve view configs in sync
Reviewed By: sahrens

Differential Revision: D9485764

fbshipit-source-id: 673748b0ded666b8d17ed221e1208cffefb6c859
2018-08-24 14:04:09 -07:00
Mehdi Mulani 64a52532fe Text: send metrics after rendering (iOS)
Summary: This adds a callback for <Text> to get metrics about the rendered text. It's divided by line but that could be changed to "fragments" (which makes more sense for multi-lingual). Right now by line is convenient as you frequently want to know where the first and last line end (though we could make this work with fragments I suppose).

Reviewed By: shergin

Differential Revision: D9440914

fbshipit-source-id: bb011bb7a52438380d3f604ffe7019b98c18d978
2018-08-24 13:33:08 -07:00
Tim Yung 47dc31d464 RN: Nullable Image, Text, & View Props
Summary:
Changes the Flow prop types for `Image`, `Text`, and `View` to be nullable and optional.

This makes these components easier to compose.

Reviewed By: sahrens

Differential Revision: D9494285

fbshipit-source-id: c3f17147f063b31217b239a3abc085d1850f8df9
2018-08-24 10:48:08 -07:00
Eli White a700044e2e Move Android's Image ViewConfig to JS
Reviewed By: sahrens

Differential Revision: D9492683

fbshipit-source-id: 035aa00650ee4908452fe18384d953882bc2a8d8
2018-08-23 21:48:04 -07:00
Eli White daec505144 Put RCTTextInlineImage ViewConfig in JS
Summary: Moving this config to native for android so we skip the native lookup for the config.

Reviewed By: yungsters

Differential Revision: D9485645

fbshipit-source-id: cc0a6e9f12dad0c08aac32ca210373c388d307d6
2018-08-23 21:48:04 -07:00
Simon Jensen 966bb63a80 make Object.assign polyfill conditional and spec compliant
Summary: Replace the non-compliant `Object.assign` with a spec compliant version from Mozilla. Since its spec compliant we can apply conditionally only when a native version is not available.

Reviewed By: yungsters

Differential Revision: D8896359

fbshipit-source-id: 4999fe3094eba2206293bbe28760a4e46cbee6aa
2018-08-23 14:02:10 -07:00
Eli White 1329d18c6a Require that JS defined Component Attributes match Native ones in dev
Summary: As we move these configs to JS from native, until we have codegen that ensures everything stays up to date, this adds a dev mode check to ensure they are consistent.

Reviewed By: yungsters

Differential Revision: D9475011

fbshipit-source-id: 9d6f7b6c649229cae569d840eda3d5f7b7aa7cb2
2018-08-23 13:01:41 -07:00
Eli White 97472892d7 Back out "[react-native][PR] Make Flow and PropType types checks consistent for view style props."
Summary: Reverting due to problems with prepack.

Reviewed By: gaearon

Differential Revision: D9482931

fbshipit-source-id: 0ec5d0fb80dab32a07521a465dd2a501e6bb4d30
2018-08-23 11:34:26 -07:00
Tim Yung 055c941c40 A11Y: Leverage New `AccessibilityProps` Props
Summary: Adds new accessibility props more widely.

Reviewed By: TheSavior

Differential Revision: D9466018

fbshipit-source-id: 63ce58f725c7fd924d979d821037011d83c0334e
2018-08-23 00:18:47 -07:00
Eli White b620ccab49 Deprecate View prop-type definitions
Summary: This diff moves the prop-type definitions for View out into it's own file. We will be able to do this with a bunch of the prop-type definitions and then move them out into a deprecated npm package.

Reviewed By: yungsters

Differential Revision: D9444394

fbshipit-source-id: 4fd0a78533211b598ba2da4eb5015ffcc20bb675
2018-08-22 18:31:36 -07:00
Tim Yung 3aea678c38 RN: Reduce ForwardRef(View) Noise in Systrace
Summary: When running a trace, reduce the noise from the `__DEV__`-only `ForwardRef(View)` elements.

Reviewed By: ejanzer

Differential Revision: D9445865

fbshipit-source-id: 7cfe87bab6dd62d3800d2ca239724b5063c55c89
2018-08-22 17:49:32 -07:00
Janic Duplessis 123dac252a Allow animating the elevation style (#20739)
Summary:
Elevation should be supported by the native driver as it's a non-layout prop.
Pull Request resolved: https://github.com/facebook/react-native/pull/20739

Differential Revision: D9468318

Pulled By: hramos

fbshipit-source-id: f8b8ca7536968ab8f6229c134fd169c321ccc651
2018-08-22 13:48:53 -07:00
Eli White f5be89b8b9 Require all Android View Attributes are defined in flow prop types
Summary: This caught a few flow types that weren't defined for attributes that Android exposes. Ensuring that these stay in sync will be necessary for codegen in the future.

Reviewed By: sahrens

Differential Revision: D9444165

fbshipit-source-id: 8ee00af7b732c35d7f6befcdf79f77b73eac6a1b
2018-08-22 13:03:15 -07:00
Eli White 158e9c4dde Adding a more complete type for ReactNativeBaseComponentViewConfig
Summary:
As we add js view configs to our view managers, we want this type to be a little bit more strict.

This will be especially useful as we start removing certain keys (like NativeProps) which aren't actually necessary, this will make sure we remove them everywhere.

Reviewed By: yungsters

Differential Revision: D9416905

fbshipit-source-id: 6b12e38b9d56969a81ec5d4f2920298e4919f7be
2018-08-22 13:03:15 -07:00
Eli White d0eb8ff858 Put View ViewConfig in JS
Summary: Moving this config to native for android so we skip the native lookup for the config.

Reviewed By: yungsters

Differential Revision: D9415726

fbshipit-source-id: 84cac3f0dfa4f6ea8800de77676f1e2896ee463d
2018-08-22 13:03:15 -07:00
Alexander Perepelitsyn 2b6599e9c8 Make Flow and PropType types checks consistent for view style props. (#20773)
Summary:
Description:
------------
While creating a custom component I added a prop `style: ?ViewStyleProp`. When I tried to pass the following object
```
style={{
  opacity: new Animated.Value(0),
}}
```
to this `style` prop I received a yellow box with the warning:
```
Warning: Failed prop type: Invalid prop `opacity` of type `object` supplied to `MyComponent`, expected `number`.
```

Then I browsed through the source code and found an inconsistency in types checks. Namely,
https://github.com/facebook/react-native/blob/master/Libraries/StyleSheet/StyleSheetTypes.js#L158 has the following declaration `opacity?: number | AnimatedNode`, whereas https://github.com/facebook/react-native/blob/master/Libraries/Components/View/ViewStylePropTypes.js#L50 is willing to accept **only** a `number`: `opacity: ReactPropTypes.number`.
Pull Request resolved: https://github.com/facebook/react-native/pull/20773

Differential Revision: D9464634

Pulled By: TheSavior

fbshipit-source-id: fa21f706cb890dbeec136f1c4fab468904cd284b
2018-08-22 12:31:20 -07:00
EUROPE\laprosek 1658a4c080 Implement Image.queryCache on iOS (#18782)
Summary:
The API was available only on Android (with no mention to that effect in the docs, AFAICT).
This commit adds a simple iOS implementation based on NSURLCache. It should be possible to
query the decoded image cache as well to provide higher fidelity (i.e. "disk", "memory",
"decoded") if the caller passes size, scale, etc. in addition to the image URL, but it's
probably not worth the complexity. The assumption is that callers are interested in the
durability rather than performance aspect of the returned information.

Tested with RNTester on iPhone emulator.

[IOS] [ENHANCEMENT] [Image] - Implemented queryCache
Pull Request resolved: https://github.com/facebook/react-native/pull/18782

Differential Revision: D9411533

Pulled By: hramos

fbshipit-source-id: b430263959bb5f9b8ed9e28bb0a95f8879df881a
2018-08-20 16:17:18 -07:00
janczer 24c0dc3013 Add to PixelRation documentation information about iPhone SE and iPho… (#20695)
Summary:
Release Notes:
--------------

[DOCS] [BUGFIX][PixelRatio.js] - Add information about iPhone SE and iPhone X
Pull Request resolved: https://github.com/facebook/react-native/pull/20695

Differential Revision: D9408433

Pulled By: hramos

fbshipit-source-id: 917390e30801ce353fd999b375c788bd38568a05
2018-08-20 14:48:40 -07:00
Tim Yung 322d0e00e2 Animated: Create Components Lazily
Summary: Changes `Animated` so that the convenience components are lazily initialized.

Reviewed By: TheSavior

Differential Revision: D9394785

fbshipit-source-id: 1a2c9a9af500c02d6c91ccb5ddff341c94b17bd1
2018-08-20 14:17:02 -07:00
Panagiotis Vekris d4870babe6 v0.79.1 in xplat/js
Summary: The controller you requested could not be found.

Reviewed By: gabelevi

Differential Revision: D9390604

fbshipit-source-id: 68ba89ba197f74322e4c85c3bfc1f334fb740852
2018-08-18 22:19:34 -07:00
Chun Chen b9c28c236b Expose scrollEnabled as iOS prop for TextInput (#20719)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/20719

Expose scrollEnabled as iOS prop for TextInput

Reviewed By: mmmulani

Differential Revision: D9383477

fbshipit-source-id: 7e803767f6b2fafceac932fecd9dd59dc6ab5295
2018-08-17 19:02:16 -07:00
Kevin Gozali b4f02262c8 ios: allow using RCTBridgeDelegate in test runs
Summary: This allows callers of RCTTestRunner to provide custom bridge delegate for custom test run handling.

Reviewed By: jdthomas

Differential Revision: D9373947

fbshipit-source-id: fcc9080bd6962d6a0497aee85e900853c4727c6d
2018-08-17 13:16:53 -07:00
Ramanpreet Nara b18fddadfe Warn when 'scalesPageToFit' prop is used
Summary:
@public

The `WKWebView` class doesn't expose a `scalesPageToFit` property, unlike `UIWebView`. Therefore, the `scalesPageToFit` RN prop is be a bit tricky to implement with `WKWebView`.

For the time being, this diff adds warnings to `<WebView/>` whenever `useWebKit={true}` and `scalesPageToFit` is set. I've also updated the documentation to reflect that we don't support `scalesPageToFit` prop with the new implementation of `<WebView/>`.

Reviewed By: shergin

Differential Revision: D6429271

fbshipit-source-id: adf858cb67ba221c70d6d6f1bd6cff505e90c365
2018-08-16 16:52:44 -07:00
Ramanpreet Nara 95801f1eda Move WKWebView into WebView.ios.js
Summary:
@public

This diff adds the `useWebKit` property to the `<WebView/>` React Native component. On iOS, when this property is true, we use `RCTWKWebView`. Otherwise, we use `RCTWebView`. On Android, this property does nothing.

Reviewed By: shergin

Differential Revision: D6423374

fbshipit-source-id: 006bfaaf12984fac0174c0b5bb897c009c026cd0
2018-08-16 16:52:44 -07:00
Ramanpreet Nara 1af17f1648 Implement 'dataDetectorTypes' prop
Summary:
When text is rendered in `WKWebView` WebKit component, the component itself can detect things like phone numbers, flight numbers, links, etc. and render them with additional functionality.

For example, when the text `apple.com` is detected, if the `link` data detector type is enabled, the web view will actually render a link that takes the user to the Apple home page.

In this diff, I implement the `dataDetectorTypes` prop. The data detector types supported are:
1. phoneNumber
1. link
1. address
1. calendarEvent
1. trackingNumber
1. flightNumber
1. lookupSuggestion

These enums are documented in the [[ https://developer.apple.com/documentation/webkit/wkdatadetectortypes | WKDataDetectorTypes docs ]].

Reviewed By: shergin

Differential Revision: D6392546

fbshipit-source-id: 4dd373f0ac52f898163cd959eeef6672e55b42a6
2018-08-16 16:52:44 -07:00
Ramanpreet Nara 721763020a Implement 'mediaPlaybackRequiresUserAction' prop
Summary:
HTML video elements can have the `autoplay` attribute, which forces them to play automatically whenever they load on the page.

In this diff, I introduce a new prop `mediaPlaybackRequiresUserAction`, which allows us to control whether video or audio element autoplays even when `autoplay` is set.

Reviewed By: shergin

Differential Revision: D6382256

fbshipit-source-id: 617508653910d600bc43f7f68c6dfd17ab1b6dd8
2018-08-16 16:52:44 -07:00
Ramanpreet Nara 4ca949b46e Implement 'allowsInlineMediaPlayback` prop
Summary:
For iPhones with small screen sizes (e.g: iPhone 5s), inside the `<WKWebView/>` component, videos will play in fullscreen mode. In this diff, I introduce a prop called `allowsInlineMediaPlayback` that when set to true, will allow videos to play inline.

**Note:** For videos to play inline, the HTML video element must also have a `playsinline` attribute on it.

Reviewed By: shergin

Differential Revision: D6379770

fbshipit-source-id: a0130720ffede6c24a90cad0c97a75b657d77017
2018-08-16 16:52:44 -07:00
Ramanpreet Nara 1442c265da Implement WKWebView to replace WebView
Summary:
@public

`UIWebView` has been deprecated and replaced by `WKWebView`. This diff introduces a new component `WKWebView` that simply renders a `WKWebView` on iOS.

This is the first in the stack of many diffs that'll be required to fully replace `UIWebView` with `WKWebView` in the `<WebView/>` React Native component. Eventually, I hope to introduce a prop called `useWebKitImplementation`, which, when true, will force RN to use `WKWebView` instead of `UIWebView` for the `<WebView/>` component.

The only thing that's been implemented so far is the `source` property.

Reviewed By: mmmulani

Differential Revision: D6266100

fbshipit-source-id: 65862e34bd98db7fff0349cf26888afee43a56e4
2018-08-16 16:52:43 -07:00
Eli White 76948ad1bd Typing View style as ViewStyleProp
Summary: Locking down view style so that invalid styles can't be passed into View.

Reviewed By: yungsters

Differential Revision: D9309097

fbshipit-source-id: 69e7e3c5626609cfd47c167027a55470c42228c8
2018-08-14 16:32:11 -07:00
Stephen Cook 22cf5dc566 Android textTransform style support (#20572)
Summary:
Issue https://github.com/facebook/react-native/issues/2088 (closed, but a bit pre-emptively imo, since Android support was skipped)

Related (merged) iOS PR https://github.com/facebook/react-native/pull/18387

Related documentation PR https://github.com/facebook/react-native-website/pull/500

The basic desire is to have a declarative mechanism to transform text content to uppercase or lowercase or titlecase ("capitalized").
Pull Request resolved: https://github.com/facebook/react-native/pull/20572

Differential Revision: D9311716

Pulled By: hramos

fbshipit-source-id: dfbb855117196958e7ae5e980700d31be07a448d
2018-08-13 21:31:57 -07:00
Tim Yung f805d35154 RN: Fix Touchable Debug View
Summary: Fixes the `Touchable` debug view. The `child.type` is no longer a subclass of `React.Component` and no longer has `displayName`. It should be fine to have a hard dependency on `Text` and `View`, because... what app does not use them?

Reviewed By: TheSavior

Differential Revision: D9232036

fbshipit-source-id: 06f4091bf8e21cada3af50def2fdd41a6ad84f79
2018-08-13 12:01:57 -07:00
Tim Yung c1ecd8aefc RN: Polyfill `String#padEnd` and `String#padStart`
Summary: Adds polyfills for `String.prototype.padEnd` and `String.prototype.padStart`.

Reviewed By: mjesun

Differential Revision: D9233437

fbshipit-source-id: 3430450f28b4cec8f1c74af5f169e9bdef044ae8
2018-08-13 12:01:57 -07:00
Jordan Brown f125815efc Add flow suppressions to xplat android
Summary:
.android.js files may be checked (when the next version of flow is released) by using `flow start --flowconfig-name .flowconfig.android` and `flow status --flowconfig-name .flowconfig.android`

This diff adds suppressions to the errors that are in .android.js files, which flow does not check right now.

When site is `react_native_fb` or `react_native_android_fb`, error will be suppressed when checking with .flowconfig.android
When site is `react_native_fb` or `react_native_ios_fb`, error will be suppressed when checking with .flowconfig.

You can use `react_native_fb` when it should be suppressed for both.

The controller you requested could not be found.

Reviewed By: TheSavior

Differential Revision: D9122178

fbshipit-source-id: 0ec9d3cae3d887f58645e6585b2a3f6c3889b13e
2018-08-13 11:16:41 -07:00
Krzysztof Magiera c5cbd0f64a Fix native animated style and transform node to call __makeNative once all the children are converted to native nodes (#20658)
Summary:
This PR fixes an issue I have found while playing with native animated driver nodes.

I discovered the bug when using animated views that have both animated props and styles. See this snack to see an example: https://snack.expo.io/B17SFXy8Q

In that example we set `opacity` and `style` props which both contain animated props. This is not an usual way to do that, as normally you would place `opacity` inside the `styles` in which case the bug won't surface. But this is only done for demo purposes and in practice the problem will occur if you have a custom native view that exposes props that are not styles and can be animated.

In the above example you get this error:

> Invariant Violation: Attempt to get native tag from node not marked as "native"

When `opacity` is moved into `styles` container the problem no longer occurs.

The problem turned out to be related to the initialization code responsible for creating native animated nodes. In all subclasses of `AnimatedWithChildren` (like `AimatedAddition`) we only call `super.__makeNative` after we call `__makeNative` method on the child nodes. This order was reversed in `AnimatedStyle` and `AnimatedTransform`. As a result when `super.__makeNative` is called in `AnimatedStyle`, we try to call `__getNativeTag` on children nodes not yet marked as native which results in the error described above ("Attempt to get native tag...").

We should instead follow the order of calling `super.__makeNative` that is used in the remaining subclasses of `AnimatedWithChildren`. Such that all the children nodes are first converted to native prior to calling superclass method. This is what this PR is changing.
Pull Request resolved: https://github.com/facebook/react-native/pull/20658

Differential Revision: D9297191

Pulled By: hramos

fbshipit-source-id: f5e394fb259ff514c7c1433edcb5fc89203f55e2
2018-08-13 10:18:18 -07:00
Ramanpreet Nara a5ce1ad767 Ensure WebViews render about:blank correctly
Summary:
@public

This diff fixes two bugs:
1. When you load a `<WebView/>` with an HTML source string, HTML source doesn't render in the `<WebView/>`. Instead, we get this warning: https://pxl.cl/grz3. Here's what the above page should look like when correctly rendered: https://pxl.cl/grzt

2. Furthermore, you render a blank `<WebView/>` (i.e: with no source prop), it should display a blank page. Instead, we get this warning: https://pxl.cl/grz3

**Bugfix:**
One solution I found was to ensure that `about:blank` is always whitelisted. That way, we don't ever abort navigations to blank pages, which occur when we do:

```ObjectiveC
/** Line 134 in RCTWebView.m */
[_webView loadHTMLString:@"" baseURL:nil];
```

and

```ObjectiveC
/** Line 115 in RCTWebView.m */
if (html) {
  NSURL *baseURL = [RCTConvert NSURL:source[@"baseUrl"]];
  if (!baseURL) {
    baseURL = [NSURL URLWithString:@"about:blank"];
  }
  [_webView loadHTMLString:html baseURL:baseURL];
  return;
}
```

Reviewed By: yungsters, mmmulani

Differential Revision: D9259852

fbshipit-source-id: e1b9673fcd8c3d0df77308df8c4a632a2b596bfb
2018-08-13 10:18:17 -07:00
Freddy Harris 16b3783b9d Fix bug rows doesn't close on scroll in a SwipeableFlatList (#18001)
Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

Fix bug `SwipeableRow`s doesn't close on Scroll in a `SwipeableFlatList`

Use a SwipeableFlatList with multiple rows, open one of them, then scroll.
Open row should close on scroll.

[GENERAL] [BUGFIX] [SwipeableFlatList] - Fix rows doesn't close on scroll

<!--
Help reviewers and the release process by writing your own release notes

**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

  CATEGORY
[----------]        TYPE
[ CLI      ]   [-------------]      LOCATION
[ DOCS     ]   [ BREAKING    ]   [-------------]
[ GENERAL  ]   [ BUGFIX      ]   [-{Component}-]
[ INTERNAL ]   [ ENHANCEMENT ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - MESSAGE

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Pull Request resolved: https://github.com/facebook/react-native/pull/18001

Reviewed By: TheSavior

Differential Revision: D9192387

Pulled By: tomasreimers

fbshipit-source-id: f43e9614f9def5f3112327163c2b15fb45d84fb2
2018-08-10 14:02:10 -07:00
Kevin Gozali 29245e96cb iOS: prevent nativemodule access from JS if bridge is no longer valid
Summary: This helps prevent race condition where JS calls to NativeModules got queued and executed while the bridge is invalidating itself, causing assertion failures in test setup (for example). It won't prevent it 100% of the time, due to threading (and adding lock is expensive for each nativemodule call).

Reviewed By: yungsters

Differential Revision: D9231636

fbshipit-source-id: 298eaf52ffa4b84108184124e75b206b9ca7a41d
2018-08-09 12:17:07 -07:00
Joshua Alvarado 8ee9002c76 Add flow strict typing to isEmpty
Summary: Add flow strict typing to the isEmpty lib

Reviewed By: wcheng86

Differential Revision: D9200520

fbshipit-source-id: ac5717216199166e7485abcdfcba03ab2bbe90d2
2018-08-09 10:47:58 -07:00
Wayne Cheng f536a0c268 Adding flow strict local to remaining possible files in xplat/JS
Summary:
ag -L --ignore __snapshots__ 'flow strict|noflow|generated|The controller you requested could not be found.' | ag '\.js$' | xargs ag -l 'flow' | sort > ~/temp
  cat ~/temp | xargs ag -L 'flow strict' | xargs sed -i '' 's/flow$/flow strict-local/'
  until flow check; do flow check --json | jq -r '.errors[].message[0].path' | sort | uniq | xargs hg revert; done

allow_many_files
The controller you requested could not be found.
The controller you requested could not be found.

Reviewed By: TheSavior

Differential Revision: D9004573

fbshipit-source-id: 936bd5741706b781be06bf08b6ad805a69407dfd
2018-08-09 08:54:44 -07:00
Eli White 370e0db970 Move View native require call to new file
Summary: Moving out the requireNativeComponent call into a new file. We want this long term for all of our view managers to support codegen of the native side and so we can move the viewConfigs into JS.

Reviewed By: yungsters

Differential Revision: D9231619

fbshipit-source-id: 7c89587cc6a76e92b309c4941577291e56af8c7c
2018-08-08 18:46:53 -07:00
Johannes Baldursson 610412385b Exposed scrollEnabled on TextInput (#19330)
Summary:
On iOS, it is not possible to select a range of text using a `Text` component (see #13938). Because of how the `Text` component is implemented on iOS, this will not work without a complete re-write. On Android however, this is not an issue.

As the `TextInput` component has evolved, it can more or less be used as a drop-in replacement on iOS by setting `multiline={true}` and `editable={false}`. Except for one detail: the text input field has scrolling activated and it's not possible to turn off. (See #1391 and #15962).

This pull request addresses that issue, simply by exposing the `scrollEnabled` property:

```
<TextInput
    multiline
    editable={false}
    scrollEnabled={false}
  />
```

1. Create a multiline `TextInput` component, with the attributes presented above.
2. Run on iOS
3. The `TextInput` field should not be able to scroll

facebook/react-native-website#367

[IOS] [FEATURE] [TextInput] - Made it possible to turn off scrolling on a multiline TextInput component
Pull Request resolved: https://github.com/facebook/react-native/pull/19330

Differential Revision: D9235061

Pulled By: hramos

fbshipit-source-id: 99d278004fc236b47dde7e61d74c71e8a3b9d170
2018-08-08 18:46:53 -07:00
Steven Cable b21d4914de Check return code from malloc (#20173)
Summary:
Calls abort() in cases where malloc returns NULL.

Checking the return value from malloc is good practice and is
required to pass a [Veracode security scan](https://www.veracode.com/). This will let
developers who are required to submit their software to Veracode
use React Native.
Pull Request resolved: https://github.com/facebook/react-native/pull/20173

Differential Revision: D9235096

Pulled By: hramos

fbshipit-source-id: 9fdc97f9e84f8d4d91ae59242093907f7a81d286
2018-08-08 18:32:19 -07:00
Eli White 457a74cbc2 Move Switch native require call to new file
Summary: Moving out the requireNativeComponent call into a new file. We want this long term for all of our view managers to support codegen of the native side and so we can move the viewConfigs into JS.

Reviewed By: yungsters

Differential Revision: D9191214

fbshipit-source-id: d0bddbb50bb1cf6b5a727d72faf834b007ad9440
2018-08-08 15:03:01 -07:00
Jordan Brown b64b9dbece Replace '@flow strict(-local)' with '@flow' in .android.js files
Summary:
Flow doesn't check .android.js files yet anyway.

I'm going to be adding suppressions in a followup diff. It would be nice to not have >1k suppressions saying that we can't do certain things in `flow strict` when we don't even typecheck with regular `flow` just yet

I ran these commands to produce this diff:
`find . -name '*.android.js' -exec sed -i 's/flow strict-local/flow/g' {} +`
`find . -name '*.android.js' -exec sed -i 's/flow strict/flow/g' {} +`

Followed https://unix.stackexchange.com/questions/112023/how-can-i-replace-a-string-in-a-files to do it.

The controller you requested could not be found.

Reviewed By: TheSavior

Differential Revision: D9143783

fbshipit-source-id: e9af4fe695ebdba4db4083de1697cc248d48eb0d
2018-08-08 10:48:19 -07:00
Ziqi Chen 91b3a3055a changed documentation for accessibilityHint
Summary:
Changed documentation for accessibility Hint so that its no longer only available on iOS

Also added full description of documentation for accessibility Role as it was missing earlier

Reviewed By: PeteTheHeat

Differential Revision: D9072572

fbshipit-source-id: c8d20f30df588717d9ec37721c2aa3c86a0664c6
2018-08-08 01:31:46 -07:00
Kevin Gozali 235d9017cf added small UI indicator for fabric-based surfaces
Summary: To make debugging/testing easier, optionally display fabric label on the top-right of the surface if it's rendered on fabric mode.

Reviewed By: mdvacca

Differential Revision: D9206473

fbshipit-source-id: ef6f0396ff749f2a0415688b1cf4fe1a4b83124d
2018-08-07 21:35:54 -07:00
Joshua Wang c298e0ae06 Update template to Xcode 9.4 and fix project settings warnings (#19626)
Summary:
Motivation: Fix Xcode Project Settings Warnings
![screenshot 2018-06-08 10 58 23](https://user-images.githubusercontent.com/5353594/41173274-1a4fbb3e-6b0b-11e8-973b-8290794a4f8b.png)

Should still build and pass all tests since project settings changes should be safe changes.

No documentation change is required

[IOS][MINOR][XcodeProjs] Upgraded Project settings to be compatible with Xcode 9.4
Pull Request resolved: https://github.com/facebook/react-native/pull/19626

Differential Revision: D9211230

Pulled By: hramos

fbshipit-source-id: ef8692871bffbdb5dd0214f65220fd171c203c6c
2018-08-07 19:46:23 -07:00
Janic Duplessis 476a831ea0 Un-deprecate TextInput.State.focusTextInput and TextInput.State.blurTextInput (#20326)
Summary:
In https://github.com/facebook/react-native/pull/18936 we decided to deprecate `focusTextInput` and `blurTextInput` but since then I found a valid use case for it that is pretty much impossible to implement otherwise.

React Navigation uses it to blur / re-focus the input during the swipe back gesture. Blur can be done with Keyboard.dismiss but without this api we cannot re-focus the text field that was focused if the swipe back gesture is cancelled. See https://github.com/react-navigation/react-navigation/blob/master/src/navigators/createKeyboardAwareNavigator.js#L21-L34

I think it is best to just bring back this api.
Pull Request resolved: https://github.com/facebook/react-native/pull/20326

Differential Revision: D9182810

Pulled By: hramos

fbshipit-source-id: 3740421ffafb8f814522d15788f3466324177c16
2018-08-06 15:01:50 -07:00
Trish Saylor f17047e230 Add flow strict-local annotation to the dismissKeyboard module
Summary: The `dismissKeyboard` module is widely used but did not have flow typing on it, preventing other js modules that use it from annotating themselves as flow strict-local. This diff adds a flow annotation to the `dismissKeyboard` module of the strictest type supported for this module, which is flow strict-local.

Reviewed By: gkz

Differential Revision: D9143671

fbshipit-source-id: af2367e6c59276402dcbcb9cf0f64b44ff42f531
2018-08-03 11:47:19 -07:00
Kevin Gozali ee42606a0b ios: disable assertion for bridge deallocation during SST/redbox test
Summary: There's still a mysterious issue where the bridge wasn't deallocated properly, but there's already a test for it separately. Let's disable the assertion for SST/redbox.

Reviewed By: PeteTheHeat

Differential Revision: D9138634

fbshipit-source-id: 9cfa0f970e079774428caccaede1150292cccba6
2018-08-03 09:01:38 -07:00
Oleksandr Sokolov 3f89dd2db6 Setup /RKJSModules/Marketplace directory structure + extracting MarketplaceRelayQueryConstants and dependencies
Reviewed By: fkgozali

Differential Revision: D9110647

fbshipit-source-id: e04d523a2dc26f923f083533b9aeabc12d18f23d
2018-08-02 08:32:34 -07:00
Tim Yung 0bfbf307c8 RN: Fix `testID` on Switch
Summary: My recent refactor of `Switch` broke `testID` from being passed down to the underlying component. This fixes that.

Reviewed By: TheSavior

Differential Revision: D9127216

fbshipit-source-id: 6d442b1cc19cf9f44cb48faac58e5abe9f36064b
2018-08-01 19:16:20 -07:00
Valentin Shergin 9042438975 Fabric: `bridge` prop was removed from RCTSurface interface
Summary:
@public
We are moving away from using `RCTBridge` instance in public APIs to enable us using more performance solutions in the future.
This change also fixes "SwipeBack issue" caused by RCTSurfaceHostingProxyRootView returning nil bridge.

Reviewed By: mdvacca

Differential Revision: D9094625

fbshipit-source-id: 6bde3c54773e75ca4c0b6fd908da9d7235b5c3be
2018-08-01 15:32:01 -07:00
Tim Yung 9a4fd6b78d Switch: Warn for Deprecated Color Props
Summary:
Introduces warnings to `Switch` when the deprecated props are being used.

See D9081343 for more details on the specific prop changes.

Reviewed By: blairvanderhoof

Differential Revision: D9081451

fbshipit-source-id: 7f997fc97d316038f0917d2540b982bd9cf34d03
2018-07-31 21:01:41 -07:00
Tim Yung 965adee109 RN: Revamp Switch Component
Summary:
Revamps the Switch API with the goal of increasing the pit of success:

- Introduce `trackColor` which encourages callers configuring the color to set colors for both cases.
- Introduce `ios_backgroundColor` which allows customizing the iOS-only background fill color.
- Deprecate `tintColor` because it is not obvious that this is for the `false` case.
- Deprecate `onTintColor` because the prop is named unconventionally like a callback.
- Renamed `thumbTintColor` to `thumbColor`.

This revision also cleans up the `Switch` component in the following ways:

- More precise Flow types for native components.
- Inline iOS-specific style (so that the code gets stripped on Android).
- Minor documentaiton cleanup.

After this commit, all deprecated props will continue working.

Next, I plan to introduce warnings.

Eventually (e.g. in a couple releases), we can drop support for the deprecated props.

Reviewed By: TheSavior

Differential Revision: D9081343

fbshipit-source-id: c5eb949047dd7a0ffa72621839999d38e58cada8
2018-07-31 21:01:41 -07:00
Himabindu Gadupudi 9f8b5a9ed5 If source is null , source uri is null or source is not an array should respect style
Summary: If source is null , source uri is null or source is not an array should respect style like in iOS

Reviewed By: yungsters

Differential Revision: D9018005

fbshipit-source-id: 5f695e8e3007c96e6004973e7fcbc6b57cc15249
2018-07-31 12:02:10 -07:00
Mehdi Mulani affb135d62 Revert D8978844: [react-native][PR] Performance improvement for loading cached images on iOS
Differential Revision:
D8978844

Original commit changeset: 4b86043bc14c

fbshipit-source-id: fdf3ddd111c8c0dec6ddf2814a4e1e0ff58ef529
2018-07-30 14:46:30 -07:00
Eric Samelson 2ca7701aae 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: shergin

Differential Revision: D8978844

Pulled By: hramos

fbshipit-source-id: 4b86043bc14c40007b0596c9f8a213455b697686
2018-07-30 14:17:13 -07:00
Abhinandan 82af7c989b Fix for crash when height or width is nil (#20454)
Summary:
This PR fixes the issue of height/width being nil in line no 128 of RCTImagePickerManager.m .
`    [self _dismissPicker:picker args:tempImageTag ? @[tempImageTag, height, width] : nil];
`
Fixes#20411

Test Plan
----------
To verify the fix , please make the changes to make either height, width or both `nil `
 in `- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary<NSString *, id> *)info` function of RCTImagePickerManager.m , run the code , you will see the error saying , one of the argument is nil from the array .

![crashscenario](https://user-images.githubusercontent.com/763696/43397014-133ae8fc-9421-11e8-9730-c5906cb8dbea.png)

![crashhandledscenario](https://user-images.githubusercontent.com/763696/43397012-130e42f2-9421-11e8-80fc-cb1abaf8197c.png)

Now run the code with the fix , it will not crash .

Release Notes:
--------------
[IOS][BUGFIX][RCTImagePickerManager] - Change in RCTImagePickerManager to handle crashes if height/width is nil .
Pull Request resolved: https://github.com/facebook/react-native/pull/20454

Differential Revision: D9061059

Pulled By: hramos

fbshipit-source-id: b17f58e411f97f9b904cca0de6c151312c732972
2018-07-30 11:17:08 -07:00
Mehdi Mulani 892212bad2 Fix controlled <TextInput> on iOS when inputting in Chinese/Japanese
Summary:
@public
This should fix #18403.
When the user is inputting in Chinese/Japanese with <TextInput> in a controlled manner, the RCTBaseTextInputView will compare the JS-generated attributed string against the TextInputView attributed string and repeatedly overwrite the TextInputView one. This is because the native TextInputView will provide extra styling to show that some text is provisional.
My solution is to do a plain text string comparison at this point, like how we do for dictation.

Expected behavior when typing in a language that has "multistage" text input: For instance, in Chinese/Japanese it's common to type out the pronunciation for a word and then choose the appropriate word from above the keyboard. In this model, the "pronunciation" shows up in the text box first and then is replaced with the chosen word.
Using the word Japan which is written 日本 but first typed as にほん. It takes 4 key-presses to get to 日本, since に, ほ, ん, are all typed and then 日本 is selected. So here is what should happen:

1. enter に, onChange fires with 'に', markedTextRange covers 'に'
2. enter ほ, onChange fires with 'にほ', markedTextRange covers 'にほ'
3. enter ん, onChange fires with 'にほん', markedTextRange covers 'にほん'
4. user selects 日本 from the menu above the keyboard (provided by the keyboard/OS), onChange fires with '日本', markedTextRange is removed

previously we were overwriting the attributed text which would remove the markedTextRange, preventing the user from selecting 日本 from above the keyboard.

Cheekily, I've also fixed an issue with secure text entry as it's the same type of problem.

Reviewed By: PeteTheHeat

Differential Revision: D9002295

fbshipit-source-id: 7304ede055f301dab9ce1ea70f65308f2a4b4a8f
2018-07-30 08:01:10 -07:00
Wayne Cheng 86f8e9e760 Adding flow strict to as many xplat files as possible
Summary:
ag -L --ignore __snapshots__ 'flow strict$|noflow|generated|The controller you requested could not be found.' | ag '\.js$' | xargs ag -l 'flow' | sort > ~/temp
  cat ~/temp | xargs ag -L 'flow strict' | xargs sed -i '' 's/flow$/flow strict/'
  cat ~/temp | xargs ag -L 'flow strict$' | xargs sed -i '' 's/flow strict-local$/flow strict/'
  until flow; do flow check --json | jq -r '.errors[].message[0].path' | sort | uniq | xargs hg revert; done

allow_many_files
The controller you requested could not be found.
The controller you requested could not be found.

Reviewed By: yungsters

Differential Revision: D9003523

fbshipit-source-id: d0c9fbfe3c32e65d57819fa040d06cd6ebbd59cc
2018-07-27 12:31:42 -07:00
Trish Saylor 78676915ad Create a reusable IG Switch component with UIDocs and snapshot test
Summary: Switch is a standard component and needs some extra styling of the colors to be used in IG, so I've created a reusable switch component for Instagram React Native and added server snapshot tests with UIDocs for it so it will appear in https://our.intern.facebook.com/intern/uidocs/?docset=rn_iig for more people to use.

Reviewed By: lostatseajoshua

Differential Revision: D9023261

fbshipit-source-id: dd460ca4506e2fc072ed03cca56b4a3c172123bd
2018-07-27 06:46:26 -07:00
Ziqi Chen 121e2e5ca6 accessibilityTraits + accessibilityComponentType >> accessibilityRole + accessibilityStates 2/3
Summary:
Previously, I created two props, `accessibilityRole` and `accessibilityStates` for view. These props were intended to be a cross-platform solution to replace  `accessibilityComponentType` on Android and `accessibilityTraits` on iOS.

In this stack, I ran a code mod to replace instances of the two old properties used in our codebase with the new ones.
For this diff, I did a search for all the remnant uses of `accessibilityComponentType` that was not caught by my script, and I manually changed them to `accessibilityRole` and `accessibilityStates`. If the same prop also set `accessibilityTraits` I also removed that here because the two new props works on both platforms.

It was difficult to write a script for this, because most of them were contextual changes.
Out of the contextual changes, most of them followed one of these two patterns:

Before:

```
const accessibilityComponentType = 'button';
const accessibilityTraits = ['button'];

if (this.props.checked) {
  accessibilityTraits.push('selected');
}
if (this.props.disabled) {
 accessibilityTraits.push('disabled');
}

      contentView = (
        <AdsManagerTouchableHighlight
          accessibilityComponentType={accessibilityComponentType}
          accessibilityTraits={accessibilityTraits}
```

After:
      const accessibilityRole = 'button';
      const accessibilityStates = [];

        if (this.props.checked) {
          accessibilityStates.push('selected');
        }
        if (this.props.disabled) {
           accessibilityStates.push('disabled');
        }

      contentView = (
        <AdsManagerTouchableHighlight
          accessibilityRole={accessibilityRole}
          accessibilityStates={accessibilityStates}

Before:

```
  <PressableBackground
          accessible={this.props.accessible}
          accessibilityLabel={this.props.accessibilityLabel}
          accessibilityTraits={this.props.accessibilityTraits}
```

After:

```
  <PressableBackground
          accessible={this.props.accessible}
          accessibilityLabel={this.props.accessibilityLabel}
          accessibilityRole={this.props.accessibilityRole}
          accessibilityRole={this.props.accessibilityStates}
```

In addition to changing the props on the components,
Another fix I had to do was to add props  accessibilityRole and accessibilityStates to components that don't directly inherit properties from view including text input and touchables.

Reviewed By: PeteTheHeat

Differential Revision: D8943499

fbshipit-source-id: fbb40a5e5f5d630b0fe56a009ff24635d4c8cc93
2018-07-25 23:48:26 -07:00
Ziqi Chen 50e400128e accessibilityTraits + accessibilityComponentType >> accessibilityRole + accessibilityStates 1/3
Summary:
Previously, I created two props, `accessibilityRole` and `accessibilityStates` for view. These props were intended to be a cross-platform solution to replace  `accessibilityComponentType` on Android and `accessibilityTraits` on iOS.

In this stack, I ran a code mod to replace instances of the two old properties used in our codebase with the new ones.
For this diff, I wrote a script that focuses on replacing instances of the two properties that only added a single role to `accessibilityTraits` and `accessibilityComponentType`. In summary, this script:
* replaces instances of `accessibilityTraits = "<iOStrait>"` with `accessibilityRole = "<iOStrait>"`
* replaces instances of `accessibilityTraits = {['<iOStrait>']}` with `accessibilityRole = "<iOStrait>"`
* replaces instances of `accessibilityTraits = {"<iOStrait>"}` with `accessibilityRole = "<iOStrait>"`
* removes instances of `accessibilityComponentType`

```

The following is the codeshift script I wrote:
/**
 * Copyright (c) 2015-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * format
 */

'use strict';

export default function transformer(file, api) {
  const j = api.jscodeshift;
  const root = j(file.source);

  let hasChanges = false;
  const elements = root.find(j.JSXElement);
  let values;
  let valuess;
  let valuesss;
  elements.forEach(path => {
    const openEl = path.node.openingElement;
    hasChanges = true;
    for (let i = 0; i < openEl.attributes.length; i++) {
		if (openEl.attributes[i].name.name === 'accessibilityComponentType') {
        	openEl.attributes.splice(i, 1);
        }
      if (openEl.attributes[i].name.name === 'accessibilityTraits') {
        if (openEl.attributes[i].value.expression) {
          if (openEl.attributes[i].value.expression.type === 'Literal') {
            values = openEl.attributes[i].value.expression.value;
            openEl.attributes[i] = j.jsxAttribute(
              j.jsxIdentifier('accessibilityRole'),
              j.literal(values),
            );
          }
        }

        if (openEl.attributes[i].value) {
          if (
            openEl.attributes[i].value &&
            openEl.attributes[i].value.type === 'Literal'
          ) {
            valuess = openEl.attributes[i].value.value;
            openEl.attributes[i] = j.jsxAttribute(
              j.jsxIdentifier('accessibilityRole'),
              j.literal(valuess),
            );
          }
        }

        if (openEl.attributes[i].value.expression) {
          if (
            openEl.attributes[i].value.expression.type === 'ArrayExpression' &&
            openEl.attributes[i].value.expression.elements.length === 1
          ) {
            valuesss = openEl.attributes[i].value.expression.elements[0].value;
            openEl.attributes[i] = j.jsxAttribute(
              j.jsxIdentifier('accessibilityRole'),
              j.literal(valuesss),
            );
          }
        }
      }
    }
  });
  if (hasChanges) {
    return root.toSource();
  } else {
    return null;
  }
}
```
I then used this command to run the codemod:

```
./scripts/js1/node_modules/.bin/jscodeshift -c 10 --parser=flow --transform ./scripts/js1/commands/codeshift/add-accessibilityRoles/index.js /data/sandcastle/boxes/instance-ide/xplat/js/RKJSModules/Apps
hg status -n | xargs /data/sandcastle/boxes/instance-ide/tools/third-party/prettier/node_modules/.bin/prettier --single-quote --no-bracket-spacing --jsx-bracket-same-line --trailing-comma all --parser flow --write --require-pragma --no-config
hg status -n | xargs ./scripts/eslint/eslint --plugin lint --no-eslintrc --parser babel-eslint --rule "lint/sort-requires: 1" --fix
js1 build buckfiles
```

Lastly, I had to add a few manual fixes:
* Checked that instances of `accessibilityComponentType` that were deleted were indeed replaced with `accessibilityRole`
* Added props  `accessibilityRole` and `accessibilityStates` to `TouchableWithoutFeedBack` components and `TextProps` because they don't inherit properties directly from view.

Reviewed By: PeteTheHeat

Differential Revision: D8937323

fbshipit-source-id: 85bf4d596e8e7c7ace75ab0b0e68599043760840
2018-07-25 23:48:26 -07:00
Mats Byrkeland 253b29dbd8 Add accessibilityHint for iOS (#18093)
Summary:
This adds the accessibilityHint for View, Text and Touchable* on iOS.
The accessibilityHint provides some more information about an element
when the accessibilityLabel is not enough.

The accessibilityHint is a core accessibility property on iOS.

From https://developer.apple.com/documentation/objectivec/nsobject/1615093-accessibilityhint:
> An accessibility hint helps users understand what will happen when they perform an action on the accessibility element when that result is not obvious from the accessibility label.

Related issue: https://github.com/facebook/react-native/issues/14706

The npm scripts `test`, `flow`, `lint` and `prettier` are satisfied.

I added a couple of examples to the RNTester app. The Accessibility Inspector on Mac helps debugging accessibility stuff on a simulator, but it does not show the accessibilityHint. Therefore I tested the RNTester app on an iPhone 8 device using VoiceOver to verify the hint functionality. It works fine, and I've tested disabling and enabling "read hints" in the VoiceOver settings on the phone.

https://github.com/facebook/react-native-website/pull/222

[IOS][FEATURE][Accessibility] - Add accessibilityHint for View, Text, Touchable* on iOS
Closes https://github.com/facebook/react-native/pull/18093

Reviewed By: hramos

Differential Revision: D7230780

Pulled By: ziqichen6

fbshipit-source-id: 172ad28dc9ae2b67ea256100f6acb939f2466d0b
2018-07-25 17:47:42 -07:00
Andrew Clark b7bb25fe4c React sync for revisions ca0941f...bc1ea9c
Summary:
@public
This sync includes the following changes:
- **[bc1ea9cd9](https://github.com/facebook/react/commit/bc1ea9cd9)**: Handle errors thrown in gDSFP of a module-style context provider (#13269) //<Andrew Clark>//
- **[0154a79fe](https://github.com/facebook/react/commit/0154a79fe)**: Remove 'warning' module from the JS scheduler (#13264) //<Flarnie Marchan>//
- **[dbd16c8a9](https://github.com/facebook/react/commit/dbd16c8a9)**: Add flow directive to findDOMNode shim (#13265) //<Brian Vaughn>//

Release Notes:
[GENERAL] [FEATURE] [React] - React sync for revisions ca0941f...bc1ea9c

Reviewed By: bvaughn

Differential Revision: D9005608

fbshipit-source-id: c293add468badc5323179fda9341912710d4e840
2018-07-25 16:17:51 -07:00
Ziqi Chen c36e8b3307 added accessibilityIgnoresInvertColors to module.exports in ViewPropTypes
Summary:
Previously, I exposed the "accessibilityIgnoresInvertColors" API on iOS to react native views.

In this diff, I added this property to the `module.exports` in `ViewPropTypes` so that the property can be accessed by other files.

Reviewed By: PeteTheHeat

Differential Revision: D8977515

fbshipit-source-id: d0aba5eac3bc1528e18b6027f3f055e5f4a1147a
2018-07-24 18:31:59 -07:00
Ziqi Chen b5b704dc19 added accessibilityStates and accessibilityRole to ReactNativeViewAttributes
Summary:
Previously, I added accessibilityRole and accessibilityStates as View Properties.

In this diff, I added accessibilityRole and accessibilityStates to ReactNativeViewAttributes.UIView, which is used for viewconfig in some components.

The NativeMethodsMixing uses the set view config when invoking `setNativeProps`, and it's used to make those components look like an actual native component class.

Reviewed By: PeteTheHeat

Differential Revision: D8976524

fbshipit-source-id: 16a5ba7d91ee9cfb6488c2d94f7f23b9093e5b81
2018-07-24 18:31:58 -07:00
Héctor Ramos 70913a4623 React sync for revisions ae14317...ca0941f
Summary:
@public
This sync includes the following changes:
- **[ca0941fce](https://github.com/facebook/react/commit/ca0941fce)**: Add regression test for Placeholder fallbacks with lifecycle methods (#13254) //<Andrew Clark>//
- **[a32c727f2](https://github.com/facebook/react/commit/a32c727f2)**: Optimize readContext for Subsequent Reads of All Bits (#13248) //<Sebastian Markbåge>//
- **[2b509e2c8](https://github.com/facebook/react/commit/2b509e2c8)**: [Experimental] API for reading context from within any render phase function (#13139) //<Andrew Clark>//
- **[5776fa3fc](https://github.com/facebook/react/commit/5776fa3fc)**: Update www warning shim (#13244) //<Dan Abramov>//
- **[3d3506d37](https://github.com/facebook/react/commit/3d3506d37)**: Include Modes in the component stack (#13240) //<Dan Abramov>//
- **[71b4e9990](https://github.com/facebook/react/commit/71b4e9990)**: [react-test-renderer] Jest matchers for async tests (#13236) //<Andrew Clark>//
- **[2c560cb99](https://github.com/facebook/react/commit/2c560cb99)**: Fix unwinding starting with a wrong Fiber on error in the complete phase (#13237) //<Dan Abramov>//
- **[ead08827d](https://github.com/facebook/react/commit/ead08827d)**: Add more flexibility in testing errors in begin/complete phases (#13235) //<Dan Abramov>//
- **[e4e58343e](https://github.com/facebook/react/commit/e4e58343e)**: Move unstable_yield to main export (#13232) //<Andrew Clark>//
- **[0e235bb8f](https://github.com/facebook/react/commit/0e235bb8f)**: Removed unused state argument in unsubscribe method of <Subscription /> (#13233) //<Mateusz Burzyński>//
- **[236f60872](https://github.com/facebook/react/commit/236f60872)**: Fail tests if toWarnDev() does not wrap warnings in array (#13227) //<Dan Abramov>//
- **[acbb4f93f](https://github.com/facebook/react/commit/acbb4f93f)**: Remove the use of proxies for synthetic events in DEV (#13225) //<Dan Abramov>//
- **[171e0b7d4](https://github.com/facebook/react/commit/171e0b7d4)**: Fix “no onChange handler” warning to fire on falsy values ("", 0, false) too (#12628) //<Nicole Levy>//
- **[606c30aa5](https://github.com/facebook/react/commit/606c30aa5)**: fixed a typo in commentout in ReactFiberUnwindWork.js (#13172) //<Fumiya Shibusawa>//
- **[9f78913b2](https://github.com/facebook/react/commit/9f78913b2)**: Update prettier (#13205) //<Johan Henriksson>//
- **[6d3e26288](https://github.com/facebook/react/commit/6d3e26288)**: Remove unnecessary `typeof` checks (#13196) //<jddxf>//
- **[82c7ca4cc](https://github.com/facebook/react/commit/82c7ca4cc)**: Add component stacks to some warnings (#13218) //<Dan Abramov>//
- **[21ac62c77](https://github.com/facebook/react/commit/21ac62c77)**: Fix a portal unmounting crash for renderers with distinct Instance and Container (#13220) //<Thibault Malbranche>//
- **[d6a0626b3](https://github.com/facebook/react/commit/d6a0626b3)**: Set current fiber during before-mutation traversal (#13219) //<Dan Abramov>//
- **[f9358c51c](https://github.com/facebook/react/commit/f9358c51c)**: Change warning() to automatically inject the stack, and add warningWithoutStack() as opt-out (#13161) //<Dan Abramov>//
- **[467d13910](https://github.com/facebook/react/commit/467d13910)**: Enforce presence or absence of component stack in tests (#13215) //<Dan Abramov>//
- **[43ffae2d1](https://github.com/facebook/react/commit/43ffae2d1)**: Suspending inside a constructor outside of strict mode (#13200) //<Andrew Clark>//
- **[659a29cec](https://github.com/facebook/react/commit/659a29cec)**: Reorganize how shared internals are accessed (#13201) //<Dan Abramov>//
- **[58f3b29d9](https://github.com/facebook/react/commit/58f3b29d9)**: Added SSR/hydration tests for modes, forwardRef, and Profiler (#13195) //<Brian Vaughn>//
- **[1c89cb62f](https://github.com/facebook/react/commit/1c89cb62f)**: Use ReactDebugCurrentFrame.getStackAddendum() in element validator (#13198) //<Dan Abramov>//
- **[e6076ecf4](https://github.com/facebook/react/commit/e6076ecf4)**: Remove ad-hoc forks of getComponentName() and fix it (#13197) //<Dan Abramov>//
- **[32f6f258b](https://github.com/facebook/react/commit/32f6f258b)**: Remove event simulation of onChange events (#13176) //<Philipp Spieß>//
- **[9ca37f843](https://github.com/facebook/react/commit/9ca37f843)**: docs: update comments (#13043) //<Sen Yang>//
- **[f89f25f47](https://github.com/facebook/react/commit/f89f25f47)**: Correct type of `ref` in forwardRef render() (#13100) //<Moti Zilberman>//
- **[7b99ceabe](https://github.com/facebook/react/commit/7b99ceabe)**: Deprecate test utils mock component follow up (#13194) //<Brian Vaughn>//
- **[6ebc8f3c0](https://github.com/facebook/react/commit/6ebc8f3c0)**: Add support for re-entrant SSR stacks (#13181) //<Dan Abramov>//
- **[d64d1ddb5](https://github.com/facebook/react/commit/d64d1ddb5)**: Deprecate ReactTestUtils.mockComponent() (#13193) //<Brian Vaughn>//
- **[e79366d54](https://github.com/facebook/react/commit/e79366d54)**: Link create-subscription doc to GH issue with de-opt explanation (#13187) //<Brian Vaughn>//
- **[1f32d3c6d](https://github.com/facebook/react/commit/1f32d3c6d)**: Test renderer flushAll method verifies an array of expected yields (#13174) //<Brian Vaughn>//
- **[377e1a049](https://github.com/facebook/react/commit/377e1a049)**: Add a test for SSR stack traces (#13180) //<Dan Abramov>//
- **[96d38d178](https://github.com/facebook/react/commit/96d38d178)**: Fix concatenation of null to a warning message (#13166) //<Dan Abramov>//
- **[095dd5049](https://github.com/facebook/react/commit/095dd5049)**: Add DEV warning if forwardRef function doesn't use the ref param (#13168) //<Brian Vaughn>//
- **[566259567](https://github.com/facebook/react/commit/566259567)**: Refactor stack handling (no functional changes) (#13165) //<Dan Abramov>//
- **[ebbd22143](https://github.com/facebook/react/commit/ebbd22143)**: Configure react-test-renderer as a secondary (#13164) //<Brandon Dail>//
- **[ddc91af79](https://github.com/facebook/react/commit/ddc91af79)**: Decrease nested update limit from 1000 to 50 (#13163) //<Andrew Clark>//
- **[3596e40b3](https://github.com/facebook/react/commit/3596e40b3)**: Fix nested update bug (#13160) //<Andrew Clark>//
- **[449f6ddd5](https://github.com/facebook/react/commit/449f6ddd5)**: create a new FeatureFlags file for test renderer on www (#13159) //<Chang Yan>//
- **[f762b3abb](https://github.com/facebook/react/commit/f762b3abb)**: Run react-dom SSR import test in jsdom-less environment (#13157) //<Dan Abramov>//
- **[6f6b560a6](https://github.com/facebook/react/commit/6f6b560a6)**: Renamed selfBaseTime/treeBaseTime Fiber attributes to selfBaseDuration/treeBaseDuration (#13156) //<Brian Vaughn>//
- **[1386ccddd](https://github.com/facebook/react/commit/1386ccddd)**: Fix ReferenceError when requestAnimationFrame isn't defined (#13152) //<Dan Abramov>//
- **[f5779bbc1](https://github.com/facebook/react/commit/f5779bbc1)**: Run server rendering test on bundles (#13153) //<Dan Abramov>//
- **[9faf389e7](https://github.com/facebook/react/commit/9faf389e7)**: Reset profiler timer correctly after errors (#13123) //<Brian Vaughn>//
- **[85fe4ddce](https://github.com/facebook/react/commit/85fe4ddce)**: Fix - issue #12765 / the checked attribute is not initially set on the input (#13114) //<XuMM_12>//
- **[07fefe333](https://github.com/facebook/react/commit/07fefe333)**: Drop handling for ms and O prefixes for CSS transition and animation events. (#13133) //<Rouven Weßling>//
- **[88d7ed8bf](https://github.com/facebook/react/commit/88d7ed8bf)**: React.Timeout -> React.Placeholder (#13105) //<Andrew Clark>//
- **[f128fdea4](https://github.com/facebook/react/commit/f128fdea4)**: Suspending outside of strict trees and async trees (#13098) //<Andrew Clark>//
- **[aa8266c4f](https://github.com/facebook/react/commit/aa8266c4f)**: Prepare placeholders before timing out (#13092) //<Andrew Clark>//
- **[c039c16f2](https://github.com/facebook/react/commit/c039c16f2)**: Fix this in a functional component for ShallowRenderer (#13144) //<Toru Kobayashi>//
- **[64e1921aa](https://github.com/facebook/react/commit/64e1921aa)**: Fix Flow type that event target can be null (#13124) //<Sebastian Markbåge>//
- **[6d6de6011](https://github.com/facebook/react/commit/6d6de6011)**: Add PROFILE bundles for www+DOM and fbsource+RN/RF (#13112) //<Brian Vaughn>//
- **[71a60ddb1](https://github.com/facebook/react/commit/71a60ddb1)**: Add link to another article about React renderers //<Dan Abramov>//
- **[6a530e3ba](https://github.com/facebook/react/commit/6a530e3ba)**: adding check for mousemove (#13090) //<Jason Williams>//
- **[c35a1e748](https://github.com/facebook/react/commit/c35a1e748)**: Fix crash during server render in react 16.4.1. (#13088) //<Dustin Masters>//
- **[076bbeace](https://github.com/facebook/react/commit/076bbeace)**: Fall back to 'setTimeout' when 'requestAnimationFrame' is not called (#13091) //<Flarnie Marchan>//
- **[da5c87bdf](https://github.com/facebook/react/commit/da5c87bdf)**: Fixes children when using dangerouslySetInnerHtml in a selected <option> (#13078) //<Michael Ridgway>//
- **[a960d18bc](https://github.com/facebook/react/commit/a960d18bc)**: eliminate unnecessary do-while loop in renderRoot() (#13087) //<Nathan Quarles>//
- **[5b3d17a5f](https://github.com/facebook/react/commit/5b3d17a5f)**: setting a flag, so that the first movement will have the correct value (#13082) //<Jason Williams>//
- **[b0f60895f](https://github.com/facebook/react/commit/b0f60895f)**: Automatically Profile roots when DevTools is present (#13058) //<Brian Vaughn>//
- **[ae8c6dd53](https://github.com/facebook/react/commit/ae8c6dd53)**: remove some redundant lines (#13077) //<Nathan Quarles>//
- **[0fcf92d06](https://github.com/facebook/react/commit/0fcf92d06)**: Add a link to custom renderer intro article //<Dan Abramov>//
- **[97af3e1f3](https://github.com/facebook/react/commit/97af3e1f3)**:  Do not add additional work to a batch that is already rendering (#13072) //<Andrew Clark>//
- **[4fe6eec15](https://github.com/facebook/react/commit/4fe6eec15)**: Always batch updates of like priority within the same event (#13071) //<Andrew Clark>//
- **[8e87c139b](https://github.com/facebook/react/commit/8e87c139b)**: Remove transitive dependency on fbjs (#13075) //<Dan Abramov>//
- **[aeda7b745](https://github.com/facebook/react/commit/aeda7b745)**: Remove fbjs dependency (#13069) //<Dan Abramov>//
- **[b1b3acbd6](https://github.com/facebook/react/commit/b1b3acbd6)**: Inline fbjs/lib/emptyObject (#13055) //<Dan Abramov>//

Release Notes:
[GENERAL] [FEATURE] [React] - React sync for revisions ae14317...ca0941f

Reviewed By: bvaughn

Differential Revision: D8979192

fbshipit-source-id: 7a14d3b0a253a81d162d7f8c899e99cf6ac4fee4
2018-07-24 14:47:52 -07:00
Janic Duplessis b4b594cec1 Fix `currentlyFocusedField` by Removing `this` usage in TextInputState (#19834)
Summary:
I broke `currentlyFocusedField` when adding it back in ce3b7b8204 because `this` no longer refers to the proper object because it is assigned here ce3b7b8204 (diff-b48972356bc8dca4a00747d002fc3dd5R330). This code was pretty prone to breaking so I simply removed the `this` usage and rely on a top level variable instead. Also moved everything to named functions.
Pull Request resolved: https://github.com/facebook/react-native/pull/19834

Differential Revision: D8943088

Pulled By: hramos

fbshipit-source-id: 24d1470f6117138a5978fb7e467147847a9f3658
2018-07-20 16:33:03 -07:00
Rasmus K. Brosbøl e0c73633cf VirtualizedList: Fix spacer size calculation (#18105)
Summary:
See https://github.com/facebook/react-native/issues/18104

Tested the above snack with:
- stickyHeadersEnabled true/false
- initialScrollIndex set and not

Visibly verified consistent rendering.

[GENERAL] [BUGFIX] [VirtualizedList] - Fix for jumpy content when initialScrollIndex specified
Pull Request resolved: https://github.com/facebook/react-native/pull/18105

Differential Revision: D8382122

Pulled By: sahrens

fbshipit-source-id: 9421351469e8684bc61438605abbd9988b664c29
2018-07-20 00:17:05 -07:00
Tim Yung 7091f15602 RN: Move ART Canvas Workaround
Summary: Moves the `ReactNativeART` workaround to callers. There are legitimate use cases where you don't want to re-mount this component repeatedly.

Reviewed By: fkgozali

Differential Revision: D8928633

fbshipit-source-id: 0aafc1136ce9acb290e26a4f1a958819439bf2f0
2018-07-19 19:02:13 -07:00
Ziqi Chen 03036f79f7 Changed prop name "currentViewStates" to "accessibilityStates" in js (1/3)
Summary:
Context:
After discussing with @[1038750002:yungsters], `currentViewStates` is a very ambiguous name for a prop, especially because there are only two possible values. From a developer's perspective, it makes more sense to just call them `accessibilityStates` because the main use for them is to add states to Talkback and Voiceover.
Also, the actual implementation of what we're changing under the hood in Native Code is abstracted away from developers using React Native, so as long as behavior is as they would expect, it makes more sense to change the name into a clear one.

Changes in this Diff:
Changed the prop name `currentViewStates` to `accessibilityStates` in js files

Reviewed By: PeteTheHeat

Differential Revision: D8896223

fbshipit-source-id: dfdb48dce69303a347dfccd194af2fef9beb776c
2018-07-19 14:13:00 -07:00
Mats Byrkeland be715ec705 Make AccessibilityInfo.setAccessibilityFocus cross platform (#20229)
Summary:
Currently, `AccessibilityInfo.setAccessibilityFocus` is only available on iOS. The same behaviour can be achieved on Android by dispatching the proper accessibility event. I implemented the same function for Android, to make life slightly more convenient for the developer.

Today, developers must write something like this:
```
if (Platform.OS === 'ios') {
     AccessibilityInfo.setAccessibilityFocus(reactTag)
} else {
     UIManager.sendAccessibilityEvent(reactTag, 8)
}
```

With this change, the following is enough for both Android and iOS:
```
AccessibilityInfo.setAccessibilityFocus(reactTag)
```
Pull Request resolved: https://github.com/facebook/react-native/pull/20229

Differential Revision: D8874107

Pulled By: mdvacca

fbshipit-source-id: a6ffd7bb89ce56d6d65b06419633a71dcf3d0733
2018-07-18 17:24:23 -07:00
Yunyu Lin daa7c78055 Add FlatList and SectionList to Animated exports
Summary: There are several cases for creating an animated implementation of FlatList or SectionList (e.g. passing Animated.Event for onScroll with useNativeDriver enabled, see FlatListExample or SectionListExample), so we might as well add them to the exports.

Reviewed By: sahrens

Differential Revision: D8886446

fbshipit-source-id: 4b207500ea4d8d10de8c1b2639a5f492bc62e560
2018-07-17 22:35:28 -07:00
Tim Yung 50a481d23a RN: Refine `StyleSheet.compose` Flow Type
Summary:
Refines `StyleSheet.compose` so that subtypes of `DangerouslyImpreciseStyleProp` can flow through the function call without losing their type.

This makes it so that if you supply two `ViewStyleProp` types, you will get a `ViewStyleProp` type out of it.

Reviewed By: TheSavior

Differential Revision: D8851699

fbshipit-source-id: e38e572e363a71fddf63d6b6bf5a96b3cdae5915
2018-07-17 18:03:00 -07:00
Ziqi Chen 5acb7211bb added header and summary options for roles
Summary: Added options for summary and header on accessibilityRoles

Reviewed By: PeteTheHeat

Differential Revision: D8866086

fbshipit-source-id: 83bfca678d2308f809e8630b7158a2b4a740c13d
2018-07-16 19:17:27 -07:00
Ziqi Chen 3cfa7ae698 Added in Prop for CurrentViewState
Summary:
Added in a prop for CurrentViewState that is used to set the state of the current view for both accessibility and regular view settings..

Ex:
AccessibilityRole = "button"
CurrentViewState = ['selected']

This will trigger talk back/voiceover to announce both the role and the state.

Unlike Accessibility Role, Accessibility States can take on more than one form, and are passed in an array.
Ex: AccessibilityState = ['selected', 'disabled']

Currently, two options are available: selected and disabled

Reviewed By: PeteTheHeat

Differential Revision: D8837848

fbshipit-source-id: ca30c950a2aa713813be8577ea4fa9ba9bfc698a
2018-07-16 19:17:27 -07:00
Ziqi Chen 10b603fdd3 added image button as option for accessibility role
Summary:
Because we're now separating accessibilityTraits into accessibilityRole and accessibilityState, we're going to only allow one role to be set, and allow one preset combinations of roles that make sense.

This diff adds image button as a role.

Reviewed By: PeteTheHeat

Differential Revision: D8846958

fbshipit-source-id: dad3783654b20abeb29767cdad7450d1896058c2
2018-07-16 18:48:15 -07:00
Peter Argany 10ebcbcf45 Added ImageEditor comment to clarify image access policy.
Summary:
ImageEditor.cropImage creates a temporary file when downloading images https://fburl.com/07r68w9s

This temporary file can be stored on external storage on android. External storage is accessible to any other application on the device, which could possibly leak images.

Using external storage may be unavoidable. I've voiced my opinion and solicited others on T31548988. Once a good policy is agreed upon, we can implement it.

For now, I'm adding this comment to make it explicit how images are cached.

Reviewed By: achen1

Differential Revision: D8837808

fbshipit-source-id: 02341bc94a1c95340390a713b76fe85603fd8f1b
2018-07-16 13:17:16 -07:00
Ziqi Chen d0b86ecb4f added in the three roles: search, adjustable, link that require localization
Summary:
Added in props for three more roles:
link, search, and adjustable

Reviewed By: blavalla

Differential Revision: D8788186

fbshipit-source-id: acd1d667a43bea753964d128bd4525ece90d06b3
2018-07-12 23:47:12 -07:00
Michael Ficaro a2675ced4e Adding new styling props to FlatList/VirtualizedList for ListHeaderComponent and ListFooterComponent
Summary:
We ran into a problem trying to style the optional prop `ListHeaderComponent` in the `FlatList` library component. Essentially we wanted to make `ListHeaderComponent` a flex item that filled all of the empty space in the list if there was any. Unfortunately the `ListHeaderComponent` is later wrapped in a `View` that blocked our styling. The `View` component was necessary as it added styling to handle inverting the `FlatList`. Similarly `ListFooterComponent` was handled the same way.

We came up the simple solution of adding two new optional props, `ListHeaderComponentStyle` and `ListFooterComponentStyle`, that are of type `ViewStyleProp` that allow users to pass in styling for `ListHeaderComponent` and `ListFooterComponent`.

With this change we were able to do something like the following to get the header component to fill all empty space in the `FlatList`.

```
<FlatList
    ...
    contentContainerStyle={{flexGrow: 1}}
    ListHeaderComponent={<View style={{flex: 1}} />}
    ListHeaderComponentStyle={{flexGrow: 1}}
    ...
/>
```
This solution will give users a lot more freedom when working with headers and footers.

Reviewed By: sahrens

Differential Revision: D8777038

fbshipit-source-id: f34116ce68548ea70223e639d0f84a099327f6b3
2018-07-12 13:49:08 -07:00
Ziqi Chen f39d0923c7 removed tabbar for iOS 9 compatibility issues
Summary: Removed Accessibility Trait TabBar for iOS compatibility Issues, since tabbar is only available on iOS 10+

Reviewed By: PeteTheHeat

Differential Revision: D8822469

fbshipit-source-id: 34bf00eb930f631a5a4effa0a4159da07c1573f6
2018-07-12 12:32:03 -07:00
Mehdi Mulani 934c50fbe0 Fix crash in RCTImagePicker on iOS
Summary:
@public
Apparently if you select images really quickly, the app will crash.

Reviewed By: shergin

Differential Revision: D8796730

fbshipit-source-id: 81a652d9c8997ee9e83bbee3378954a6718a9b5d
2018-07-12 10:33:01 -07:00
Tim Yung d756d94b3a RN: Workaround for ReactNativeART on Android
Summary:
Brings back the fix for `overflow: hidden` on Android by implementing a workaround for a bug with `ReactNativeART`.

The ReactNativeART bug is that changes in the canvas due to a resize of the `Surface` are not properly reflected on Android. I have verified that the correct props are being computed and passed to the shadow nodes and that the `ARTSurfaceView`'s canvas is indeed updated. But for some reason, the paint is not updated.

This workaround is to simply unmount and remount `Surface` on Android. It sucks and we should eventually fix it.

Reviewed By: achen1

Differential Revision: D8818010

fbshipit-source-id: 71d1927580b6bde7263fd241797d4655140b5f34
2018-07-12 08:02:16 -07:00
slorber f0d35904c9 Add missing tests for Animated.forkEvent (#20111)
Summary:
`forkEvent` is generally used to intercept an existing listener and add a new js listener to it, considering the original listener can be null/js/Animated.event(). I added tests to ensure the 3 cases of the implementation are all covered.
Pull Request resolved: https://github.com/facebook/react-native/pull/20111

Differential Revision: D8817500

Pulled By: hramos

fbshipit-source-id: 1a20b6f73e2d47bbefccd31378764909a45e89bb
2018-07-11 22:32:02 -07:00
Ziqi Chen c27b495a89 added accessibilityRole Prop, added functionality support for role on android
Summary:
Added a new property to View for Accessibility called `accessibilityRole`. This property merges functionality of existing properties: `accessibilityTraits` (iOS) and `accessibilityComponentType` (android).

Currently, nine values are supported with equivalent behavior as `accessibilityTraits` (iOS) when `accessibilityRole` is set on iOS Voiceover and Android TalkBack

```
  | 'none'
  | 'button'
  | 'link'
  | 'search'
  | 'image'
  | 'keyboardkey'
  | 'text'
  | 'adjustable'
  | 'tabbar'
```
They currently support similar behavior on talkback on Android and voice over on iOS
Does not break functionality of existing properties, but have not tested for behavior of setting both this one and the old one.

* iOS - I added a property accessibilityRoles, and basically remapped it to the same thing as accessibilityTraits. I also added in enum mappings for keyboardkey and tabbar.
* Android - Also added a property accessibilityRoles, from the Android side. For the underlying native functionality, I built a helper class that is based off of AccessibilityRolesUtil.java from the accessibility team. Biggest changes made are that I defined my own enums if needed, and also set some properties to match the functionality of iOS Accessibility Traits. I also handled the logic for switch/case statements of setting roles for the android side on this file. Also, I currently haven't localized strings for setRoleDescription, but plan to.
* Javascript - I added a view property accessibilityRoles in ViewPropTypes.

Reviewed By: blavalla

Differential Revision: D8756225

fbshipit-source-id: e03eec40cce86042551764f433e1defe7ee41b35
2018-07-10 12:18:27 -07:00
Ziqi Chen ef3d8b23c3 Unreverting Marketplace change for Inverted Color Ignorance
Summary:
Un-reverted Diff D8528543

Context:
Diff itself is the exact same as the old one. There's actually nothing wrong with this diff,
it was originally reverted because of iOS compatibility issue on exposing `accessibilityIgnoresInvertcolors` API to javascript, which has now been handled and fixed in this D8599698.
This means I can now set the property `accessibilityIgnoresInvertColors`

--------------------------
Added Smart Inversion Compatibility to Marketplace on iOS so that photos don't appear inverted
Added Property to View for Ignoring Color Inversion
Applied Property to Images on marketplace.

**Note: Android doesn't support smart inversion

Reviewed By: PeteTheHeat

Differential Revision: D8737594

fbshipit-source-id: 86080d45dec773ede4d3828fcda8870f546df691
2018-07-10 11:17:28 -07:00
Ziqi Chen 5aa040dfb7 added property accessibility IgnoresInvertColors to proptypes
Summary: Added property accessibilityIgnoresInvertColors to ViewPropTypes.

Reviewed By: PeteTheHeat

Differential Revision: D8735443

fbshipit-source-id: ac526779b7f92ceab074de75a2bf61752e7e90c6
2018-07-09 11:02:50 -07:00
Gabe Levi eac34e3021 Flow v0.76.0
Summary: No new errors in this version. Just removed a bunch of unused suppressions

Reviewed By: TheSavior

Differential Revision: D8754160

fbshipit-source-id: 2f02240b6d65edecba5d9ed603c7703462547a7f
2018-07-09 08:17:51 -07:00
Wen-Chien Chen b99609e9d2 Fix ScrollView logspew
Summary: There was an inverted expression leading to logspew. Fix this.

Reviewed By: TheSavior

Differential Revision: D8758023

fbshipit-source-id: 7a83c68db6c95f2b5db6dcc7d7780fc66321b49e
2018-07-08 00:32:30 -07:00
Konstantin Raev 604bcfa4a8 Revert D8683555: [react-native][PR] fix: account for `ListHeaderComponent` length when calculating offset…
Differential Revision:
D8683555

Original commit changeset: 05df7b79c16e

fbshipit-source-id: 6deb14b99fe04e67e264455ff92a5d8c1c2dd406
2018-07-06 19:32:21 -07:00
Himabindu Gadupudi 816d302e98 Reverting image source null so the fix can go all once later
Summary: Image source null which is in RC D8628053 has a bug which has a fix but didn't make to RC. Reverting so it can be cleaned up before going in RC.

Reviewed By: achen1

Differential Revision: D8751687

fbshipit-source-id: e08b23a031455be23047880871813bdc840542dd
2018-07-06 12:33:00 -07:00
Himabindu Gadupudi 46ffb10627 Fix null source bug in Image view while accessing source's uri
Summary: Fix null source bug in Image view while accessing source's uri

Reviewed By: achen1

Differential Revision: D8739379

fbshipit-source-id: 0338b19135fa8af9ebe599cabbc9e321fb0906a5
2018-07-05 15:18:04 -07:00