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

17787 Коммитов

Автор SHA1 Сообщение Дата
Chet Corcos 81733d9e15 Don't call sharedApplication in App Extension (#26077)
Summary:
Related to this bug: https://github.com/facebook/react-native/pull/25769

Note I also had to add to the bottom of my podfile because RCTLinking had APPLICATION_EXTENSION_API_ONLY='YES' by default somehow.

```
post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'
    end
  end
end
```
Pull Request resolved: https://github.com/facebook/react-native/pull/26077

Test Plan: Sandcastle should be sufficient.

Reviewed By: shergin

Differential Revision: D16860356

Pulled By: sammy-SC

fbshipit-source-id: 02cb3fd3f977420ccdc2991f0c3666ab0186b7bf
2019-08-19 02:49:59 -07:00
Tim Yung 9a3d722ccb RN: Delete Long Press Error in Touchable
Summary: This error is not actionable or valuable right now.

Reviewed By: cpojer

Differential Revision: D16859423

fbshipit-source-id: b25504a9556b4d3102b35b2bffcd2d01566e0399
2019-08-16 10:53:23 -07:00
Christoph Nakazawa 88d0ac17e8 Metro Bundler -> Metro
Summary: This bothers me, we renamed the project to drop the "Metro" a while ago.

Reviewed By: rubennorte

Differential Revision: D16831281

fbshipit-source-id: bb6de412eccda61b617580f3660e3e635f2d2815
2019-08-16 10:37:10 -07:00
Christoph Nakazawa bb625e5238 Remove the native delta client from Android
Summary: This was an experiment to patch individual deltas in development instead of reloading the whole JS bundle. With improvements such as Fast Refresh that reduces the need for reloads and bundle splitting that reduces the number of modules and memory by 10x, we won't be needing this complex optimization that we never properly made work. This diff removes that code and I will be removing the JS side of things in Metro in a follow-up diff.

Reviewed By: fkgozali

Differential Revision: D16832709

fbshipit-source-id: 46596a3126d52d7d74f4b9ffc9a6ee9d82ec9522
2019-08-16 10:02:46 -07:00
Peter Argany 6991e28653 Move RCTExceptionsManager to CoreModules and make it conform to spec
Summary:
`NativeExceptionsManager.js` contains the JS spec for this native module. This diff moves the objc code to CoreModules (since it's the only directory that supports TM at the moment) and makes it conform to the spec.

NOTE: I will update podfiles after this diff is reviewed, before I land. Adding those generated changes makes it really hard to review.

Reviewed By: RSNara

Differential Revision: D16812212

fbshipit-source-id: 38b6e9a20ce15e7e9995df34493b37ed7adb2911
2019-08-15 20:25:23 -07:00
Marc Horowitz 111cb32382 Fix BUCK-related React Native CI failures
Reviewed By: cpojer

Differential Revision: D16812633

fbshipit-source-id: 50de7603fbb514ff1c3bb6c5fa6afd579d8a20b8
2019-08-15 14:48:18 -07:00
Peter Argany 0b3aeec56e Pass RuntimeExecutor into RCTSurfacePresenter
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
2019-08-15 11:33:37 -07:00
Peter Argany a380f0f3bc Pass RCTImageLoader into RCTSurfacePresenter [5/N]
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
2019-08-15 11:33:37 -07:00
Peter Argany 30c1196d7d Convert RCTImageLoader to TurboModules [4/N]
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
2019-08-15 11:33:37 -07:00
Eli White 6c3b01d07f Add support for spread with ReadOnlyArray
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
2019-08-15 11:29:20 -07:00
Joshua Gross c8b9a3f8e2 Support Double in when generating props for .h files, in parsing component props, and for commands and events
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
2019-08-15 10:18:16 -07:00
Michał Osadnik 269ea48822 Split buck rules for component and modules
Summary: Split buck rules for component and modules for our further convenience

Reviewed By: rickhanlonii

Differential Revision: D16803703

fbshipit-source-id: c01fb97875b43be4020edd054cad538ec8ed6861
2019-08-15 07:54:34 -07:00
Michał Osadnik 996ea88dc3 Add error message for paring unnamed params
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
2019-08-15 07:54:34 -07:00
Rick Hanlon 958b7aa9aa Add e2e tests for array object props
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
2019-08-15 06:38:15 -07:00
Rick Hanlon 86eb4c7f62 Parse $ReadOnlyArray<$ReadOnly{}> props
Summary: Add flow type parsing for `$ReadOnlyArray<$ReadOnly<{}>>`

Reviewed By: TheSavior

Differential Revision: D16814261

fbshipit-source-id: 9442916f5d31f6d27f560332aee311b3ad8f0864
2019-08-15 06:38:15 -07:00
Rick Hanlon 243ccc541e Generate array<object> props
Summary: Adds the cxx generators for arrays of object props

Reviewed By: JoshuaGross, TheSavior

Differential Revision: D16814136

fbshipit-source-id: fa4600f60c063bfb460033f5fde43e26c04b5a3b
2019-08-15 06:38:15 -07:00
Rick Hanlon bc1c7b1096 Add array<object> props to schema
Summary: Adds arrays of objects to the codegen schema

Reviewed By: motiz88

Differential Revision: D16814117

fbshipit-source-id: 10b20446f7aac5dccc3d2cb148891a134d136d3f
2019-08-15 06:38:14 -07:00
Rick Hanlon 70fc54a20b Add e2e test for object props
Summary: Adds e2e tests for cxx and java object props

Reviewed By: JoshuaGross

Differential Revision: D16759242

fbshipit-source-id: 2307dc4b3ba26222de510cf5876c582d35fc665c
2019-08-15 06:38:14 -07:00
Rick Hanlon 56f9eb35da Add Object props support for cxx
Summary: Adds ability to codegen object props to cxx by generating the cxx structs and conversion functions |

Reviewed By: JoshuaGross

Differential Revision: D16759170

fbshipit-source-id: 7437421e59f4be42fbcd4cddc2e0ed513ae71d08
2019-08-15 06:38:14 -07:00
Pascal Hartig 35fc0add2d Remove vendored proguard annotation (#26069)
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
2019-08-15 06:04:16 -07:00
Oleksandr Melnykov a206e91907 Generate super call to BaseViewManagerDelegate if delegate has no props
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
2019-08-15 03:27:13 -07:00
Rodrigo Salazar 0cf1c6df0b add the jni initializer to the build for sampling profiler
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
2019-08-15 02:52:54 -07:00
empyrical 0057cc9bf2 Deprecate Text proptypes (#26055)
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
2019-08-14 17:34:07 -07:00
Eli White 51133235e0 Add failure tests for duplicate props with the same name
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
2019-08-14 16:11:05 -07:00
Eli White ac6c747aac Support deeply nested spreads
Summary: Apparently I missed one more edge case. Thanks Josh for flagging!

Reviewed By: JoshuaGross

Differential Revision: D16813354

fbshipit-source-id: 6b59bc7b18184e3aa437c3b038ffd22b0fc0ba6a
2019-08-14 16:11:04 -07:00
Eli White 9ae866c072 Support spreading locally defined types deeply
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
2019-08-14 16:11:04 -07:00
Eli White 0a3967480e Support spreading locally defined types
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
2019-08-14 16:11:04 -07:00
Joshua Gross a02176e2ec Add support for `Double` prop type
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
2019-08-14 15:33:41 -07:00
Ramanpreet Nara bf78d7969a Migrate RCTImage NativeModules to CoreModules
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
2019-08-14 13:39:30 -07:00
David Vacca 441c00abc9 Revert D16543433: [Fabric][JS] Use SoundManager in Pressability and Touchable
Differential Revision:
D16543433

Original commit changeset: a2ba060bc480

fbshipit-source-id: 0ba31019fb7a9e77577e495782a3b10029575d22
2019-08-14 13:32:56 -07:00
David Vacca 9dbe5e241e Use SoundManager in Pressability and Touchable
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
2019-08-14 12:38:36 -07:00
Eli White 9a31fa5fd6 Delete ensureComponentIsNative.js
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
2019-08-14 11:46:58 -07:00
empyrical d00f0882fb Add documentation to TextInput's Flow types (#26054)
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
2019-08-14 11:33:14 -07:00
Michał Osadnik a5ea7200da Omit getConstants for codegening if object is empty
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
2019-08-14 05:00:09 -07:00
Michał Osadnik c0304aaa9b Add setMethodArgConversionSelector
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
2019-08-14 05:00:09 -07:00
Michał Osadnik 40dd48c6bd Fix name of key obtaining from dictionary in inline method in generated objcpp
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
2019-08-14 05:00:09 -07:00
Michał Osadnik 024ce5d1d4 Change type of params in methods' protocols to nongeneric
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
2019-08-14 05:00:08 -07:00
Michał Osadnik d3c30cdfe1 fix optional key in structs in new codegen
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
2019-08-14 05:00:08 -07:00
Michał Osadnik 99614497f4 Remove multiple RTCConvert import
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
2019-08-14 05:00:08 -07:00
Michał Osadnik 4a9035aa65 hadle nullable params in generated objcpp
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
2019-08-14 05:00:08 -07:00
Oleksandr Melnykov a5aaca7d4f Migrate RCTAxialGradientView to JS codegen
Summary:
This diff migrates `RCTAxialGradientView` to use generated `RCTAxialGradientViewManagerDelegate` for setting its props. The following base properties have been added to `BaseViewManager`:

```
  protected void setBorderRadius(T view, float borderRadius) {}

  protected void setBorderBottomLeftRadius(T view, float borderRadius) {}

  protected void setBorderBottomRightRadius(T view, float borderRadius) {}

  protected void setBorderTopLeftRadius(T view, float borderRadius) {}

  protected void setBorderTopRightRadius(T view, float borderRadius) {}
```

Reviewed By: JoshuaGross, mdvacca

Differential Revision: D16784173

fbshipit-source-id: f3971985efee2b6e0a5fb248b89c4809305e670c
2019-08-14 04:44:12 -07:00
jsfu 71d7d6883c fix display problems when image fails to load (#25969)
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
2019-08-14 03:35:14 -07:00
Oleksandr Melnykov 639da37dc5 Use feature flag to enable view manager delegates for setting props
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
2019-08-14 03:30:14 -07:00
Joshua Gross 825e1c087c Commands: support Float arguments
Summary: Support codegen'ing commands with Float arguments.

Reviewed By: mdvacca

Differential Revision: D16785534

fbshipit-source-id: 8174ae40762c1114b87a023cb2b69b2515dc6e23
2019-08-13 13:37:24 -07:00
Adam Ernst 724fe11472 Add reexport_all_header_dependencies to (yet more) misc rules
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
2019-08-13 11:14:06 -07:00
Vojtech Novak 8a82503b54 fix SectionList scrollToLocation and prevent regressions (#25997)
Summary:
Recently there were quite a few changes to this functionality, and they caused breakages

https://github.com/facebook/react-native/issues/21577
https://github.com/facebook/react-native/issues/24034
https://github.com/facebook/react-native/issues/24734
https://github.com/facebook/react-native/issues/24735

Currently,  whichever `viewOffset` I pass, it will be overridden (either by 0 or something computed in the if body). This fixes the issue and also adds tests to make sure there is no regression.

## Changelog

[Javascript] [Fixed] - VirtualizedSectionList scrollToLocation viewOffset param ignored
Pull Request resolved: https://github.com/facebook/react-native/pull/25997

Test Plan: tests pass

Differential Revision: D16784036

Pulled By: cpojer

fbshipit-source-id: 46421250993785176634b30a2629a6e12f0c2278
2019-08-13 07:52:54 -07:00
empyrical 427b54eef6 Move TextInput PropTypes to Deprecated PropTypes (#26042)
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
2019-08-13 03:36:58 -07:00
jeswinsimon e104204ae0 URL: Do not prepend baseUrl if the URL is not a relative URL (#26009)
Summary:
Fix for bug https://github.com/facebook/react-native/issues/26006 URL with base is always used, even when absolute URL is provided

## Changelog

[Javascript] [Fixed] - `URL`: Base url value is ignored when the input url is not a relative url.
Pull Request resolved: https://github.com/facebook/react-native/pull/26009

Test Plan:
`new URL('http://github.com', 'http://google.com')` now returns `http://github.com/`
Added a test case to `URL-test.js` to verify the same.

Differential Revision: D16781921

Pulled By: cpojer

fbshipit-source-id: 038aca3610e34f513f603e8993f9a925b7d28626
2019-08-13 02:55:21 -07:00
Spencer Ahrens 450e4a7cb3 Add RNTester and UITestBed as dev routes in main apps
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
2019-08-12 21:12:57 -07:00
Spencer Ahrens a9c8103baa Fix jest test crashes with animated components
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
2019-08-12 20:44:50 -07:00