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
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
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
Summary: Similar to ComponentsConfiguration used by Litho. Allows us to abtest without having to pipe everything through ReactInstanceManager
Reviewed By: axe-fb
Differential Revision: D9930707
fbshipit-source-id: 43edf7d8fa2bab7b7888df57ea1bec2b4726f51b
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
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
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 PR is a WIP for adding tests for out-of-tree platform support. [I originally had issues](https://github.com/facebook/react-native/pull/20825#issuecomment-416433611) with this, so I want to give it a try in a separate pull request. None of these issues appear on my machine while running these tests as of this rebase - if everything seems okay on CircleCI after this rebase against `master`, I will ditch the [WIP] tag. Otherwise, I will see if I can find a way to make this work.
The bunch of JS files that will give this a "Large PR" tag are in `RNTester/js/OutOfTreeTestPlatform` - they are only used by the bundler and not executed at any point in time. So if another file needs to be added when React Native's module structure changes, you do not need to have a functional JS file in there as a stub. `module.exports` could be `null` if you wanted. I just had copied over stubs from `Libraries` because I wanted a non-trivial haste module map to be in the test.
Pull Request resolved: https://github.com/facebook/react-native/pull/20932
Reviewed By: axe-fb
Differential Revision: D9818112
Pulled By: hramos
fbshipit-source-id: 0b53359b84430fdefb972587c95d19f85773c5fa
Summary: We want to be able to log individual points from JS.
Reviewed By: ejanzer
Differential Revision: D10050400
fbshipit-source-id: eadd81a8cf70082998950c19a98c3de979eb148a
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
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
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
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
Summary:
On Android N (API 24) rounded corners rendering has issues in case scale factor is set for the view.
Pull Request resolved: https://github.com/facebook/react-native/pull/21340
Differential Revision: D10084318
Pulled By: hramos
fbshipit-source-id: 53ae5a32b96cc7ee7eba084330682239d8beb85d
Summary: New version on the horizon :)
Reviewed By: mjesun
Differential Revision: D10051460
fbshipit-source-id: 982604bd7a38d1d3ec642f6cd6fea1a40ab0d34f
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
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
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
Summary: During the JS run, the view managers used on a React Native screen eventually call the native methods for `UIManagerModule.getConstantsForViewMangers(viewManagerName)`. This blocks the JS thread. This diff tries to cache the values of those calls and return them when JS needs it, ensuring that JS is not blocked as much.
Reviewed By: achen1
Differential Revision: D9985817
fbshipit-source-id: 36feabc8a386956f8a6474f6e7978285d31f24dd
Summary:
This PR adds these two scripts to `package.json`:
* `flow-check-ios` - for running `flow check` on `.ios.js` files
* `flow-check-android` - for running `flow check` on `.android.js` files
The Android command makes use of the new `--flowconfig-name` option added to Flow in `0.80.0`
Pull Request resolved: https://github.com/facebook/react-native/pull/21326
Differential Revision: D10055702
Pulled By: hramos
fbshipit-source-id: e647f8d2995da0a9bd6af242218819fd5745df63
Summary: This makes the Metro config type readonly, only a couple of things inside Metro needed to be tweaked :)
Reviewed By: mjesun
Differential Revision: D10028083
fbshipit-source-id: 15f5d957a8ee7384d6156c973639d86240fd251f
Summary: This diff removes the `convertNewToOld` config method, which was only used by the unit tests (since there's no need to convert a new config object into an old one). As part of this, the config tests have been tweaked and simplified a bit, while keeping similar assertions and adding some more checks.
Reviewed By: mjesun
Differential Revision: D10015079
fbshipit-source-id: ba4fbd09cd4f97168bc1a2dbcec2699a00243637
Summary:
Don't ask.
Really, all those descriptions from official docs like below are useless:
* `__bridge_transfer` Moves a Core Foundation pointer to Objective-C with transfer of the ownership to ARC.
* `__bridge` Transfers a pointer between Objective-C and Core Foundation with no transfer of ownership
All that is totally confusing and useless. At the end of the day, we only have to think about which additional `CFRetain` and `CFRelease` ARC will add or will not add for our pointers.
So, following official docs recommendation, we would like to add `__bridge_transfer` because of course, we do want to ARC managing the variable after we introduced it to ARC here. But we also want to have shared ownership of this. That's the key. If we use `__bridge_transfer` ARC will assume that this variable already retained once (because it exists) and will call CFRelease at the end of the scope. Right before that when we pass this variable down to call stack ARC will retain and then manage the variable according to the rest of the code. But still, from this point, we will have zero-balanced reference counter; the owning by `shared_ptr` bump is already compensated with `CFRelease` at the end of the scope. As soon as the rest of the code release the object, it will be incorrectly deallocated.
So, instead of using `__bridge_transfer` we have to use `__bridge`. That will indicate that *in this block* ARC does not manage the reference counter of the variable (which is kinda true because having `shared_ptr` inside the block already retains that) and will not add `CFRelease` at the end of the block.
Reviewed By: mdvacca
Differential Revision: D10054241
fbshipit-source-id: 6e82c5270fe5d53f1ed68e167b94f70dc4367a9f
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
Summary: Apparently, after updating CALayer props we have to request redrowing on top of it manually.
Reviewed By: mdvacca
Differential Revision: D10053340
fbshipit-source-id: f87311399bab809c9e13a3076f526bbe3f7f3fb4
Summary: We have to uninstall UIManager synchronously to avoid a race condition when JS is capable to call already deallocated UIManager.
Reviewed By: mdvacca
Differential Revision: D10033406
fbshipit-source-id: 194d1ae2dd5ab09b036b1c165de289ada8e66014
Summary:
Instead of wrapping all public methods into The controller you requested could not be found. blocks/mutexes, RCTSurfacePresenter utilizes a different thread-safety pattern where all instance variable are granularly thread-safe.
The names of all internal methods were prefixed by '_'.
Reviewed By: mdvacca
Differential Revision: D10033407
fbshipit-source-id: 97fd2879c879dd9ef8d9ece24e25af00f749a871
Summary:
There is no need to make JS calls to start or stop React Native apps; Scheduler does it automatically. Yay!
With this change (because we have to change Scheduler API) we are starting slow process migrating away from using term `reactRootTag` when we refer to running a ReactNative app (aka Surface). We will use `surfaceId` instead. We plan to slowly and gracefully retire `reactTag` term entity replacing it with several appropriate entities specific for particular usage, e.g. `viewId` (some id which makes sense for mounting), `surfaceId`, `nodeId` (unique id representing nodes which were cloned from the original one), or `eventTarget`.
Reviewed By: mdvacca
Differential Revision: D9999336
fbshipit-source-id: bbc7303c195b070b8c235c9ca35546d1dc693e98
Summary: This is the last step before making JSIUIManagerInstaller a direct dependency of UIManager (and making UIManager installation process completely seamless/platform-agnostic).
Reviewed By: mdvacca
Differential Revision: D9995781
fbshipit-source-id: 6f8c7177495b01ebaac1dbe330f49dce2e2a552c
Summary:
EventBeatBasedExecutor is an executor derived from EventBeat and using EventBeat to ensure proper threading.
Why do we need yet another executor? Because otherwise, we have to make it platform specific-dependency that each platform-specific implementation has to implement and provide. We already have all that we need in already provided EventBeat, so we can just convert that into simple executor in a platform-agnostic way.
Reviewed By: mdvacca
Differential Revision: D9995783
fbshipit-source-id: f8aa72a9744e50ebecbea9ad0e2546f41f5358f2
Summary: Besides that it's more simple and straight-forward now, we need that to always instantiate Scheduler with a context full of fresh valid objects derived from the new instance of the bridge.
Reviewed By: mdvacca
Differential Revision: D9995780
fbshipit-source-id: 534a314152d93562b08dd7857962f174b0d06886
Summary:
The original design of RCTSurface implied that the Surface starts on initialization and stops on deallocation. Recently I realized that this not sufficient API in some cases when the application uses ARC with autorelease pools (that can postpone object deallocations, which is highly undesirable).
And that's simply handy to have those methods sometimes.
Reviewed By: mdvacca
Differential Revision: D9982356
fbshipit-source-id: baa3bd24804d3708606ebd00b8795f2d5c9d4de9
Summary: We call this method in a constructor before the actual object is beeing constructed, so it's incorrect; it should be class method.
Reviewed By: mdvacca
Differential Revision: D9931315
fbshipit-source-id: 304ba8e2354f3f408cfa2bf1729266525a08f951
Summary: All integration with Bridge was removed from RCTFabricSurface, now it's Surface's responsibility to start and stop JS app and register the ShadowTree in the Scheduler.
Reviewed By: mdvacca
Differential Revision: D9931317
fbshipit-source-id: 55a682f0afb1c542a904e1a8570029e4690967cc
Summary: UIManager now can install and uninstall itself calling a functions that are provided as constructor arguments.
Reviewed By: mdvacca
Differential Revision: D9931329
fbshipit-source-id: b8d2d9925b0e2db0fed44bdf2e185d198fabd5ee
Summary: Now we have a way to enumerate surfaces stored in RCTSurfaceRegistry.
Reviewed By: mdvacca
Differential Revision: D9931316
fbshipit-source-id: 6b886c4b52cebddf15fef0239190fb2730d682cc
Summary:
Follow up to 8932a9caa8
Babel helpers and regenerator runtime will be imported automatically from `babel/runtime`. We still need to add the global regeneratorRuntime for jest tests since we disable babel-runtime currently.
Pull Request resolved: https://github.com/facebook/react-native/pull/21283
Reviewed By: mjesun
Differential Revision: D10010963
Pulled By: rafeca
fbshipit-source-id: da5e23dd901f8f8940d46816b4fc9290d0e28c76