Summary:
Updates `ReactScrollViewManager` and the `ViewConfig` for `ScrollView` so that they are equivalent.
- `inverted` was missing.
- `contentOffset` was missing differ on Android. (However, there does not seem to be any perceivable behavior difference besides the native `ViewConfig` being different.)
Changelog:
[Internal]
Reviewed By: JoshuaGross
Differential Revision: D25084470
fbshipit-source-id: 8bea3b7a692c1038819a4147b174583a4faa71e9
Summary:
Refactors the conversion of a `PartialViewConfig` into a `ViewConfig` to a separate function so that it can be reused.
Changelog:
[Internal]
Reviewed By: JoshuaGross
Differential Revision: D25084469
fbshipit-source-id: 8a7f53ff2c68860697c791c37a6abbfd3213a0f9
Summary:
Fixes types in `registerGeneratedViewConfig` and also removes some unnecessary hacks for the `ReactNativeViewViewConfig` type.
Changelog:
[Internal]
Reviewed By: JoshuaGross
Differential Revision: D25076608
fbshipit-source-id: 5cb2060e11db598b42fbb7f2f8aecfd7f4b262ef
Summary:
Cleans up the Flow types for React Native ViewConfig. After this diff, we will have two new canonical types:
- `ViewConfig` which is what we get from native and what is registered in the `ReactNativeViewConfigRegistry`.
- `PartialViewConfig` which is what we generate statically and augment at runtime before registering with the `ReactNativeViewConfigRegistry`.
Changelog:
[Internal]
Reviewed By: JoshuaGross
Differential Revision: D25075299
fbshipit-source-id: 4b53927b2db437b615447b711e83db355d0cfa55
Summary:
Hoists the call to `getNativeComponentAttributes` out of the verification function so that it's easier to keep track of when this function is and is not called.
The purpose of this will become clearer in a future refactor.
Changelog:
[Internal]
Reviewed By: ejanzer
Differential Revision: D25072600
fbshipit-source-id: bc42461baae3476fa7ecb6186c4256dd23921ed5
Summary:
Moves the `RN$Bridgeless` check as part of moving more logic out of the verification function.
Changelog:
[Internal]
Reviewed By: ejanzer
Differential Revision: D25072601
fbshipit-source-id: 929230c02a6eaa1b724f7fd2e1a691a7c20c4b11
Summary:
Like the task mentions `strongSelf->_eventInterceptors` was crashing, probably because the coordinator was cleaned up before this block ran.
Check to make sure self is still valid before attempting to access any instance variables.
Changelog: [Internal]
Reviewed By: fkgozali
Differential Revision: D25073812
fbshipit-source-id: cdf666f2ac028b5523097f15ff51fbae9f9ffbd8
Summary:
Fix typo in comment
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->
[CATEGORY] [TYPE] - Message
Pull Request resolved: https://github.com/facebook/react-native/pull/30330
Reviewed By: fkgozali
Differential Revision: D25062086
Pulled By: PeteTheHeat
fbshipit-source-id: 251bf1d4f4986f77ae72f7654796ae1d49c1863d
Summary:
Changelog: [internal]
If value returned from `vImageBoxConvolve_ARGB8888` is negative, an error occurred.
Converting a negative number to `unsigned long` produces a large positive number (larger than memory). Trying to allocate that much memory fails, malloc returns NULL, and abort triggered inside `RCTBlurredImageWithRadius`.
To fix this we need to check for return value from `vImageBoxConvolve_ARGB8888`.
Documentation: https://developer.apple.com/documentation/accelerate/1515945-vimageboxconvolve_argb8888?language=objc
Reviewed By: JoshuaGross
Differential Revision: D25055827
fbshipit-source-id: 2c46ae6eea5cfcc95c2b552c7cd2bc60125fd24a
Summary:
Changelog: [internal]
Reference here is incorrect, we need a container for `ShadowViewMutation`.
Reviewed By: JoshuaGross
Differential Revision: D25024080
fbshipit-source-id: f59a18d859ad391bc168c8990d40b25d18003f74
Summary:
Lately there are some loading issues for the `fury.io` badges service which results in missing image and alt text visible in the Readme.
This PR fixes that issue by switching to `shields.io` version badge - badge service that has been used for few other badges already.
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->
[Internal] [Changed] - change Readme npm version badge to `shields.io`
Pull Request resolved: https://github.com/facebook/react-native/pull/30411
Test Plan: All badges will appear in the Readme file. {emoji:1f642}
Reviewed By: cpojer
Differential Revision: D25040061
Pulled By: hramos
fbshipit-source-id: 2ef6b94ff39ec21573b7e58318aba653fd716037
Summary:
A bunch of deps were missing when generating Javadoc, producing warnings. One issue was:
```
project.getConfigurations().getByName("compile").asList()
```
Seems to be deprecated (?), so this list is always empty. The mitigation is to create a new configuration that just inherits from `api()` dependencies, so that we can add them in Javadoc task.
The other problem (not solved in this commit), is that some deps are .aar files, which require some manual unpacking before they can be processed: https://stackoverflow.com/questions/35853906/how-to-generate-javadoc-for-android-library-when-it-has-dependencies-which-are-a
Note that this is separate fix from https://github.com/facebook/react-native/pull/30417
Changelog: [Internal]
Reviewed By: JoshuaGross
Differential Revision: D25041164
fbshipit-source-id: 2ee8b268c2d38e3ecbf622c05c3c56123b7a15a6
Summary:
Fixes https://github.com/facebook/react-native/issues/30415
This is a quick and dirty fix to unblock publish, of excluding a class from Javadoc generation that is importing a class current build logic cannot handle. This is not a long-term fix for the issue.
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->
[Internal] [Fixed] - Fix :ReactAndroid:androidJavadoc task
Pull Request resolved: https://github.com/facebook/react-native/pull/30417
Test Plan: Tested that the task now completes locally.
Reviewed By: lunaleaps
Differential Revision: D25041282
Pulled By: fkgozali
fbshipit-source-id: f774ab30a09db473178e2a51c77860e4985dd8e3
Summary:
This method allows a surface to re-render from scratch, without having to delete and reinstantiate the surface.
Changelog: [iOS] Added reset method to RCTFabricSurface to help with reloads
Reviewed By: RSNara
Differential Revision: D25000509
fbshipit-source-id: f74170aa78cc84491ad2679f130ed3c8965bbe34
Summary:
Changelog: [internal]
Previous implementation of coalescing would only look at the last element in `eventQueue_` and if it was the same type and target, it would coalesce the two together. This was problem when user would scroll in UIScrollView, this triggers onTouchMove and onScroll events at high rates and prevents coalescing of them.
This changes changes the behaviour to search the `eventQueue_` backwards for an event of the same type and target. If one if found, it is moved into its place. If even of another type is found before for the same target, the event is pushed back onto the queue.
Reviewed By: JoshuaGross
Differential Revision: D24992941
fbshipit-source-id: fc1eae4ecd100af6202346674778b0634ed7a15b
Summary:
Migrate over to [how we load so libraries in Fb4aTurboModuleManagerDelegate](https://fburl.com/diffusion/wu0mcr8o).
## Motivation
When we migrated Twilight over to TurboModules, we used the CatalystTurboModuleManager as a template. This led to a production crash (T70918829) because we weren't loading so's this way. The fix: D24894071.
I'm updating these two TMMDelegates so that people don't fall into the same trap when migrating other Standalone apps.
Changelog: [Internal]
Reviewed By: fkgozali
Differential Revision: D24992931
fbshipit-source-id: 3ac3b8c30a67e24f79021f915abf5ae980d5b5d3
Summary:
Changelog:
[General] [Changed] - Added (DEV-only) `displayName` to some RN contexts to make them more easy to differentiate when debugging.
Reviewed By: lunaleaps
Differential Revision: D24993068
fbshipit-source-id: 4904259eda50444c2f74700a3540ff4fd02ac322
Summary:
We don't support pre-API 21/Android <5/pre-Lollipop anymore; delete related code or checks.
No need for this to make it to the changelog, this announcement was already made.
Changelog: [Internal]
Reviewed By: ejanzer
Differential Revision: D24965249
fbshipit-source-id: e537e62e8eb18878c29afe17b8c7861d095a37b7
Summary:
Currently, queuing any sort of MountItem or getting the list of MountItems requires synchronization. Since these can be queued up at any point from the JS thread, there will, in theory, be constant contention between JS and UI thread.
To see if this is true, I'm creating an experiment instead of just switching over to concurrent structures. After seeing results, we can hopefully make a decision and delete the non-concurrent stuff or improve on it somehow.
The original was unlanded in D24973616 (26787e2260) due to a typo, which has been fixed now. The typo was that in Blocking Mode, we queued up all PreMountItems to the concurrent PreMountItems queue.
Changelog: [Internal]
Reviewed By: ShikaSD
Differential Revision: D24974851
fbshipit-source-id: d081c081bbd0de445bb92408f0ec822056b905a5
Summary:
Fixes: https://github.com/facebook/react-native/issues/29455
Modal's onDismiss is not called on iOS.
This issue occurred the commit bd2b7d6c03 and was fixed the commit 27a3248a3b.
However, the master and stable-0.63 branches do not have this modified commit applied to them.
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->
[iOS] [Fixed] - Modal's onDismiss prop will now be called successfully.
Pull Request resolved: https://github.com/facebook/react-native/pull/29882
Test Plan:
Tested on iOS with this change:
1. Set function Modal's onDismiss prop.
1. Set Modal's visible props is true. (show Modal)
1. Set Modal's visible props is false. (close Modal)
1. The set function in onDismiss is called.
Reviewed By: shergin
Differential Revision: D24648412
Pulled By: hramos
fbshipit-source-id: acf28fef21420117c845d3aed97e47b5dd4e9390
Summary:
Adding more Systrace sections to get perf information during critical paths.
Changelog: [Internal]
Reviewed By: ejanzer
Differential Revision: D24960195
fbshipit-source-id: 099e9cfac8ac87287e48e9915e6b28fe7a448783
Summary:
Add Systrace sections to initialization of non-Fabric UIImplementationProvider. This path is sometimes invoked during startup of Fabric so I'd like to gather more information about its impact.
Changelog: [Internal]
Reviewed By: ejanzer
Differential Revision: D24959965
fbshipit-source-id: a8555b8db284d00f97c71ca859cb2020409cb110
Summary:
There are a very, very small number of crashes in production that are hitting this line. I would like to understand what the existing tag ID is (perhaps it's eqal to the ID being set, which would indicate "double-start"). If not, it indicates that fragments are being reused somewhere, or something else odd is going on with lifecycles.
Changelog: [Internal]
Reviewed By: ejanzer
Differential Revision: D24953785
fbshipit-source-id: 079c86cdb571749662cca46feeaebdd6cb1281f4
Summary:
Currently, queuing any sort of MountItem or getting the list of MountItems requires synchronization. Since these can be queued up at any point from the JS thread, there will, in theory, be constant contention between JS and UI thread.
To see if this is true, I'm creating an experiment instead of just switching over to concurrent structures. After seeing results, we can hopefully make a decision and delete the non-concurrent stuff or improve on it somehow.
Changelog: [Internal]
Reviewed By: ejanzer
Differential Revision: D24942110
fbshipit-source-id: fcbdeda51f91f4bd430a20d7484854fb1e94a832
Summary:
Many third-party libraries (especially data management and caching ones) make use of long timeouts.
There are currently no plans to change `setTimeout` on Android to support firing when apps are in the background. In the meantime, this warning is not actionable for developers who are using these frameworks. Their workarounds are to 1) deal with the noise in their logs, or 2) suppress the warning.
Changelog:
[General][Removed] - Removed warning on Android for `setTimeout` with delays greater than 1 minute.
Reviewed By: lunaleaps
Differential Revision: D24964958
fbshipit-source-id: 1b40c8ba95d554c29dec74477aa63ea3ef8e4768
Summary:
Add the `react-native-codegen` source to the `react-native` npm package.
Instead of using `react-native-codegen` from npm, the iOS app template will now build the package from source. Doing so removes the need to carefully time `react-native-codegen` npm releases to oss `react-native` releases, as the codegen and the oss release will be cut at the same time.
Changelog: [Internal] - Removed react-native-codegen dependency from iOS app template
Reviewed By: TheSavior
Differential Revision: D24904655
fbshipit-source-id: a07932bc748e2afb9359de584181bcb9dd0810ea
Summary:
This is the one usage of `flow weak` in Xplat - change it to normal `flow` and add a suppression where an error appears.
Changelog: [Internal]
Reviewed By: Hans-Halverson
Differential Revision: D24878970
fbshipit-source-id: 16e459c261b41e04de1555ed7ef4ecf2f5b3721e
Summary:
Add three markers for ReactRootView perf logging: onMeasure, attachToReactInstanceManager, and updateLayoutSpecs.
It is suspected that one or all of these have regressed under Fabric in some cases.
Changelog: [Internal]
Reviewed By: shergin
Differential Revision: D24909635
fbshipit-source-id: 6b6c0cc792c4b2d72f2360d6cffc02ef00e8a88b
Summary:
This PR removes remains of Android Support Library, now replaced with AndroidX.
## Changelog
[Internal] [Changed] - remove Android Support Library from Buck
Pull Request resolved: https://github.com/facebook/react-native/pull/30347
Test Plan: CI is green
Reviewed By: JoshuaGross
Differential Revision: D24914088
Pulled By: fkgozali
fbshipit-source-id: 0ff18dfd7c684642a5c27308112b6fddc27608a7
Summary:
When running yarn install from the codegen directory it will reinstall all dependencies for the react-native workspace inside the react-native package. In my case this caused issues with metro because it would now have 2 copies of it (node_modules/metro and node_modules/react-native/node_modules/metro).
To avoid this copy the react-native-codegen source in a temporary directory and yarn install from there, then copy the built files back.
## Changelog
[Internal] - Build rn-codegen in a temporary directory
Pull Request resolved: https://github.com/facebook/react-native/pull/30292
Test Plan: Tested the script in an app with codegen enabled. Fresh install with rn-codegen not built, made sure no extra modules are installed under node_modules/react-native/node_modules.
Reviewed By: yungsters
Differential Revision: D24893216
Pulled By: fkgozali
fbshipit-source-id: 2c372b755632ea6f50ad5d4562248612b349a9a6
Summary:
Before this change, RCTImageComponentView on every state update extracted the raw pointer to ImageResponseObserverCoordinator and stored this as an instance variable. This worked fine but the code relied on an assumption that `oldState` argument of `updateState:oldState` is always valid (because the `oldState` is what retained that pointer).
Now, because of some issue, seems that `oldState` value is not always correct, so to work around this problem and to make the code more robust, this diff implements a slightly different approach.
Now we don't store the raw pointer to ImageResponseObserverCoordinator as an instance variable; instead, we store a retaining pointer to a state object and retrieve the pointer to an ImageResponseObserverCoordinator on demand. The diff also introduces a new function `_setStateAndResubscribeImageResponseObserver` that incapsulates updating `_state` object, unsubscribing from the previous coordinator, and subscribing for a new one.
Changelog: [Internal] Fabric-specific internal change.
Reviewed By: JoshuaGross
Differential Revision: D24880820
fbshipit-source-id: 1c4d8ea91ae07dd217447e43cd3dde7b6f02dc40
Summary: We don't need ConcreteStateTeller in <Image> component because we don't even update the state from the component. I will change the logic around the state in the next diff, so we have to remove ConcreteStateTeller first.
Reviewed By: sammy-SC
Differential Revision: D24880822
fbshipit-source-id: bc993bc04ef9f6df79bcbc51941ad6bf64baae58
Summary:
Currently the dimensions are created once, and then cached. This change will reload the dimensions when the device orientation changes to insure that dimension update events follow orientation changed events.
this should help address the following issues, that I know of:
https://github.com/facebook/react-native/issues/29105https://github.com/facebook/react-native/issues/29451https://github.com/facebook/react-native/issues/29323
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->
[Android] [Fixed] - Dimension update events are now properly sent following orientation change
Pull Request resolved: https://github.com/facebook/react-native/pull/30324
Test Plan: Open up RNTester app. Select the Dimensions API list item. Rotate the device and verify that the dimensions are correct based on orientation.
Reviewed By: fkgozali
Differential Revision: D24874733
Pulled By: ejanzer
fbshipit-source-id: 867681ecb009d368a2ae7b67d94d6355e67dea7b
Summary:
This diff adds more enforcement for consistency of `ShadowNodeMutation`s, including:
* `Props` object for newly created or updated view must not be nullptr;
* `oldShadowView` must describe the previous state of the view for `Update` instruction;
* `ignoreDuplicateCreates` option was removed.
I suspect some of the crashes we see in Fabric are caused by a violation of one of these constraints. If one of these fails in debug builds, we will get an early signal.
Changelog: [Internal]
Reviewed By: JoshuaGross
Differential Revision: D24880821
fbshipit-source-id: 8c8a3d8e205ce34f6e0335e8a2b0cf676930c284
Summary:
Changelog: [internal]
`addListener` call needs a matching `removeListener` call. Otherwise a memory leak is introduced to the app.
This memory leak can retain a UIImage on iOS in Fabric and cause OOM.
Reviewed By: JoshuaGross
Differential Revision: D24860489
fbshipit-source-id: 2625e4bfec416d59e048d9b5ada3813019dd107c