Summary: This fixes the following warning from appearing when you have a FlatList render a Modal where the content of the Modal also contains a FlatList: https://fburl.com/p953k985. Spencer addressed an issue similar to this in D7863625, but we still get a yellow box due to the fact that `scrollContext` still exists, but `this.context.virtualizedList` is null from this line in Modal.js https://fburl.com/nqc261a1.
Reviewed By: cpojer
Differential Revision: D16160666
fbshipit-source-id: ba222d3eef234f4c8c4c2bddbc71bec27df81e0a
Summary: TurboModule is now included by default, so no need to have a toggle in autolink script anymore.
Reviewed By: mdvacca
Differential Revision: D16173820
fbshipit-source-id: 215ce7d188ce526b5a71df881bdc992c1ef34b34
Summary:
This is the first step towards fixing https://github.com/facebook/react-native/issues/25349. These are the changes to the podspec to correctly update dependencies and build config that will cause any breaking change for users or libraries.
I am breaking these changes out from https://github.com/facebook/react-native/pull/25393 as suggested by fkgozali in https://github.com/facebook/react-native/pull/25393#issuecomment-508322884.
These are the changes:
- Made C++ headers in `React-Core` private by default so that ObjC files can import the module without failures.
- Reduced the number of `yoga` headers that are exposed for the same reason as above. As far as I can see this doesn't cause issues but we can find another solution if it does.
- Adding some missing dependencies to fix undefined symbols errors.
- Added `DoubleConversion` to `HEADER_SEARCH_PATHS` where it was missing.
## Changelog
[iOS] [Fixed] - Updated podspecs for improved compatibility with different install types.
Pull Request resolved: https://github.com/facebook/react-native/pull/25496
Test Plan:
Everything should work exactly as before. I have a branch on my [sample project](https://github.com/jtreanor/react-native-cocoapods-frameworks) here which points at this branch to show that it is still working `Podfile` to demonstrate this is fixed.
You can see that it works with these steps:
1. `git clone git@github.com:jtreanor/react-native-cocoapods-frameworks.git`
2. `git checkout podspec-updates`
3. `cd ios && pod install`
4. `cd .. && react-native run-ios`
The sample app will build and run successfully.
Reviewed By: mmmulani
Differential Revision: D16167346
Pulled By: fkgozali
fbshipit-source-id: 1917b2f8779cb172362a457fb3fce686c55056d3
Summary: That should help to fail early in situations when we lose critical class data members.
Reviewed By: sammy-SC
Differential Revision: D16179539
fbshipit-source-id: da73b81568c2f3657b9bc2bd1cc7ee6624e75626
Summary: This is a very similar mechanism that we use in UIManager and it should be eventually unified.
Reviewed By: sammy-SC
Differential Revision: D16179524
fbshipit-source-id: 7c8c45b7581ac4a1db3a773d62004ff368f18321
Summary: Adds Baseline start and end events to be handled later for instrumentation
Reviewed By: davidaurelio
Differential Revision: D16048790
fbshipit-source-id: 8409dbb633168753a7bf8fab20bc6551d113ddd6
Summary: Using layoutPassStart and LayoutPassEnd events instead of YGMarkerLayout for instrumentation
Reviewed By: davidaurelio
Differential Revision: D16048789
fbshipit-source-id: 041a35bc2cb1b7281ca83cf9d35041b4011cfeb9
Summary: We have exactly same code in classic RCTScrollView component. We need that to not interfere with iOS automagical behaviours.
Reviewed By: sammy-SC
Differential Revision: D16160846
fbshipit-source-id: 5b5affcc64abe5e3204f619216412f9da5b03b78
Summary:
We are running into some problems with the spread operator. The solution is to ask for a newer minimum babel version.
See https://github.com/babel/babel/issues/10179
Note: this doesn't actually change behavior. When creating a new app a new babel version will already be used. This simply ensures that the minimum version fulfills the requirements.
Reviewed By: axe-fb
Differential Revision: D16181111
fbshipit-source-id: f5207318b3a7bd9f092c0e64a8065d0f713012da
Summary:
This diff includes minor codestyle changes.
All these fixes was discussed with Rick.
Reviewed By: rickhanlonii
Differential Revision: D16169332
fbshipit-source-id: e561e2f2b116b6fdf8434c3dfc20c3e610d7ecad
Summary:
returning type of Bubbling and Direct Event should be always void of Promise (if async). Other situations shouldn't be permitted.
Reformated all cases when it the function wasn't void.
Reviewed By: rickhanlonii
Differential Revision: D16165962
fbshipit-source-id: 7c1377c3ed4bd54a431a13e5bcda4f7ec0adf4dc
Summary: This diff fixes a potential memory leak which can occur if an exception is thrown inside the try block and `outputStream.close()` is not called. By wrapping `outputStream.write(data)` inside try-with-resource we guarantee that outputStream will be closed regardless of whether the try statement completes normally or abruptly.
Reviewed By: sammy-SC
Differential Revision: D16148850
fbshipit-source-id: c5c0a78b36375857f6e717bb581e8686a4a94bb9
Summary:
I'd like to use `Modal`’s flow types in my application to make a reusable component.
## Changelog
[JavaScript] [Added] - Exported `Modal`’s types
Pull Request resolved: https://github.com/facebook/react-native/pull/25554
Test Plan: n/a
Differential Revision: D16180231
Pulled By: cpojer
fbshipit-source-id: 9cfd5163a187954783102bfe4d9b4d1dbc8c6e6d
Summary: It's pointless to handle non optional key if value has withDefaul so I'm adding a rule into parser preventing from such cases
Reviewed By: lunaleaps
Differential Revision: D16166709
fbshipit-source-id: 38cef522b217917a3a4886d857720932f2ebb475
Summary:
This removes the `--projectRoot` flag in `launchPackager.bat` as it was removed, fixing [this bundler not opening issue on cli repo](https://github.com/react-native-community/cli/issues/484) when `yarn react-native run-android` is run.
This is Windows related only so should be only tested on Windows.
## Changelog
[Internal] [Fixed] - Fixed Metro Bundler not opening when running `yarn react-native run-android`
Pull Request resolved: https://github.com/facebook/react-native/pull/25517
Test Plan:
1. Create a new repo using `react-native init`
2. Edit the `launchPackager.bat` file
3. Run `yarn react-native run-android`
Differential Revision: D16162108
Pulled By: cpojer
fbshipit-source-id: c12d9853ad49f00d56b9a8254a5b2c40a358cb2e
Summary: This diff changes a few things around so that a diff coming on top of this stack will be smaller. The aim of this change is to add a method `registerEntryPoint` which will allow a client to subscribe to updates for multiple bundles.
Reviewed By: gaearon
Differential Revision: D16131963
fbshipit-source-id: d460d6647b15a711021c7a3a51f52486a1aea535
Summary:
[Android] [Added] - Release underlying resources when JS instance is GC'ed on Android
D15826082 was reverted because it introduced a crash in Ads Manager for Android (see P67222724).
This diff fixes the crash and re-applies D15826082. The problem was that `jni::findClassStatic` in the destructor of BlobCollector.cpp couldn't find the Java class `com/facebook/react/modules/blob/BlobModule` and crashed the app.
JNI didn't seem to have access to the Java class loader probably because the destructor was called from a non-Java thread (https://our.intern.facebook.com/intern/wiki/Fbjni/environment-and-thread-management/?vitals_event=wiki_click_navigation_link#threads). The fix is to wrap the code in the destructor inside `ThreadScope::WithClassLoader `, which will allow to run code that has full access to Java as though you were running in a Java thread.
Reviewed By: shergin
Differential Revision: D16122059
fbshipit-source-id: 12f14fa4a58218242a482c2c3e2149bb6770e8ec
Summary: Accessibility is essential but seems we don't have any use of AccessibleShadowNode in Fabric.
Reviewed By: sammy-SC
Differential Revision: D16139595
fbshipit-source-id: a6aec6d22c4a6050d7ee5e6b21ef4ad04d80ffce
Summary:
The instrumentation header only needs the forward declarations for ostream, so
we can use just include `iosfwd`, as suggested by Riley in an earlier diff.
Reviewed By: kodafb
Differential Revision: D16152451
fbshipit-source-id: 2afbc40e623b180dfc5917fc8093ab15bf647968
Summary:
@public
The `WritableArray` and `WritableMap` interfaces currently require that nested arrays and maps also be writable. Nothing in our code actually relies on this, so we can relax this restriction and get useful properties.
For instance, it is now possible to construct a `JavaOnlyMap` (or array) that reuses `ReadableMap` and `ReadableArray` values by reference ( = structural sharing) instead of forcing a deep copy.
Reviewed By: kathryngray
Differential Revision: D16132580
fbshipit-source-id: 9f41189ebea2a82e775a7a4da8c357a5ce9c5b9d
Summary:
@public
* Removes `JsonWriter`; it's apparently a buggy fork of [`android.util.JsonWriter`](https://developer.android.com/reference/android/util/JsonWriter) which has existed since API level 11. Our version doesn't insert commas before objects or arrays within an array. Instead of fixing it, we can just use the Android one.
* Extends `JsonWriterHelper` to support serialising `ReadableMap`, `ReadableArray` and `Dynamic` values into a `JsonWriter`.
Reviewed By: kathryngray
Differential Revision: D16131713
fbshipit-source-id: d258af42b669f10218cae8b086e7adc3226d16c0
Summary: This part of writing codegen was straightforward. I've added check for 'FunctionTypeAnnotation' and then reuse exisiting methods' parser for generating schema for callback.
Reviewed By: TheSavior
Differential Revision: D16131213
fbshipit-source-id: 2ec0e241f2174dee3a93857563db0626013d004e
Summary:
I'm not very confident with this part, but actually in existing codegen we wrap param into another object marked as `NullableTypeAnnotion`. It makes logic a little more complicated. Also it allows for multiple `?` before type which is useless in code generation as well as nullable types inside arrays which also does not have impact on a final code generation.
I suggest adding `nullable` field into param which covers all existing cases (and probably all cases needed).
Reviewed By: TheSavior
Differential Revision: D16121609
fbshipit-source-id: 6e086d4d26bbd0aab3015ec7ecae106ebbaa5a2c
Summary: Add support for Object reusing mostly the code for arrays
Reviewed By: TheSavior
Differential Revision: D16122314
fbshipit-source-id: c1b201c659e6fdc98bed553fb16280ed5ce9e647
Summary: This implementation is a bit different than current one since previously object annotation was always wrapped into `GenericTypeAnnotation` object which is not needed in every of current use cases.
Reviewed By: TheSavior
Differential Revision: D16121727
fbshipit-source-id: e0de1852e13c66f459efd7a3bcde449e412d8b95
Summary: Now `Array<T>` is supported as a returning values or a param of function's definition. Also, Array of Array is allowed.
Reviewed By: TheSavior
Differential Revision: D16121246
fbshipit-source-id: 59c484120c4025a152e3ba8044eecf11dbbea1f7
Summary: While working on D16090949 I discovered that the code being generated for an array of enums was not correctly converted to mask. The type that holds the mask can't be enum class but other container type, I used `uint32_t`.
Reviewed By: shergin
Differential Revision: D16109338
fbshipit-source-id: 237077adaafe631eda973bc76cefa49035bbcd66
Summary: This diff a adds generic mechansm for extracting types from types' difinitions defined in other part of the file.
Reviewed By: TheSavior
Differential Revision: D16131742
fbshipit-source-id: 006b6980fa9f6a064d5bb8734ba2740b802b6989
Summary:
All props to Eric Lewis! cc ericlewis
This revert of revert of land of changes originally published in #24873 (with some slight fixes). The change removes usage of LocalData from the `<Text>` component.
After this change we only have ---one (maybe two)--- three components left using LocalData.
Reviewed By: mdvacca
Differential Revision: D15962376
fbshipit-source-id: 19f41109ce9d71ce30d618a45eb2b547a11f29a2
Summary: Now, the signature of `updateState` method practically copies the signature of `updateLocalData`. We need that to support all features that `updateLocalData` does support now (to migrate from it).
Reviewed By: mdvacca
Differential Revision: D15962377
fbshipit-source-id: 61e0af6c191e0c6a358c5859613e9c512f91d29a
Summary: Originally, moving the mount instruction generation under the `if` was a perf optimization but now, since we converge `LocalData` and `State`, this is no longer possible (because we need to treat State as LocalData in some cases).
Reviewed By: mdvacca
Differential Revision: D15962378
fbshipit-source-id: 37f9fadb72ac53450c2d499452610d9835f2964d
Summary:
Running a PROD JS bundle with a DEV binary used to redbox with Fast Refresh on. The error said "HMRClient is not a registered callable module".
This isn't a new issue: https://www.google.com/search?q=%22hmrclient%20is%20not%20a%20registered%22. However, now it happens every time because `setup()` is now called unconditionally in a DEV native build.
Because a combination of DEV binary + PROD JS is technically possible, I'm adding a tiny shim that will make it a no-op instead of crashing. It will also explain what's wrong if you *intentionally* try to turn on Fast Refresh.
Reviewed By: sahrens
Differential Revision: D16145378
fbshipit-source-id: 0b9c0a6f30c02ca7f4a0133048450bdde3576ad2
Summary:
In this I add support for primitive types as return
- String
- Number
- Boolean
- Any
- Void
Reviewed By: TheSavior
Differential Revision: D16108273
fbshipit-source-id: 2dbd1d5a852a8cf5baf378a73d860492fe2f87cb
Summary: With this, you can load the bundle from another server on the fly. This makes it much easier to hit a named server.
Reviewed By: makovkastar
Differential Revision: D16076020
fbshipit-source-id: 46d78ccd55b9b11481628f4585030494f9282003
Summary:
I know StyleSheet.create doesn’t do anything special on react-native yet but it does on react-native-web and possibly other targets.
This small change is mainly so react-native-web don’t need to keep making this change on their code base when updating the rn version.
## Changelog
[Internal] [Changed] - Move inline static styles at VirtualizedList to StyleSheet.create
Pull Request resolved: https://github.com/facebook/react-native/pull/25501
Test Plan:
It’s basically the same code, just moved.
Also it’s the same change that it’s on react-native-web project: 45f94eb43d/packages/react-native-web/src/vendor/react-native/VirtualizedList/index.js (L1650-L1654)
Differential Revision: D16130700
Pulled By: cpojer
fbshipit-source-id: 20639e2e1a795ff4819c16af15569bf12759a62c
Summary: D14477611. The duplicat line may cause the test failure in T46242216 : https://fburl.com/9svdqopu
Reviewed By: sammy-SC, cpojer
Differential Revision: D16082601
fbshipit-source-id: fbd4f4b1ffe6b08faff4b65d7fd44faffc611393
Summary: This adds internal script to automatically sync the plugins definition. For github consumption, the CoreModulesPlugins.* will stay checked in, nothing change.
Reviewed By: RSNara
Differential Revision: D16102352
fbshipit-source-id: 8f74ea9dde046183ae620682fd7e181b4cc95a94
Summary: To look up TurboModule Class based on its name, this new function `RCTCoreModulesClassProvider()` can be used to find a TurboModule impl in the app. For now this is manually maintained and sync'ed with FB internal version. Only modules that live under React/CoreModules/ should be handled here.
Reviewed By: PeteTheHeat
Differential Revision: D16100291
fbshipit-source-id: 6b7556dec1fa83d1e081c7e8c0fe295187934274
Summary: These files are generated by tool, not for manual edit. So let this marker tell IDEs so.
Reviewed By: hramos, cpojer
Differential Revision: D16097171
fbshipit-source-id: 1f98a4d4e21acca0a7fbd386ff174dd9197c2129
Summary:
We should be able to just use `header_path_prefix` and normal `glob(["**/*.h"])` patterns, and that should be compatible with the build system.
This also allows `RCTPlatform.mm` to import `"RCTPlatform.h"` directly without any namespace.
Reviewed By: RSNara
Differential Revision: D16096779
fbshipit-source-id: b17b79baf958f1e9a63085a928b64663cb29bbbb