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
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
Summary: These methods will be called when commands are dispatched.
Reviewed By: JoshuaGross
Differential Revision: D16388806
fbshipit-source-id: a09d257474aa3306b99f8dcdfdd23808f60eb4bd
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
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
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
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
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
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
Summary: Adds GeneratePropsJavaInterface to the codegen to init open sourcing the Java codegen
Reviewed By: mdvacca, makovkastar
Differential Revision: D16280966
fbshipit-source-id: e3428285562329a22c1710cc7347c31f7c01d9c0
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
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
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
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
Summary: Adds internal API that we can use to conduct experiments.
Reviewed By: SidharthGuglani
Differential Revision: D16340463
fbshipit-source-id: 07a8bb7dbc4a02c5c95f1ad29b18845ab43752cf
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
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
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
Summary: `RCTActivityIndicatorViewComponentView` is a component for `ActivityIndicator` not for `ShimmeringView`.
Reviewed By: cpojer
Differential Revision: D16360505
fbshipit-source-id: d6f7685eea24060c9e1b43d5782a65396d6c375e
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
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
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
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
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
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
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
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
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
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
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
Summary: This diff removes the unused `markerNote` method from QPL.
Differential Revision: D16331769
fbshipit-source-id: c35006af03d6129dc690cfd05bc1bc1c4a0856ba
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
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
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
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
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