Summary: There is only a single use of this function across RN, and one more use in a test file. I inlined this function in both places to reduce the dependency on fbjs.
Reviewed By: yungsters
Differential Revision: D13138137
fbshipit-source-id: 32660c965a975d17e236bdd13ff0b2a8d64751ee
Summary: There are no DOM Nodes in React Native so our Map polyfill does not need to consider that use case. I deleted the references to `isNode` and `IE. In case this is important for react-native-web, I suggest to shim the Map polyfill with an IE compatible one outside of react-native.
Reviewed By: yungsters
Differential Revision: D13138030
fbshipit-source-id: 661511ea03b4477bd55d0fdf5e485178fe59d96b
Summary: This module simply forwards to the `promise` module. I inlined the code to remove the dependency.
Reviewed By: yungsters
Differential Revision: D13137980
fbshipit-source-id: e3d6208068911711fc5f5378f2d5bb6ac38f2eb2
Summary:
Related to #22100
Enhance Flow types for TouchableOpacity specifying underlay functions and TvParallaxPropertiesType.
I had to export and enhance TvParallaxPropertiesType from TVViewPropTypes file. This does not break this other PR also using this exported type. #22146
There is still some work to do in order to turn flow to strict mode.
- All flow tests succeed.
[GENERAL] [ENHANCEMENT] [TouchableHighlight.js] - Flow types
[GENERAL] [ENHANCEMENT] [TVViewPropTypes.js] - Export and enhance type
Pull Request resolved: https://github.com/facebook/react-native/pull/22173
Differential Revision: D13033441
Pulled By: RSNara
fbshipit-source-id: 26a38970923dc7e6c02c03da5d08483a3f1fbd36
Summary:
Some of the flow types were incomplete. So, I referenced the code in `~/fbsource/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/views/textinput/` and in `~/fbsource/xplat/js/react-native-github/Libraries/Text/TextInput/` to make the flow types more specific.
I also fixed internal breakages. To avoid having to sprinkle `$FlowFixMe`s everywhere, I had to refactor some types, and some code.
Reviewed By: TheSavior
Differential Revision: D13121871
fbshipit-source-id: 9796aafc861544baf52d7ade823ab1be2d3f12d1
Summary:
Related to #22100
Enhance TextInput with callback event types.
This is a first draft and I will need more help on this one. Flow checks are successful now but I am not sure types are accurate though.
Moreover I find my separation approach kind of dirty for callback event types.
- All flow tests succeed.
[GENERAL] [ENHANCEMENT] [TextInput.js] - Flow types
[GENERAL] [ENHANCEMENT] [TextInputExample.android.js] - Fixing Flow types
[GENERAL] [ENHANCEMENT] [TextInputExample.ios.js] - Fixing Flow types
[GENERAL] [ENHANCEMENT] [XHRExampleFetch.js] - Fixing Flow types
Pull Request resolved: https://github.com/facebook/react-native/pull/22250
Reviewed By: TheSavior
Differential Revision: D13104820
Pulled By: RSNara
fbshipit-source-id: 3fbb98d0ec2b62be676f71ae1053933d9c78485e
Summary:
Related to #22100
Turn on Flow strict mode for TextProps.
I used ResponseHandlers type definition defined in Text.js.
I wanted to move ResponseHandlers type to TextProps and reuse it inside the file.
I know I could use $Shape<> to maybe keys but how do I elegantly maybe every values ?
Unless having a straightforward solution, I found it clearer to copy paste these types.
- All flow tests succeed.
[GENERAL] [ENHANCEMENT] [TextProps.js] - Flow strict mode
Pull Request resolved: https://github.com/facebook/react-native/pull/22122
Reviewed By: TheSavior
Differential Revision: D13055759
Pulled By: RSNara
fbshipit-source-id: 230b43c7c94d7f82f5727ad11541b0cb98bc5e3a
Summary:
Related to #22100
Enhance TouchableBounce with press event types, callback and hitslop types.
There is still some work to do in order to turn flow to strict mode. (requireNativeComponent and render function)
- All flow tests succeed.
[GENERAL] [ENHANCEMENT] [TouchableBounce.js] - Flow types
Pull Request resolved: https://github.com/facebook/react-native/pull/22197
Reviewed By: TheSavior
Differential Revision: D13032452
Pulled By: RSNara
fbshipit-source-id: b21140722ce924698aa15323602e2e3fc663dbb6
Summary:
If text is truncated and an inline view appears after the truncation point, the user should not see the inline view. Instead, we have a bug such that the inline view is always visible at the end of the visible text.
This commit fixes this by marking the inline view as hidden if it appears after the truncation point.
This appears to be a regression. React Native used to have logic similar to what this commit is adding: 1e2a924ba6/Libraries/Text/RCTShadowText.m (L186-L192)
**Before fix**
Inline view (blue square) is visible even though it appears after the truncation point:
![image](https://user-images.githubusercontent.com/199935/46382038-d3a71200-c65d-11e8-8179-2ce4aad8d010.png)
The full text being rendered was:
```
<Text numberOfLines={1}>
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna
<View style={{width: 50, height: 50, backgroundColor: 'steelblue'}} />
</Text>
```
**After fix**
Inline view is properly truncated:
![image](https://user-images.githubusercontent.com/199935/46382067-fdf8cf80-c65d-11e8-84ea-e2b71c229dae.png)
**Test Plan**
Tested that the inline view is hidden if it appears after the truncation point when `numberOfLines` is 1 and 2. Similarly, verified that the inline view is visible if it appears before the truncation point.
**Release Notes**
[IOS] [BUGFIX] [Text] - Fix case where inline view is visible even though it should have been truncated
Adam Comella
Microsoft Corp.
Pull Request resolved: https://github.com/facebook/react-native/pull/21456
Differential Revision: D10182991
Pulled By: shergin
fbshipit-source-id: a5bddddb1bb8672b61d4feaa04013a92c8224155
Summary:
I noticed that the _onBlur method was not exactly similar to the _onFocus one in the TextInput component.
After digging, I found that the blurTextInput method in the TextInputState.js file was call twice in a raw instead of once when the textinput component should blur.
By removing this line, I fix this unecessary multiple call.
Pull Request resolved: https://github.com/facebook/react-native/pull/22156
Reviewed By: TheSavior
Differential Revision: D13105396
Pulled By: RSNara
fbshipit-source-id: 8e83461d8b288d8ee4047bc4a33c4480e193c349
Summary:
This pull requests converts `DrawerLayoutAndroid` from a `createReactClass`-based component to an ES6 class component, removing its use of `NativeMethodsMixin` and `prop-types` in the process.
Unfortunately this couldn't be moved over to a full `forwardRef` to the native component, because it has the methods `openDrawer` and `closeDrawer` as part of its API, and they can't be called directly on the native component. A `createRef`-based ref to the native component can be accessed from the `nativeRef` property of a `DrawerLayoutAndroid` instance if a native ref is needed.
The Flow types for callbacks have also been filled out.
Pull Request resolved: https://github.com/facebook/react-native/pull/21980
Reviewed By: TheSavior
Differential Revision: D12901951
Pulled By: RSNara
fbshipit-source-id: d35fa5f11b1059f49b466b52abeec902db1d22f7
Summary:
Back it out again. This time really not sure why this is breaking, but it seems to be production only. The error seems to be "RCTSinglelineTextInputView" was not found in the UIManager" but the relavent logic is not changed in this diff, just moved around, so unclear why it would trigger a failure.
Reverting to be safe. When we re-apply the diff, we'll need to test a full OTA to prod to verify the fix.
Reviewed By: blairvanderhoof
Differential Revision: D13108463
fbshipit-source-id: 5f877a0c1a08dc114ce45921d6d92bf619575977
Summary: Adds a `bounce` method that just bounces the element without invoking any callbacks.
Differential Revision: D13085800
fbshipit-source-id: 310b273b260c924fbde32bfad1de7226d068bd57
Summary: D10515754 reapplied by backing out D12989604 and then fixed by manually forwarding the instance methods to the host function instead of using `forwardRef`. This also removes the need for the $flowFixMe.
Reviewed By: TheSavior
Differential Revision: D13048482
fbshipit-source-id: ff2447aff123e0960eddaef645f7dc976a426e14
Summary: Adds a basic test that would have prevented S168585. We should expand coverage of this and other components as well.
Reviewed By: TheSavior
Differential Revision: D13038064
fbshipit-source-id: 14cf4742efd53d7bca2a3f8d1c5c34ebc6227674
Summary: Changed front-facing camera so that it shows consistent image during capture and preview
Reviewed By: mmmulani
Differential Revision: D13012715
fbshipit-source-id: 043cd9178fc49ef9e8e628a866dd8e52434f7306
Summary:
Fixes two problems I uncovered with React Native:
1. `FBCore/Prelude` points to `React.unstable_AsyncMode` which is not defined. (This type was renamed to `React.unstable_ConcurrentMode` in React v16.6.0. **As a result** people in the "react_native:async_rendering" GK will no longer get runtime errors on app start.
2. Updates `react-devtools` and (more importantly) `react-devtools-core` to 3.4.2 to handle the React-internal tag/type refactoring that happened prior to the release of 16.6.0. **As a result** DevTools will no longer cause a runtime error when connected to React Native.
For the second change, I ran `js1 upgrade react-devtools -v ^3.4.2`
Reviewed By: sebmarkbage
Differential Revision: D13030590
fbshipit-source-id: 603f7f6259f282839039820bcdba4310064a7965
Summary:
This regression was caused by 199c918 - property values are initialized to true rather than a string that matches the property name now.
Pull Request resolved: https://github.com/facebook/react-native/pull/22262
Differential Revision: D13048839
Pulled By: hramos
fbshipit-source-id: 09471334c37f3930aae7e35066943f33f8e617e5
Summary: Testing is a __DEV__ time only, so let's optimize for prod bundles.
Reviewed By: ejanzer
Differential Revision: D13050583
fbshipit-source-id: a96e35e4d5f3bd09c235c11d4ece3e4d07882de7
Summary:
@public
We're seeing a crash on line 191 when we do `CFRelease(self->_firstTimeReachability);`. My thinking is that there's a race condition between the deallocation coming from calling `getCurrentConnectivity` twice in a row and the callback coming back.
Reviewed By: PeteTheHeat
Differential Revision: D12982772
fbshipit-source-id: d3d882a074b67a5e547e7f480f561fcaf8d79ec4
Summary:
GraphNotFoundError: When the user moves the app to the background on Android, restarts the Metro server and reopens the app, since the client hasn't requested either a delta or a bundle, the graph cache of the server is empty and thus we can't compute an update for the client (what if changes happened when the metro server was down?).
RevisionNotFoundError: I didn't manage to reproduce that one. It could happen if two clients live side-by-side, requesting the exact same bundle. In the future, if we want to handle that case, we'll need to manage a list of clients listening to a single graph so that we don't try to update the same graph multiple times for a single file change.
Disconnection: Same as GraphNotFoundError, but happens when the user moves the app to the background on iOS.
Reviewed By: mjesun
Differential Revision: D12960939
fbshipit-source-id: 5ac1dc7fd12bad5e0ee8dfa5a21c112773454ee5
Summary: It seems like `nativePerformanceNow` might not be getting installed in time to be used by InitializeCore on Android. Using PerformanceLogger.currentTimestamp instead, which uses nativeQPLTimestamp (which is what we should be using anyway)
Reviewed By: alexeylang
Differential Revision: D12875187
fbshipit-source-id: 6eda5d2ed7948ba48c63f76b40b2014511c32494
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
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
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
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
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
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
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
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
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
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