Summary:
Fixes some of the type errors in `ScrollView` that were previously being suppressed by comments. This also slightly simplifies the implementation of `ScrollView`.
Changelog:
[Internal]
Reviewed By: kacieb
Differential Revision: D25097225
fbshipit-source-id: a444db8179c91e264671d8f32431b93c4da8dfc4
Summary:
Rewrites `splitLayoutProps`, which is only used by `ScrollView`.
- Improve type safety by avoiding `DangerouslyImpreciseStyle`.
- Avoid allocating objects when it is not necessary.
- Avoid allocating a object enumeratig layout props by using a switch statement.
Changelog:
[Internal]
Reviewed By: JoshuaGross, kacieb
Differential Revision: D25097226
fbshipit-source-id: 2050c03b681024212c06a48b7eb05f28c14415f9
Summary:
Refactors `flattenStyle` so that it preserves the style type of the argument. This lets us avoid using `DangerouslyImpreciseStyleProp` where we can.
Changelog:
[Internal]
Reviewed By: JoshuaGross, nadiia, kacieb
Differential Revision: D25097227
fbshipit-source-id: df6af6fefab25dbb62e3c81897c3cef98619a9c7
Summary:
Imagine the scenario in which there's an ongoing UPDATE animation; a REMOVE+INSERT (move) is queued up for the same tag, but there's no
new corresponding UPDATE - so maybe the indices of the view have changed, but the layout stays the same. Under the old model, the previous animation would be canceled and the node would jump to the final position. In theory, if there's no new UPDATE, we should continue animating the node to its final position.
I'm much happier with this - conflicting animations transition into each other super seamlessly now, and I think the logic is more straightforward as well.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D25071664
fbshipit-source-id: fcefc4619dc34cdafdc4d8e8e730b935e5528290
Summary:
This is noisy when enabled, and not very useful.
Changelog: [Internal]
Reviewed By: PeteTheHeat
Differential Revision: D25071584
fbshipit-source-id: 7205b5fa39622feccaf315ccebb181dbdac4281d
Summary:
See comments, hopefully they explain this situation. This fixes the last remaining case that I have repro'd where StubViewTree asserts fire.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D25062135
fbshipit-source-id: a28afba21f4094200aa0502b1e085dcbc10f9835
Summary:
The current implementation of LayoutAnimations assumed that the "previous/old" ShadowView passed into the diff mutation didn't matter except for purposes of diffing.
As it turns out, iOS components could possibly use the "old" version of props, state, etc - so we should try to keep track of the current value in the tree as much as possible.
This diff accomplishes that by keeping track of the "previous" view, which the AnimationDriver will update over time. This also allows us to simplify logic around conflicting animations.
I'm also adding a few additional asserts to assist in debugging.
This doesn't totally eliminate all asserts hit on iOS, yet, but it does reduce the number of times the asserts are hit in StubViewTree.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D25048644
fbshipit-source-id: d00aeece5af04624d8193063be453c7ce4a6e565
Summary:
This is an extension of https://github.com/facebook/react-native/issues/29798 which was reverted due to cases where the soft keyboard could not be dismissed.
## 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
-->
[General] [Fixed] - Avoid eating clicks/taps into ScrollView when using physical keyboard
Pull Request resolved: https://github.com/facebook/react-native/pull/30374
Test Plan: Validated with iOS simulator that taps on default ScrollView will dismiss soft keyboard and be eaten if open, but taps are not eaten when emulating a connected physical keyboard.
Reviewed By: kacieb
Differential Revision: D24935077
Pulled By: lyahdav
fbshipit-source-id: 19d9cf64547e40a35f9363896e3abbdccb95b546
Summary:
Changelog: [internal]
This diff reverts some changes in D23886519 (9f00752a97), I was not able to repro the issues that D23886519 (9f00752a97) is fixing.
`oldChildShadowView` must be defined for update mutation.
Reviewed By: JoshuaGross
Differential Revision: D25088008
fbshipit-source-id: 956d0cc536e35376ce0e1cc09f7c5b66cb89fc77
Summary:
Creates `NativeComponentRegistry` which makes native component initialization more declarative and configurable through an optionally configurable provider.
The next diff converts `ScrollView` to use this new abstraction as a demonstration. The plan would be to use this to replace all current manual call sites of `registerGeneratedViewConfig`, and then the ones generated via the Babel plugin.
Migrating to this will not change any production behavior, but it will enable verification of `ViewConfig` in development.
Changelog:
[Internal]
Reviewed By: JoshuaGross
Differential Revision: D25084468
fbshipit-source-id: 9c758ddc279bf937a401a868a066907a94098f37
Summary:
Upgrading CLI to latest. This diff is intended to be cherry-picked to 0.64.
cc grabbou kelset alloy
## Changelog
[Internal] [Changed] - Bump CLI to ^5.0.1-alpha.0
Pull Request resolved: https://github.com/facebook/react-native/pull/30420
Test Plan: None
Reviewed By: MichaReiser
Differential Revision: D25063261
Pulled By: cpojer
fbshipit-source-id: e1788fd40db2b00daaf888e7b2afaf708ade5451
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