Summary:
ES Modules implicitly enable strict mode. Adding the "use strict" directive is, therefore, not required.
This diff removes all "use strict" directives from ES modules.
Changelog:
[Internal]
Reviewed By: motiz88
Differential Revision: D26172715
fbshipit-source-id: 57957bcbb672c4c3e62b1db633cf425c1c9d6430
Summary:
Migrates `CodegenTypes` and its transitive dependencies to Flow strict to unblock this mode in Native Modules and Native Components.
Changelog: [Internal]
Reviewed By: TheSavior
Differential Revision: D25540629
fbshipit-source-id: 7bed2ee58af7a789b50932734c7a86cf1719e2c5
Summary:
We are going to be switching event target and current target from being a reactTag to being a host instance.
This doesn't actually change what the actual type of this key is, but is split out like this to make diffs smaller and easier to review. Actual behavior changes will be coming and tested in a future diff.
These are the only callsites I found that use target outside of the React renderers.
The other approach this change could take would be to make all the downstream callsites take both a tag or a HostComponent. That felt too difficult to do at the same time so I'm instead introducing these `findNodeHandle` calls temporarily.
The main thing we need to do is be able to change the callsites in the renderer to start sending the instance. Once everything is passing the instance instead of the tag then we can clean all these up cleanly.
Changelog: [Internal]
Reviewed By: yungsters
Differential Revision: D18384435
fbshipit-source-id: b3a7e6a2778cb7dd9cdfe451cf869cd99641b167
Summary:
We are going to be switching event target and current target from being a reactTag to being a host instance.
This doesn't actually change what the actual type of this key is, but is split out like this to make diffs smaller and easier to review. Actual behavior changes will be coming and tested in a future diff.
These are the only callsites I found that use `currentTarget` outside of the React renderers.
Changelog:
[Internal]
Reviewed By: zackargyle, yungsters
Differential Revision: D18382470
fbshipit-source-id: 23add5498b38dc109b154479826f701c8a1920b9
Summary:
Exports these events in a canonical manner so that they can be used in future refactors.
Changelog:
[Internal]
Reviewed By: TheSavior
Differential Revision: D18257693
fbshipit-source-id: aac40277df8a88224c8df29caa04ffc9a6db0a22
Summary:
Adds a generated view config for iOS Switch
Note: this required some refactoring because the SwitchNativeComponent file included both iOS and android componets, so I broke them out into:
- AndroidSwitchNativeComponent (not generated)
- SwitchNativeComponent (generated)
The schema that we're using is for the iOS version so that's the config that's generated here
Reviewed By: cpojer
Differential Revision: D15495402
fbshipit-source-id: 07b3bc9c780cbf8f6cbf66e976e15981cefcadfa
Summary:
Relates to #22100.
I left 2 `$FlowFixMe`s as I was not sure how to handle generic `React.Element<>` and which native props can I pass to ScrollView (would be cool to document it once we got proper types there).
I also got rid of `InternalScrollViewType` because we have better typings in original `ScrollView` now.
Pull Request resolved: https://github.com/facebook/react-native/pull/22301
Reviewed By: TheSavior
Differential Revision: D13103990
Pulled By: RSNara
fbshipit-source-id: 9664ee9d7f570b00992215e10901e5317f24fe5c
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
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
Summary: This change drops the year from the copyright headers and the LICENSE file.
Reviewed By: yungsters
Differential Revision: D9727774
fbshipit-source-id: df4fc1e4390733fe774b1a160dd41b4a3d83302a
Summary: Splitting this into a separate diff for OSS
Reviewed By: yungsters
Differential Revision: D9551085
fbshipit-source-id: 8ca08351c6b89cd0011aab3c47ef6cc28b763450
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
Summary:
This PR removes the need for having the `providesModule` tags in all the modules in the repository.
It configures Flow, Jest and Metro to get the module names from the filenames (`Libraries/Animated/src/nodes/AnimatedInterpolation.js` => `AnimatedInterpolation`)
* Checked the Flow configuration by running flow on the project root (no errors):
```
yarn flow
```
* Checked the Jest configuration by running the tests with a clean cache:
```
yarn jest --clearCache && yarn test
```
* Checked the Metro configuration by starting the server with a clean cache and requesting some bundles:
```
yarn run start --reset-cache
curl 'localhost:8081/IntegrationTests/AccessibilityManagerTest.bundle?platform=android'
curl 'localhost:8081/Libraries/Alert/Alert.bundle?platform=ios'
```
[INTERNAL] [FEATURE] [All] - Removed providesModule from all modules and configured tools.
Closes https://github.com/facebook/react-native/pull/18995
Reviewed By: mjesun
Differential Revision: D7729509
Pulled By: rubennorte
fbshipit-source-id: 892f760a05ce1fddb088ff0cd2e97e521fb8e825
Summary:
Includes React Native and its dependencies Fresco, Metro, and Yoga. Excludes samples/examples/docs.
find: ^(?:( *)|( *(?:[\*~#]|::))( )? *)?Copyright (?:\(c\) )?(\d{4})\b.+Facebook[\s\S]+?BSD[\s\S]+?(?:this source tree|the same directory)\.$
replace: $1$2$3Copyright (c) $4-present, Facebook, Inc.\n$2\n$1$2$3This source code is licensed under the MIT license found in the\n$1$2$3LICENSE file in the root directory of this source tree.
Reviewed By: TheSavior, yungsters
Differential Revision: D7007050
fbshipit-source-id: 37dd6bf0ffec0923bfc99c260bb330683f35553e