Summary: Instead of getting `RuntimeExecutor` from the bridge, pass it from above. Right now pass through `null`, but eventually this will work :)
Reviewed By: RSNara
Differential Revision: D16626288
fbshipit-source-id: bce527f85c0a79cfe6cf240a3633bbbe357f75c4
Summary: Instead of grabbing `imageManager` from the bridge, pass it from above. Right now, still use bridge to pass from above, but this gives us flexibility to not use bridge in the future.
Reviewed By: shergin
Differential Revision: D16504270
fbshipit-source-id: 7977a7957b659375f8348d26cd57b648e9d5959f
Summary:
This diff adds a JS spec for RCTImageLoader, and conforms to it in ObjC++. Since RCTImageLoader isn't called from JS, the js spec is empty. Since `/CoreModules/` is the only dir in OSS which supports TM, move the ObjC++ impl there.
The change in `NativeExceptionsManager.js` fixes a weird bug I was hitting in codegen, where the codegen cpp file wouldn't compile due to unused variable.
Reviewed By: JoshuaGross
Differential Revision: D16495674
fbshipit-source-id: 191897b87730a6b0b96022eedc6412551fae04a6
Summary: The new support for ReadOnlyArray needs to call this new function for spreads too.
Reviewed By: JoshuaGross
Differential Revision: D16823796
fbshipit-source-id: 9de94b41cdead7ce5238c77a9e39b5daf760dfe2
Summary: I realized my previous diff was incomplete. Adding parsing and generation code for Double for props, commands, and events.
Reviewed By: rickhanlonii
Differential Revision: D16823540
fbshipit-source-id: fbed9897bb84b789c502cf4153e81060590152b8
Summary: Split buck rules for component and modules for our further convenience
Reviewed By: rickhanlonii
Differential Revision: D16803703
fbshipit-source-id: c01fb97875b43be4020edd054cad538ec8ed6861
Summary:
We're currently not supporting this kind of params
```
+sample(string):void
````
and here's special exception for it.
Reviewed By: RSNara
Differential Revision: D16708583
fbshipit-source-id: 809f9808b77108857c8363536b896089e9cb957f
Summary: Adds e2e tests for the array of object prop types in the codegen
Reviewed By: rubennorte, motiz88
Differential Revision: D16814301
fbshipit-source-id: 613f32a888451c0c1b7359133b7bf88878e36916
Summary:
There have been multiple complaints about combining RN with various
other FB libraries, including Litho and Flipper, because of bundled dependencies
that can't be deduplicated by Gradle.
This is one of three current conflicts:
1) Proguard annotations (this PR)
2) Yoga
3) fbjni
While the Yoga group name doesn't make a massive amount of sense
it was the easiest existing package to use and since we don't
have a better namespace for this, we might as well use this.
A similar change to Litho is landing right now.
## Changelog
[Android] [Changed] - Use centralized package for DoNotStrip annotation
Pull Request resolved: https://github.com/facebook/react-native/pull/26069
Test Plan:
```
yarn
./gradlew :RNTester:android:app:assembleDebug
```
Reviewed By: cpojer
Differential Revision: D16827430
Pulled By: passy
fbshipit-source-id: 87542b5422fee598d8e635651441f0ecd42eb9d7
Summary: This diff adds a super call to `BaseViewManagerDelegate` if the current delegate doesn't have any props. We still want to set base view props, so we need `BaseViewManagerDelegate` to take care of this.
Reviewed By: rickhanlonii
Differential Revision: D16806648
fbshipit-source-id: 61963f2211cc7b2e7f5822c48bb0a7f50d909221
Summary: The OnLoad.cpp file is needed since it actually registers the jni functions, it wasn't included in the build so it wasn't working correctly.
Reviewed By: jbower-fb
Differential Revision: D16826230
fbshipit-source-id: 0243e456c4015879d17650737a6a27a58a3d0d9a
Summary:
This pull request moves `Text`'s prop types to the `DeprecatedPropTypes` folder.
This was already partly in progress - there were redundant `TextPropTypes` and `DeprecatedTextPropTypes` files so I removed one, and made sure the version with the doc strings was the one used.
## Changelog
[General] [Deprecated] - Move `Text` component's proptypes to DeprecatedPropTypes
Pull Request resolved: https://github.com/facebook/react-native/pull/26055
Test Plan: Flow checks pass for iOS and Android
Differential Revision: D16801078
Pulled By: TheSavior
fbshipit-source-id: ef19300945d48d0a4a83d728ee32cdf7d1c0f0cc
Summary: There are a couple of cases where props can conflict which would cause undefined behavior. We'll throw to protect against that. Now that we support type spread this is more possible without someone realizing.
Reviewed By: JoshuaGross
Differential Revision: D16813884
fbshipit-source-id: 1a8fce365ab315198abdff0de6006cfe34e84fb9
Summary: Apparently I missed one more edge case. Thanks Josh for flagging!
Reviewed By: JoshuaGross
Differential Revision: D16813354
fbshipit-source-id: 6b59bc7b18184e3aa437c3b038ffd22b0fc0ba6a
Summary: We want to be able to spread props at any level, not just the top level
Reviewed By: JoshuaGross
Differential Revision: D16812884
fbshipit-source-id: 2e710141f833a7cc7ea25a91a1523a5c43b4e02c
Summary: We want to be able to spread types that are defined in the same file.
Reviewed By: JoshuaGross
Differential Revision: D16812171
fbshipit-source-id: 7cda9869ea25f0357b3f8a3b28443407b219f04b
Summary: Support a prop-type `Double`, in addition to `Float`, for flow typing and codegen of components.
Reviewed By: TheSavior
Differential Revision: D16812812
fbshipit-source-id: b5588b3218636283a4e9c5d17212dd0b92986eb9
Summary:
This diff moves RCTImageLoader, RCTImageEditingManager, and RCTImageStoreManager to CoreModules. This is necessary for us to convert all these NativeModules to TurboModules.
**Note:** As a part of this diff, I had to break apart `RCTImageLoader.h`. All the protocols that were in `RCTImageLoader` are now in their own headers. Furthermore, `RCTImageLoader`'s methods are defined in `RCTImageLoaderProtocol`, so that we can call them from classes like `RCTImageViewManager` in `RCTImage`.
Reviewed By: PeteTheHeat
Differential Revision: D16805827
fbshipit-source-id: 89f6728b0766c30b74e25f7af1be8e6b8a7e6397
Summary: This diff replaces the usage of UIManagerModule.playTouchSound() in Pressability and Touchable for the SoundManager.playTouchSound()
Reviewed By: yungsters
Differential Revision: D16543433
fbshipit-source-id: a2ba060bc480889c1e08c5c87086361e06974684
Summary:
This function was used by Touchable*. It was removed from the Touchables in D6494579 in 2017. The only remaining callsite was ImageBackground which is attaching a ref directly to the View so we know it is a native component.
This is needed for some setNativeProps cleanup
Reviewed By: sahrens
Differential Revision: D16796973
fbshipit-source-id: 19379094b3b91920efac4bf1969fc22d4b80bcc6
Summary:
The documentation from the Flow types' respective proptypes have been copied over to `TextInput`.
## Changelog
[Internal] [Changed] - Added documentation to TextInput's Flow types
Pull Request resolved: https://github.com/facebook/react-native/pull/26054
Test Plan: `yarn flow-check-ios` and `yarn flow-check-android` both pass.
Differential Revision: D16801435
Pulled By: TheSavior
fbshipit-source-id: 7f3d75ba149259d5bbf719375320e2e325188826
Summary: Old codegen was omitting `getConstants` if it was empty. So do our. There's no point in providing this getter in this case.
Reviewed By: RSNara
Differential Revision: D16762230
fbshipit-source-id: 721df13a00848d23108329b152115c0f0aee8eb9
Summary: `setMethodArgConversionSelector` is method for provinding generated structs for methods' params. It was exactly how in old codegen.
Reviewed By: RSNara
Differential Revision: D16784403
fbshipit-source-id: d35bc8160be62385527299a6b8e68c1159002853
Summary: It was a mistake. We should obtain value by proper key always. Previously by a mistake I hardcoded 'a'. I wasn't break anything because it wasn't used in Internationalization. However, it was a bug
Reviewed By: RSNara
Differential Revision: D16782132
fbshipit-source-id: 59f7910f2be7753c07f16f00a201de856d57e29e
Summary:
It was mistake which I fix here. Type of param in protocols should be generated struct.
See generated struct in snap. It's exactly how it was in previous codegen
Reviewed By: RSNara
Differential Revision: D16770579
fbshipit-source-id: dac9c15c5d91a41ab2d06aea416f64bd7deb4476
Summary: Property should be marked as optional not only when value is optional, but also key.
Reviewed By: RSNara
Differential Revision: D16764332
fbshipit-source-id: d56944ef263da3aa1fce3482151c761574a83be6
Summary: RTCConvert was previously imported on each protocol. It was redundant. It's enough to import it once per file
Reviewed By: RSNara
Differential Revision: D16764834
fbshipit-source-id: 9e5dcd52e38dfefa675e3e2c9f2a8f414da1a02c
Summary: Param of function can be optional and it should have impact on native code. Inspired by old codegen
Reviewed By: RSNara
Differential Revision: D16763884
fbshipit-source-id: dab50275f902dbe4af25824bb6128d3b37fc43cd
Summary:
This problem was also affecting Fabric and was fixed in D16708532.
When the image resource is changed and the new image resource fails to load, we expect the display image to fail to load, but the image still shows the image that was successfully loaded last time.
## Changelog
[iOS] [Fixed] - fix display problems when image fails to load
Pull Request resolved: https://github.com/facebook/react-native/pull/25969
Test Plan:
This is catalyst playground with following code P78264143.
TLDR of the code, it sets URL <Image> that is 404.
{F175486515}
Reviewed By: makovkastar
Differential Revision: D16783330
Pulled By: sammy-SC
fbshipit-source-id: 1cb488590ce15d957357f32a73ebf8df6cccf4cd
Summary: This diff adds a feature flag which must be enabled if view managers should be allowed to use a delegate for setting their properties.
Reviewed By: mdvacca
Differential Revision: D16762876
fbshipit-source-id: ae3466d7f02ed02f203dbb79f5e0843e6d9fdd45
Summary: Currently this is the default, but I plan to toggle the default to False shortly. False is better for build speed, as it forces you to separate deps and exported_deps.
Reviewed By: williamtwilson
Differential Revision: D16785991
fbshipit-source-id: 8cb73b87f1dfa50f21c0c12df1579054cdc99e6e
Summary:
This pull request moves `TextInput`'s proptypes to `DeprecatedTextInputPropTypes`. This is in line with what is happening with other components.
## Changelog
[General] [Deprecated] - Moved `TextInput`'s proptypes to `DeprecatedTextInputPropTypes`
Pull Request resolved: https://github.com/facebook/react-native/pull/26042
Test Plan: Flow checks pass.
Differential Revision: D16782322
Pulled By: cpojer
fbshipit-source-id: c5f9caa402c0c5cd878e7fff502d380c7b468cbd
Summary: It's nice to have everything in one place, especially when touching native code where it's a pain to arc focus or buck build another target just to test some other JS.
Reviewed By: yungsters
Differential Revision: D14957052
fbshipit-source-id: fd3c388ab5b193b0fe9cebdc0c81ddbff9a714d4
Summary:
In the jest test renderer, host components have null refs by default. `createAnimatedComponent` tries to access the ref in componentDidMount, which then crashes. This is particularly problematic when trying to update test data:
https://fb.workplace.com/groups/mpen00bs/permalink/494236684721027/?comment_id=510656413079054
Just checking for null fixes the issue and shouldn't affect anything else.
Reviewed By: TheSavior, yungsters
Differential Revision: D16777137
fbshipit-source-id: 0b9f7c5734c849f36318512ceffcc42dd44c58bb
Summary: ModuleRegistryBuilder does as assertion to verify that all `cxxModules` are instances of `CxxModuleWrapperBase::javaStaticClass()`. This assertion is causing the crash in T48554656. Since we don't know which NativeModule is causing this problem, it's difficult to get to the bottom of this. So, for now, I'm improving the assertion message in the hopes that it helps us get to the bottom of this issue.
Reviewed By: mdvacca
Differential Revision: D16774711
fbshipit-source-id: 82318b8ff5ab735ae642da81777c1b5588e8a483
Summary:
This diff adds support to the flow parser to parse object props to the codegen schema
This handles required and optional props, as well as required and optional object properties, WithDefault, enums, etc. Basically everything is supported that is supported at the top level
Reviewed By: TheSavior, osdnk
Differential Revision: D16759198
fbshipit-source-id: 6f501f4738f84f20a940235ba74f7bae93e64eef