Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45803
This makes the same rough changes as I made to images, to apply background styles in view manager layer, using BackgroundStyleApplicator, including new boxShadow style property.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D60409795
fbshipit-source-id: 304cb99855de72fe36af33cdda4a150e21b629b9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45797
Android borders are drawn using a path generated by `addRoundRect()` inset by half the border width, using the full border width as stoke width. The edges of the ellipsis drawn for rounded borders do not line up with the math used to trace the bounding border-box path.
In a relatively similar hack to elsewhere in border drawing code for gap between content and the border, we inset the clipOut path, as if its bounding rectangle were about half a subpixel smaller, to mininally overlap the border on these edges. We then place the outer box shadows under the border in z-ordering, so that the minimal extra insetting is only visible with transparent backgrounds.
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D60389685
fbshipit-source-id: 8c449cc3eee1a3e4100f06fd87f27ae341e02eac
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45781
This adds some RNTester examples for `boxShadow`, that render correctly when `ReactNativeFeatureFlags.enableBackgroundStyleApplicator()` is set!
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D60367850
fbshipit-source-id: 3c9ae2bf906ae923c713b5f36cd2000f612fe3dc
Summary:
Backout of the [commit](https://github.com/facebook/react-native/commit/afa887b6225352d35ed99eb5271bef8a3fe1c7d6) to react to the new event as it is breaking internal tests.
## Changelog:
[General][Changed] - Revert React to onUserDrivenAnimationEnded event in JS
Reviewed By: mdvacca, arushikesarwani94
Differential Revision: D60467143
fbshipit-source-id: c70bb057adf49b5f26df4201f8b987bf6b876f46
Summary:
Backout of this [commit]() as the previous one was making some E2E fail and need to investigate further.
## Changelog:
[Internal] - Add back `_shouldEmitEvent` guardrails
Reviewed By: mdvacca, arushikesarwani94
Differential Revision: D60467145
fbshipit-source-id: a703022aa74ca0ed0fed05b59da68918eb2001e1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45795
Changelog: [internal]
Our modules to set up the runtime have side-effects and depend on import order to work correctly. This is error-prone and complicates the migration to ESM in some cases, so this refactors all of them in `src/private/setup` to export a function instead.
Reviewed By: rshest
Differential Revision: D60382506
fbshipit-source-id: 9ac30b29659b74605d59eb97562d6cbf01f48e47
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45793
Changelog: [internal]
These files are safe to move because they haven't been enabled in OSS and people shouldn't be importing them directly.
Reviewed By: rshest
Differential Revision: D60381603
fbshipit-source-id: bba62b56c42817b15bb28bce22d6c2cf668dc797
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45791
Changelog: [internal]
These files are safe to move because they haven't been enabled in OSS and people shouldn't be importing them directly.
Reviewed By: rshest
Differential Revision: D60377869
fbshipit-source-id: 02bc0335385859c0589a494de9b59b0c2ebc06f6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45792
Changelog: [internal]
These files are safe to move because they haven't been enabled in OSS and people shouldn't be importing them directly.
Reviewed By: rshest
Differential Revision: D60377868
fbshipit-source-id: db0ec2839af91620fe8b6d3927ad0b809d1bdf23
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45784
Changelog: [internal]
I originally created `src/private/core` as a directory to contain set up files for RN, but the name wasn't implying that and ended up holding more stuff.
This moves everything out of that directory and renames it as `src/private/setup` so it has a clearer scope.
Reviewed By: NickGerleman
Differential Revision: D60290620
fbshipit-source-id: b5dc27fbaa64df9a8a09a84f02023896f6fd2884
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45414
This change completes the fix for broken pressable when animations were applied to components with native driven animations.
When creating the AnimatedProps, if they are natively drive animation, we look for the AnimatedValue involved and we register a listener. This is needed to make sure that the NativeModule will send te updated value upon calling the `update` function.
Then, when observing the props lifecycle, it register a listener to the new `OnUserAnimationEnded` event, fired by the NativeAnimation module.
When the `OnUserAnimationEnded` event is fired, the AnimatedProps will update the props that depends on the user driven animation.
## Changelog
[General][Fixed] - reallign the shadow tree and the native tree when the user finishes interacting with the app.
Reviewed By: sammy-SC
Differential Revision: D59681428
fbshipit-source-id: c6690c41ea6d5517b7f8413e9dba1e12861a2400
Summary:
Adds changelog for the 0.74.4 patch.
bypass-github-export-checks
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[Internal] [Changed] - Add 0.74.4 changelog
Pull Request resolved: https://github.com/facebook/react-native/pull/45818
Reviewed By: cortinico
Differential Revision: D60448807
Pulled By: cipolleschi
fbshipit-source-id: 9737523dccf767091a6f1c1e076f8a192d0e5136
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45693
This wires box shadow application for `ReactImageViewManager` to `BackgroundStyleApplicator` for setting shadows. This same logic will get copy-pasted to other view managers later up the stack (including Vito images, ScrollViews, etc, then eventually View), until we are able to consolidate to BaseViewManager.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D60266016
fbshipit-source-id: eaa842f539ee1654ab719c7d341b4b748db7a15c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45780
D59300215 noticed that the drawable was leaking a clipping rect for the rest of the operations, and added a `save/restore` pair, but the save happens conditionally, so we can restore more often than we save, if we hit a fast path of not needing to invalidate the shadow RenderNode when drawing. This leads to the following unhandled exception:
```
java.lang.IllegalStateException: Underflow in restore - more restores than saves
at android.graphics.Canvas.restore(Canvas.java:647)
at com.facebook.react.uimanager.drawable.OutsetBoxShadowDrawable.draw(OutsetBoxShadowDrawable.kt:110)
at android.graphics.drawable.LayerDrawable.draw(LayerDrawable.java:1019)
```
This change moves saving canvas context to before setting state and drawing onto the canvas, instead of the area manipulating the RenderNode.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D60375357
fbshipit-source-id: 773c733fce11ce89ab6741589eea19b6f060f9a3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45692
This moves to using `BackgroundStyleApplicator` instead of `ReactViewBackgroundManager`, or Fresco based drawing, for setting background/border style props when the feature gates are right.
This will be ported to Vito (and... all the other built-in views) later up the stack.
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D60265326
fbshipit-source-id: d9dea8d35eeb09a10d012c3ab93957dbf2ebfdd7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45689
Going to use this to gate usage of the applicator, for each of the components, including `<View>`, which
This also conveniently sidesteps some unsavory reflection on View member happening that we can't clean up yet.
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D60265327
fbshipit-source-id: fabac3ac8479ff359ae6d798407047287dc712f9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45688
Box shadows are handled as part of different drawables. We have other cases where we want to show multiple drawables at once, such as for ripple feedback, or more commonly, for app-wide TextInput styles (which adds padding).
With more multi-background scenarios in the future, and CSSBackgroundDrawable already way overloaded, the arch here I want to go towards is less drawables, as hidden implementation details, with single responsibilities, more often switched out. Once path logic is extracted, this would also allow for better fast-paths, like not needing to create a (heavy) CSSBackgroundDrawable, for simple views with a color background.
`CompositeBackgroundDrawable` is then a more structured LayerDrawable, which also lets us mutate or retrieve information from specific layers, and enforces the different types of layers are correctly z-ordered.
`BackgroundStyleApplicator` is the public API for manipulating these styles, inspired by the existing `ReactViewBackgroundManager`. There are some important design differences.
1. The only per-view state is the publicly accessible background drawable. This means the applicator can be used on arbitrary views, and eventually used in BaseViewManager for all views (once all the QEs settle)
2. We have reliable accessors for every setter, which seem to be what folks use externally for animation
3. We work consistently in CSS device independent pixels (for the most part...)
4. More structure/safety in how we refer to edges vs uniform
5. Overflow state is not kept on the applicator, so views can set/keep their own defaults
Overflow clipping must still be implemented per-view, during drawing unfortunately.
Changelog:
[Android][Added] - Add BackgroundStyleApplicator for managing view backgrounds
Reviewed By: joevilches
Differential Revision: D60252279
fbshipit-source-id: 4c6da3e128d4da94f35d50c30c7c412cb513cc12
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45734
Rather than enumerating all platforms the iOS podspec should not compile this inverts the source_files field to an allowlist for only files relevant to iOS.
## Changelog
[Internal]
Reviewed By: cipolleschi
Differential Revision: D60291091
fbshipit-source-id: a0f7e3181ec527e39602c4523622f836a04183d9
Summary:
With the React revert from 19 to 18.3.1 of 0.75 the template is not compatible with main anymore.
As a quick solution, we are disabling the e2e tests running on main.
## Changelog
[Internal] - disable E2E template tests
Reviewed By: cortinico
Differential Revision: D60387687
fbshipit-source-id: 74d4133477bcfdc8ba5909b46d9180ac372ec6bb
Summary:
Issue: https://github.com/facebook/react-native/issues/45596
## Changelog:
[INTERNAL] [CHANGED] - Migrate `GeneratePackageListTaskTest.kt` to AssertJ testing library
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/45790
Test Plan: Run `./gradlew -p packages/gradle-plugin test`
Reviewed By: sammy-SC
Differential Revision: D60382287
Pulled By: cortinico
fbshipit-source-id: 338c771db9d407f0d83e1c62a8c13ac26d898926