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

17543 Коммитов

Автор SHA1 Сообщение Дата
David Vacca 4ab9e2d825 Fix PanResponderExample
Summary: This diff fixes the PanResponderExample in RN Tester app

Reviewed By: shergin

Differential Revision: D16420688

fbshipit-source-id: efdc6b3c82c54a8984a7bb106230d9f832e454dd
2019-07-22 15:39:01 -07:00
David Vacca 2992518b2e Deprecate UIManagerModule.removeSubviewsFromContainerWithID
Summary:
The method UIManagerModule.removeSubviewsFromContainerWithID will not be part of fabric. This diff deprecates it to avoid future usage before the migration.
This can not be removed, as it is currently used from React-VR

Reviewed By: shergin

Differential Revision: D16420687

fbshipit-source-id: a06810cabb434e35e5a371444114db2633a35a29
2019-07-22 15:39:01 -07:00
David Vacca a863949413 Deprecate UIManagerModule.replaceExistingNonRootView
Summary:
The method UIManagerModule.replaceExistingNonRootView will not be part of fabric. This diff deprecates it to avoid future usage before the migration.
This can not be removed, as it is currently used from React-VR

Reviewed By: shergin

Differential Revision: D16420685

fbshipit-source-id: c534e2ee6371698638751f1482bb619db1569733
2019-07-22 15:39:00 -07:00
Eli White c7ee38149d Add command methods to GeneratePropsJavaInterface
Summary: These methods will be called when commands are dispatched.

Reviewed By: JoshuaGross

Differential Revision: D16388806

fbshipit-source-id: a09d257474aa3306b99f8dcdfdd23808f60eb4bd
2019-07-22 12:52:58 -07:00
Peter Argany 7d15a6be2c Remove all calls to bridge.imageLoader [1/N]
Summary: We no longer want to access RCTImageLoader from the bridge category. Instead, let's use the `moduleForClass` API.

Reviewed By: shergin

Differential Revision: D16389113

fbshipit-source-id: c638f4b9851698afc53aaaa2b302d21cc19f76e7
2019-07-22 11:13:51 -07:00
Rick Hanlon 42cf8a9241 Retry add JS view config for View
Summary: Adds the JavaScript view config for View

Reviewed By: TheSavior

Differential Revision: D15862368

fbshipit-source-id: 8a6a77cf57e84744044a2d6034aff2be6e600f5f
2019-07-22 09:30:31 -07:00
Samuel Susla 61b6c851c5 UIManager no longer triggers RCTLogError
Summary: Demote "Unable to find module UIManager" red box error to a warning

Reviewed By: fkgozali

Differential Revision: D16417458

fbshipit-source-id: ae70dffe419580f852db684a2665ccba2038da24
2019-07-22 07:47:41 -07:00
Oleksandr Melnykov a1273bb593 Do not load JS bundle from local cache if Metro is running
Summary: Having a cached JS bundle being loaded instead of loading it from Metro can cause recent changes made with Fast Refresh not to be picked up after an app is killed and started again. This diff makes a change so that we always download the bundle from Metro if it's running and only if it's not running we check if there is a cached recent bundle.

Reviewed By: gaearon, davidaurelio

Differential Revision: D16380243

fbshipit-source-id: b2842f718e0c21a3f4ca5ebeb3c2bae1df87a6e1
2019-07-22 02:49:30 -07:00
Peter Argany 97d3d59077 Comments & category cleanup
Summary: Been reading a lot of code comments getting familiar with Fabric & TM, just fixing a few typos and removing an unused bridge category method.

Reviewed By: shergin

Differential Revision: D16371581

fbshipit-source-id: bf0cc9c873c60e37124dc715c92d7f105e54e42f
2019-07-20 10:41:46 -07:00
Joshua Gross c075a240cd Granularly track perf of Fabric
Summary: Enable granular perf measurements under Fabric.

Reviewed By: mdvacca

Differential Revision: D16021797

fbshipit-source-id: c25a8f7cebf53abfcfc39c8f6d50900813214abb
2019-07-20 01:57:20 -07:00
George Zahariev 9984ac4786 Deploy Flow 0.103 to xplat
Summary:
Deploy Flow 0.103 to xplat

bypass-lint

Reviewed By: panagosg7

Differential Revision: D16374740

fbshipit-source-id: e0d67e0bc9a209dd75d78bcf257c6af821ed04d1
2019-07-19 21:43:05 -07:00
David Aurelio 5ebc0abdb2 Add PhantomRef based YogaNode subclass
Summary: Adds a subclass of `YogaNodeJNIBase` that uses `PhantomReference` for deallocating native memory rather than `Object#finalize()`. This should help making garbage collection more efficient.

Reviewed By: amir-shalem

Differential Revision: D16182667

fbshipit-source-id: d310fdb6af184168c43462b24f5e18ab5d0d7ad0
2019-07-19 17:23:22 -07:00
David Vacca 2b9f7bada3 Add extra debug information in CreateMountItem class
Summary: Easy diff to add extra debug information in the CreateMountItem class. This will be useful to debug bugs in Fabric

Reviewed By: JoshuaGross

Differential Revision: D16381362

fbshipit-source-id: 22073df228908b6c88e6423c4917fc6d64c73f98
2019-07-19 16:32:16 -07:00
Rick Hanlon 32b812c05c Add Java buck tests
Summary: This diff adds some basic tests that ensure all of the e2e test components can compile with the interface is implemented (we also have these tests for cxx)

Reviewed By: JoshuaGross, mdvacca

Differential Revision: D16378756

fbshipit-source-id: d0c6dc976c74f6a388068e66b9a2135bc4ce4652
2019-07-19 15:04:06 -07:00
Rick Hanlon 1783780a92 Add buck rule to generate Java library
Summary: Adds buck rule for generated code

Reviewed By: mdvacca, makovkastar

Differential Revision: D16338763

fbshipit-source-id: 6b238b3993cc110f009ad541cfa924d0d06d2fcb
2019-07-19 15:04:06 -07:00
Rick Hanlon 9a546f5e9e Add GeneratePropsJavaDelegate
Summary: Add GeneratePropsJavaDelegate to the OSS Java codegen

Reviewed By: makovkastar

Differential Revision: D16281330

fbshipit-source-id: 44ffd5757663b68f84dbefcab70b4ca5282d28ba
2019-07-19 15:04:06 -07:00
Rick Hanlon 9830d0d7b7 Add GeneratePropsJavaInterface
Summary: Adds GeneratePropsJavaInterface to the codegen to init open sourcing the Java codegen

Reviewed By: mdvacca, makovkastar

Differential Revision: D16280966

fbshipit-source-id: e3428285562329a22c1710cc7347c31f7c01d9c0
2019-07-19 15:04:05 -07:00
Luis Miguel Alvarado b1bec856c3 update bug_report.md template (#25623)
Summary:
It would be of great help a **screenshot** of the error.
Pull Request resolved: https://github.com/facebook/react-native/pull/25623

Differential Revision: D16384221

Pulled By: hramos

fbshipit-source-id: b455e69e66e95de80a0422c716c37e2630212831
2019-07-19 13:45:09 -07:00
Ramanpreet Nara 355bb05e4c Add NativeModule spec for ShareModule
Summary: This diff introduces NativeShareModule. It also replaces all usages of `NativeModules.ShareModule` with `NativeShareModule`.

Reviewed By: PeteTheHeat

Differential Revision: D16346415

fbshipit-source-id: 654692a82855d6fbd937aa7b9aee3d71a2df0c12
2019-07-19 12:12:14 -07:00
Ramanpreet Nara 452acf8818 Add NativeModule Spec for Vibration
Summary: This diff introduces NativeVibration

Reviewed By: TheSavior

Differential Revision: D16344820

fbshipit-source-id: fe5187a1a500308a41c41272968bea25a5b3ffde
2019-07-19 12:12:14 -07:00
Ramanpreet Nara 6e7b43806d Add NativeModule Spec for ImagePickerIOS
Summary: This diff introduces NativeImagePickerIOS.

Reviewed By: fkgozali

Differential Revision: D16287452

fbshipit-source-id: 80a334887c2155e76ab13e7adffefde258de7cdb
2019-07-19 12:12:13 -07:00
Ramanpreet Nara 9834d866df Add NativeModule Spec for Clipboard
Summary: This diff introduces NativeClipboard.

Reviewed By: PeteTheHeat

Differential Revision: D16283266

fbshipit-source-id: e16e44d0e6364a38f177cdadce71733a3cd001ad
2019-07-19 12:12:13 -07:00
Ramanpreet Nara 3e989b6519 Add NativeModule Spec for AsyncStorage
Summary: Two NativeModules (SQLiteDBStorage on Android and AsyncLocalStorage on iOS) implement the AsyncStorage interface. So, I created one spec file for both.

Reviewed By: fkgozali

Differential Revision: D15804415

fbshipit-source-id: 0c922352378fbdb460839527db3c21387ab16b87
2019-07-19 12:12:12 -07:00
Ramanpreet Nara 929a7cbfbd Add NativeModule Spec for ActionSheetManager
Summary: This diff introduces NativeActionSheetManager.

Reviewed By: fkgozali

Differential Revision: D15803420

fbshipit-source-id: 736e7fb59be7d2bd1db064c33be660c7ccd346f4
2019-07-19 12:12:12 -07:00
Eli White 6f09dc03bf Support View Manager Commands
Summary: Supporting View Manager Commands on the new UIManager in Fabric. This is needed for things like scrollTo on ScrollView.

Reviewed By: JoshuaGross

Differential Revision: D16175575

fbshipit-source-id: a74effdf7e47b56a150a4e3fb6c4d787659e0250
2019-07-19 11:54:44 -07:00
David Aurelio 5ca10c7caa Implement double measure experiment
Reviewed By: SidharthGuglani

Differential Revision: D16340462

fbshipit-source-id: b157d8137c72f83a3bea46f30d0f46f65055f9ef
2019-07-19 10:42:51 -07:00
David Aurelio f68c16e388 Add internal experiments API
Summary: Adds internal API that we can use to conduct experiments.

Reviewed By: SidharthGuglani

Differential Revision: D16340463

fbshipit-source-id: 07a8bb7dbc4a02c5c95f1ad29b18845ab43752cf
2019-07-19 10:42:51 -07:00
Moti Zilberman c5180f4bfb Test more of ExceptionsManager
Summary: Renames `ReactFiberErrorDialog-test` to `ExceptionsManager-test` and adds tests for `console.error` and exceptions not captured by React. Some of this functionality is covered by the RNTester integration tests, but this JS test suite is both more comprehensive and easier to iterate against.

Reviewed By: cpojer

Differential Revision: D16363166

fbshipit-source-id: 32a4b89bb50131fae86e3c03db7eacbbcf86966b
2019-07-19 03:34:40 -07:00
Emily Janzer 305058178e Create binding for unmountComponentAtNode in bridgeless mode
Summary: Right now we register ReactFabric as a callable module with the bridge so that we can call `ReactFabric.unmountComponentAtNode` in `ReactInstanceManager.detachViewFromInstance`. In bridgeless mode we don't have callable modules, so I'm just setting a global variable that can be called from C++ instead. Using this in a new `unmount` method in FabricUIManager.

Reviewed By: shergin, mdvacca

Differential Revision: D16273720

fbshipit-source-id: 95edb16da6566113a58babda3ebdf0fc4e39f8b0
2019-07-18 14:14:57 -07:00
Samuel Susla 18c0087d44 Remove remainings of experiment from ParagraphShadowNode
Summary:
Remove check whether `measureCache_` is nullptr. It was part of the experiment
which is no longer running.

Reviewed By: shergin

Differential Revision: D16360332

fbshipit-source-id: 2fc8baa93a87754da6255bf1c134901447349f7a
2019-07-18 13:17:14 -07:00
Samuel Susla ec2bf94266 Fix incorrect information in comment
Summary: `RCTActivityIndicatorViewComponentView` is a component for `ActivityIndicator` not for `ShimmeringView`.

Reviewed By: cpojer

Differential Revision: D16360505

fbshipit-source-id: d6f7685eea24060c9e1b43d5782a65396d6c375e
2019-07-18 11:15:58 -07:00
Dan Abramov e9d20eafa7 Remember and surface compile errors when turning on
Summary: When turning on Fast Refresh, we might have a compile error in previously saved files. We used to ignore it until a file is saved again, leading to a confusing experience. This changes it so that we remember the last compile error, and show it _either_ when we get it (if Fast Refresh is off), or when we _turn it on_.

Reviewed By: cpojer

Differential Revision: D16359160

fbshipit-source-id: 8dc237563c2a271a23019a32ff85b57de99cfabe
2019-07-18 11:11:30 -07:00
Dan Abramov d5e49bdd05 Add `isInitialUpdate` to HmrServer
Summary: Right now we are using a local boolean and `bundle-registered` to hide the "Refresh" banner on the first update from the server (right after loading the bundle). This change adds `isInitialUpdate` to the `update-start` message which I'm now using to disable the banner. This also simplifies the HMRClient a little bit.

Reviewed By: cpojer

Differential Revision: D16357287

fbshipit-source-id: 29e72774989c4ba895a85be06a366e1b2fe7c02f
2019-07-18 11:11:30 -07:00
Dan Abramov 7c7fe1caae Stash updates when Fast Refresh is off
Summary:
If you change a file while Fast Refresh is off, this now stashes an update instead of ignoring it. When/if you turn it on, we will apply those stash updates. This solves the confusion that can happen when you enable it midway after making a bunch of changes, and therefore makes the experience more reliable.

**This current implementation is unfortunate because the app memory load increases with the number of file saves. This isn't really sustainable. So in the next diff I will change it to only remember the *latest versions* of every edited file instead.**

Reviewed By: cpojer

Differential Revision: D16344332

fbshipit-source-id: 69609a00eb9022f6b2797269fa091fa1b4125dd1
2019-07-18 11:11:29 -07:00
Dan Abramov e6d32d8a49 Register the bundle regardless of whether Fast Refresh is on
Summary:
We want to move to a world where Fast Refresh is on by default. As a first step, we can register the bundle early. This means we'll start receiving hot updates via the socket even if Fast Refresh is off. We'll just be ignoring those.

Anecdotally people with Fast Refresh on have had good experience even with invasive changes like branch switches. So this seems like a good way to test the waters further. It's also a prerequisite to unlocking a nicer experience where you can turn it on anytime and "catch up" on the changes you've missed. (That's out of scope of this diff.)

Reviewed By: cpojer

Differential Revision: D16344019

fbshipit-source-id: 6e5f8278909810b32c80e0af010251c876e4313b
2019-07-18 11:11:29 -07:00
Dan Abramov 295affc8ab Refactor the socket client API
Summary:
Two changes:

1. `disable` -> `close` to better match what's happening.

2. `enable` is inlined in the constructor because it's always called right after the constructor.

Reviewed By: rickhanlonii

Differential Revision: D16340009

fbshipit-source-id: 38a906b1ab3f5b39a57d2598ba400a2f03903951
2019-07-18 11:11:29 -07:00
Jan Kassens c13e5d0b43 fix jest's test.table flow type
Summary:
The current flow type disallows passing in an `Array<string>` since the current
type signature would allow just to append to the `Array`, `$ReadOnlyArray`
doesn't allow writing.

@public

Reviewed By: jstejada

Differential Revision: D16354977

fbshipit-source-id: a83c1227c1a15225487ac8672818d8b319dce32f
2019-07-18 09:38:47 -07:00
Moti Zilberman 5029195d22 Test ReactFiberErrorDialog in terms of NativeExceptionsManager
Summary:
https://github.com/facebook/react-native/pull/25671 added a shallow unit test for `ReactFiberErrorDialog`, mocking out the (JS) `ExceptionsManager` module. This rewrites that test in terms of `NativeExceptionsManager` instead, so the integration with `ExceptionsManager` is also tested.

Also adds tests for the behaviour of the `framesToPop` and `jsEngine` extended error fields, and for passing a frozen error object (seeing as we potentially mutate the error).

Reviewed By: rickhanlonii

Differential Revision: D16330341

fbshipit-source-id: 0b514d1c8f193a114748739ec31ddb4e06e4d2fd
2019-07-18 07:50:39 -07:00
Samuel Susla c914dfb8d3 Fix missing base64 images
Summary:
I discovered failing snapshot tests (T47222928, T47222859). They fail because `<Image>` doesn't work with base64 anymore.

There are two problems that are causing this.

1st is on iOS https://fburl.com/pw246vgw where if the image has 1 frame count, nothing is displayed.

2nd is in https://fburl.com/3im0u38r where if image is not within assets, we don't display it.

Reviewed By: shergin

Differential Revision: D16334151

fbshipit-source-id: 1ea8ef676b7207834ba63f4264e6ef2f05f24b96
2019-07-18 07:21:25 -07:00
Sidharth Guglani 86b671fdbc using enum struct for LayoutPassReason and LayoutType
Summary: Using enum struct for using enums in form ENUM_NAME::ENUM_VALUE for better code readablility

Reviewed By: davidaurelio

Differential Revision: D16356562

fbshipit-source-id: cbe7adadad78eb5d0756c44679c0e102b7d31ec6
2019-07-18 07:05:09 -07:00
Uladzislau Paulovich 45a4bec60c yoga | Fix error about implicit conversion to bit-field
Summary:
`YGStyle` puts Yoga enums (which are signed integers by default) into bitfields: https://fburl.com/7fowlunu

Mixing signed values and bit-fields can be error-prone and it also fails to build on Windows with `clang-cl` due to `-Wbitfield-constant-conversion` warning being treated as error:

```
stderr: In file included from xplat\yoga\yoga\YGLayout.cpp:8:
In file included from xplat\yoga\yoga/Utils.h:8:
In file included from xplat\yoga\yoga/YGNode.h:13:
xplat\yoga\yoga/YGStyle.h(110,9): error: implicit truncation from 'YGAlign' to bit-field changes value from 4 to -4 [-Werror,-Wbitfield-constant-conversion]
        alignItems_(YGAlignStretch),
```

This diff fixes the problem by making all enums unsigned integers. This change can be problematic only if values of the enums are serialized somewhere. CC: David Aurelio

Reviewed By: davidaurelio

Differential Revision: D16336729

fbshipit-source-id: ee4dabd7bd1ee429e644bd322b375ec2694cc742
2019-07-18 06:20:35 -07:00
David Aurelio 341b509437 Include headers in `fbjni/`, too (#25711)
Summary:
Adds headers in `fb/include/fbjni` to `//ReactAndroid/src/main/jni/first-party/fb:jni`, as these are needed by Yoga now

Fixes compilation of Yoga, after Yoga upgraded its internal copy of *fbjni* and changed header include paths.

## Changelog

[Android] [Fixed] - Fixes compilation of Yoga
Pull Request resolved: https://github.com/facebook/react-native/pull/25711

Test Plan:
```
$ buck build //ReactAndroid/src/main/jni/first-party/yogajni:jni
Invalidating internal cached state: Watchman failed to start. This may cause slower builds.
Parsing buck files: finished in 0.5 sec
Building: finished in 2.2 sec (100%) 8/8 jobs, 8 updated
  Total time: 2.9 sec
```

Reviewed By: SidharthGuglani

Differential Revision: D16357020

Pulled By: davidaurelio

fbshipit-source-id: 4a97c0d35ebf65412a661ae291b3110bcfba6467
2019-07-18 05:27:22 -07:00
Sidharth Guglani 87aca7ed74 Pass reason for measure pass along with measurecallbackend event (#566)
Summary:
Pull Request resolved: https://github.com/facebook/litho/pull/566

Pull Request resolved: https://github.com/facebook/react-native/pull/25702

Pass reason for each measure callback to the flipper plugin

Reviewed By: davidaurelio

Differential Revision: D16221771

fbshipit-source-id: 2e72e1ebb3c7e633d189e7a7a81d655ac9531e51
2019-07-18 05:21:15 -07:00
Dominique d'Argent b07bbab392 Remove markerNote from JS bindings
Summary: This diff removes the unused `markerNote` method from QPL.

Differential Revision: D16331769

fbshipit-source-id: c35006af03d6129dc690cfd05bc1bc1c4a0856ba
2019-07-18 03:52:44 -07:00
Michał Pierzchała fafe5ee072 - Bump CLI to ^2.6.0 (#25666)
Summary:
Bumps CLI to the latest, including automatic jetifier, prettierrc in template and more: https://github.com/react-native-community/cli/compare/v2.2.0...v2.6.0

## Changelog

[Internal] [Changed] - Bump CLI to ^2.6.0
Pull Request resolved: https://github.com/facebook/react-native/pull/25666

Test Plan: CI passes

Differential Revision: D16279319

Pulled By: cpojer

fbshipit-source-id: d84e2e69a310ac3ef5722c22a17b12926a073097
2019-07-18 03:21:28 -07:00
Christoph Nakazawa d974793b59 Add a loading bar when loading split bundles
Summary:
This adds a loading indicator when loading split bundles so that users get a visual indicator about what is going on.

Note that I am currently trying to get the dynamic message that shows the number of modules and percentage to work but it appears that the JavaScript networking client (XMLHttpRequest + RCTNetwork) are not set up to deal with multipart responses in the same way as our native multipart handlers are. I'd like to put this in place now and polish it later if it's possible to fix the issue (I spent all afternoon yesterday trying to make multipart messages work and failed :( ).

Reviewed By: gaearon

Differential Revision: D16281531

fbshipit-source-id: 84e53d7f25642398ed51d8f552919880b8090897
2019-07-18 03:06:49 -07:00
Christoph Nakazawa ba8f88d1ab Rename HMRLoadingView to LoadingView
Summary:
This view will be re-used for bundle splitting so I'm changing the name to be more generic as it can be used for informing users of any loading activity.

I also cleaned up the files a bit from a class to just an object.

Reviewed By: gaearon

Differential Revision: D16281367

fbshipit-source-id: 5c2ee7790d29ccba473bd6e90737d2f0581e6291
2019-07-18 03:06:49 -07:00
Christoph Nakazawa 93bebf146f Switch HMR connection to register bundle entry points via a message
Summary:
This diff builds on the previous ones and changes the setup process from using the WebSocket URL to using a message that is sent after the connection is established. It also exposes a function on the HMRClient that allows registering more bundles, which I will make use of in the next (and hopefully final :D ) diff.

I was initially planning on using structured data, like `{bundleName, platform}` but decided to keep using URLs as that is the format used throughout Metro. In fact, when we parse the options from the URL, we need to re-encode the input URL to create the `sourceMapUrl`. I thought it doesn't make sense to write more code to send structured data over the connection only to re-construct a URL on the server manually.

Finally, I also slightly modified the "Internal Bundler" error that is shown in a RedBox (now used by the websocket connection if an invalid message is received). I removed the "internal" wording from the message and I'm actually attaching the failure message to the error instead of directing users to the Terminal.

Reviewed By: gaearon

Differential Revision: D16162729

fbshipit-source-id: 977fde5f6c2f1c14efb4fd99ed30a6bf95a3b13e
2019-07-18 03:06:48 -07:00
David Vacca c8ec2ae60c Delete method MountingManager.removeRootView
Summary:
The method MountingManager.removeRootView is not used anymore D16275118, I'm deleting from MountingManager

motivation: cleanup as I'm fixing other bugs in Fabric

Reviewed By: ejanzer

Differential Revision: D16350582

fbshipit-source-id: 488cf2aa2feda78e6660a854af5da2718f9905de
2019-07-17 18:21:22 -07:00
Riley Dulin c24387e45c Use UTF-8 instead of ASCII for setting object properties from folly::dynamic
Summary:
Based on Hermes Issue: https://github.com/facebook/hermes/issues/47
It was not actually a bug in Hermes, but a bug in JSI, assuming that all string property names from
`folly::dynamic` are ASCII.

Now we'll be more intentional and directly state `forUtf8` rather than the implicit ASCII encoding.

Reviewed By: mhorowitz

Differential Revision: D16347857

fbshipit-source-id: 6bcfbf9f918dc0a7a485b88a1b537d6c2dd322cc
2019-07-17 17:05:47 -07:00