Compare commits

...
Author SHA1 Message Date
Vitali Zaidman 98ca19eec7 renamed release testing scripts 2025-07-10 17:49:08 +01:00
Nicola Corti 4d1f1a4e29 Back out "Remove ShadowNodeTraits::Trait::DirtyYogaNode" (#52528)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52528

This was a breaking change that is currently breaking `react-native-safe-area-context` so we can't ship it as it is, especially because all the apps in OSS will be affected by this.

Changelog:
[General] [Changed] - Revert breaking change due to the removal of `ShadowNodeTraits::Trait::DirtyYogaNode`

Original commit changeset: 869e81f0ae00

Original Phabricator Diff: D75324251

Reviewed By: huntie

Differential Revision: D78085848

fbshipit-source-id: f7fcc5e33d59cc966a4ee88dfdbedca4f4c580e0
2025-07-10 09:36:54 -07:00
Christoph Purrer a98ee9147a Add noexcept specifications to Transform and Color methods (#52497)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52497

Changelog: [Internal]

Is a good practice (and can reduce binary size):
https://cpp-core-guidelines-docs.vercel.app/errors#Re-noexcept

Reviewed By: philIip

Differential Revision: D77988686

fbshipit-source-id: 575c18aa0c8f593f363f4450e9e06d41c97a3d1a
2025-07-10 09:17:08 -07:00
Tomasz Zawadzki d1730ff960 Expose react_renderer_bridging headers via prefab (#52529)
Summary:
This PR fixes the following build error while trying to build `react-native@0.81.0-rc.0` app with `react-native-screens@4.10.0` installed using react-native prebuilds (AAR) due to a missing `react/renderer/bridging/bridging.h` file in `prefab/modules/` inside `react-android-0.81.0-rc.0-debug.aar`.

```
In file included from /Users/tomekzaw/RNOS/react-native-reanimated/node_modules/react-native-screens/android/src/main/cpp/NativeProxy.cpp:2:
  In file included from /Users/tomekzaw/.gradle/caches/8.14.1/transforms/75e7f8f7b5ef763e687a16737daf01b6/transformed/react-android-0.81.0-rc.0-debug/prefab/modules/reactnative/include/react/fabric/Binding.h:12:
  In file included from /Users/tomekzaw/.gradle/caches/8.14.1/transforms/75e7f8f7b5ef763e687a16737daf01b6/transformed/react-android-0.81.0-rc.0-debug/prefab/modules/reactnative/include/react/fabric/FabricUIManagerBinding.h:22:
  /Users/tomekzaw/.gradle/caches/8.14.1/transforms/75e7f8f7b5ef763e687a16737daf01b6/transformed/react-android-0.81.0-rc.0-debug/prefab/modules/reactnative/include/react/renderer/uimanager/primitives.h:14:10: fatal error: 'react/renderer/bridging/bridging.h' file not found
     14 | #include <react/renderer/bridging/bridging.h>
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.
  ninja: build stopped: subcommand failed.
```

## Changelog:

[ANDROID] [CHANGED] - Expose `react_renderer_bridging` headers via prefab

Pull Request resolved: https://github.com/facebook/react-native/pull/52529

Reviewed By: cipolleschi

Differential Revision: D78092428

Pulled By: cortinico

fbshipit-source-id: de8208ae7545201f600c277a0c8907575c310c58
2025-07-10 08:25:50 -07:00
10 changed files with 64 additions and 50 deletions
+2 -2
View File
@@ -28,8 +28,8 @@
"set-version": "node ./scripts/releases/set-version.js",
"test-android": "./gradlew :packages:react-native:ReactAndroid:test",
"test-ci": "jest --maxWorkers=2 --ci --reporters=\"default\" --reporters=\"jest-junit\"",
"test-e2e-local-clean": "node ./scripts/release-testing/test-e2e-local-clean.js",
"test-e2e-local": "node ./scripts/release-testing/test-e2e-local.js",
"test-release-local-clean": "node ./scripts/release-testing/test-release-local-clean.js",
"test-release-local": "node ./scripts/release-testing/test-release-local.js",
"test-ios": "./scripts/objc-test.sh test",
"test-typescript": "tsc -p packages/react-native/types/tsconfig.json",
"test-generated-typescript": "tsc -p packages/react-native/types_generated/tsconfig.test.json",
@@ -112,6 +112,8 @@ val preparePrefab by
Pair(
"../ReactCommon/react/renderer/animations/",
"react/renderer/animations/"),
// react_renderer_bridging
Pair("../ReactCommon/react/renderer/bridging/", "react/renderer/bridging/"),
// react_renderer_componentregistry
Pair(
"../ReactCommon/react/renderer/componentregistry/",
@@ -82,6 +82,15 @@ class ShadowNodeTraits {
// Must not be set directly. It is used by the view culling algorithm to
// efficiently determine if a node is uncullable.
Unstable_uncullableTrace = 1 << 13,
// Indicates that the `YogaLayoutableShadowNode` must set `isDirty` flag for
// Yoga node when a `ShadowNode` is being cloned. `ShadowNode`s that modify
// Yoga styles in the constructor (or later) *after* the `ShadowNode`
// is cloned must set this trait.
// Any Yoga node (not only Leaf ones) can have this trait.
// **Deprecated**: This trait is deprecated and will be removed in a future
// version of React Native.
DirtyYogaNode = 1 << 14,
};
/*
@@ -28,22 +28,22 @@ ColorComponents colorComponentsFromColor(SharedColor sharedColor) {
}
// Read alpha channel in [0, 255] range
uint8_t alphaFromColor(SharedColor color) {
uint8_t alphaFromColor(SharedColor color) noexcept {
return static_cast<uint8_t>(std::round(alphaFromHostPlatformColor(*color)));
}
// Read red channel in [0, 255] range
uint8_t redFromColor(SharedColor color) {
uint8_t redFromColor(SharedColor color) noexcept {
return static_cast<uint8_t>(std::round(redFromHostPlatformColor(*color)));
}
// Read green channel in [0, 255] range
uint8_t greenFromColor(SharedColor color) {
uint8_t greenFromColor(SharedColor color) noexcept {
return static_cast<uint8_t>(std::round(greenFromHostPlatformColor(*color)));
}
// Read blue channel in [0, 255] range
uint8_t blueFromColor(SharedColor color) {
uint8_t blueFromColor(SharedColor color) noexcept {
return static_cast<uint8_t>(std::round(blueFromHostPlatformColor(*color)));
}
@@ -61,10 +61,10 @@ bool isColorMeaningful(const SharedColor& color) noexcept;
SharedColor colorFromComponents(ColorComponents components);
ColorComponents colorComponentsFromColor(SharedColor color);
uint8_t alphaFromColor(SharedColor color);
uint8_t redFromColor(SharedColor color);
uint8_t greenFromColor(SharedColor color);
uint8_t blueFromColor(SharedColor color);
uint8_t alphaFromColor(SharedColor color) noexcept;
uint8_t redFromColor(SharedColor color) noexcept;
uint8_t greenFromColor(SharedColor color) noexcept;
uint8_t blueFromColor(SharedColor color) noexcept;
SharedColor colorFromRGBA(uint8_t r, uint8_t g, uint8_t b, uint8_t a);
SharedColor clearColor();
@@ -15,19 +15,19 @@
namespace facebook::react {
Transform Transform::Identity() {
/* static */ Transform Transform::Identity() noexcept {
return {};
}
Transform Transform::VerticalInversion() {
/* static */ Transform Transform::VerticalInversion() noexcept {
return Transform::Scale(1, -1, 1);
}
Transform Transform::HorizontalInversion() {
/* static */ Transform Transform::HorizontalInversion() noexcept {
return Transform::Scale(-1, 1, 1);
}
Transform Transform::Perspective(Float perspective) {
/* static */ Transform Transform::Perspective(Float perspective) noexcept {
auto transform = Transform{};
auto Zero = ValueUnit(0, UnitType::Point);
transform.operations.push_back(TransformOperation{
@@ -39,7 +39,7 @@ Transform Transform::Perspective(Float perspective) {
return transform;
}
Transform Transform::Scale(Float x, Float y, Float z) {
/* static */ Transform Transform::Scale(Float x, Float y, Float z) noexcept {
auto transform = Transform{};
Float xprime = isZero(x) ? 0 : x;
Float yprime = isZero(y) ? 0 : y;
@@ -57,7 +57,8 @@ Transform Transform::Scale(Float x, Float y, Float z) {
return transform;
}
Transform Transform::Translate(Float x, Float y, Float z) {
/* static */ Transform
Transform::Translate(Float x, Float y, Float z) noexcept {
auto transform = Transform{};
Float xprime = isZero(x) ? 0 : x;
Float yprime = isZero(y) ? 0 : y;
@@ -75,7 +76,7 @@ Transform Transform::Translate(Float x, Float y, Float z) {
return transform;
}
Transform Transform::Skew(Float x, Float y) {
/* static */ Transform Transform::Skew(Float x, Float y) noexcept {
auto transform = Transform{};
Float xprime = isZero(x) ? 0 : x;
Float yprime = isZero(y) ? 0 : y;
@@ -89,7 +90,7 @@ Transform Transform::Skew(Float x, Float y) {
return transform;
}
Transform Transform::RotateX(Float radians) {
/* static */ Transform Transform::RotateX(Float radians) noexcept {
auto transform = Transform{};
if (!isZero(radians)) {
auto Zero = ValueUnit(0, UnitType::Point);
@@ -106,7 +107,7 @@ Transform Transform::RotateX(Float radians) {
return transform;
}
Transform Transform::RotateY(Float radians) {
/* static */ Transform Transform::RotateY(Float radians) noexcept {
auto transform = Transform{};
if (!isZero(radians)) {
auto Zero = ValueUnit(0, UnitType::Point);
@@ -123,7 +124,7 @@ Transform Transform::RotateY(Float radians) {
return transform;
}
Transform Transform::RotateZ(Float radians) {
/* static */ Transform Transform::RotateZ(Float radians) noexcept {
auto transform = Transform{};
if (!isZero(radians)) {
auto Zero = ValueUnit(0, UnitType::Point);
@@ -140,7 +141,7 @@ Transform Transform::RotateZ(Float radians) {
return transform;
}
Transform Transform::Rotate(Float x, Float y, Float z) {
/* static */ Transform Transform::Rotate(Float x, Float y, Float z) noexcept {
auto transform = Transform{};
if (!isZero(x)) {
transform = transform * Transform::RotateX(x);
@@ -154,7 +155,7 @@ Transform Transform::Rotate(Float x, Float y, Float z) {
return transform;
}
Transform Transform::FromTransformOperation(
/* static */ Transform Transform::FromTransformOperation(
TransformOperation transformOperation,
const Size& size,
const Transform& transform) {
@@ -197,7 +198,7 @@ Transform Transform::FromTransformOperation(
return Transform::Identity();
}
TransformOperation Transform::DefaultTransformOperation(
/* static */ TransformOperation Transform::DefaultTransformOperation(
TransformOperationType type) {
auto Zero = ValueUnit{0, UnitType::Point};
auto One = ValueUnit{1, UnitType::Point};
@@ -225,7 +226,7 @@ TransformOperation Transform::DefaultTransformOperation(
}
}
Transform Transform::Interpolate(
/* static */ Transform Transform::Interpolate(
Float animationProgress,
const Transform& lhs,
const Transform& rhs,
@@ -301,15 +302,17 @@ Transform Transform::Interpolate(
return result;
}
bool Transform::isVerticalInversion(const Transform& transform) {
/* static */ bool Transform::isVerticalInversion(
const Transform& transform) noexcept {
return floatEquality(transform.at(1, 1), static_cast<Float>(-1.0f));
}
bool Transform::isHorizontalInversion(const Transform& transform) {
/* static */ bool Transform::isHorizontalInversion(
const Transform& transform) noexcept {
return floatEquality(transform.at(0, 0), static_cast<Float>(-1.0f));
}
bool Transform::operator==(const Transform& rhs) const {
bool Transform::operator==(const Transform& rhs) const noexcept {
for (auto i = 0; i < 16; i++) {
if (matrix[i] != rhs.matrix[i]) {
return false;
@@ -326,7 +329,7 @@ bool Transform::operator==(const Transform& rhs) const {
return true;
}
bool Transform::operator!=(const Transform& rhs) const {
bool Transform::operator!=(const Transform& rhs) const noexcept {
return !(*this == rhs);
}
@@ -408,11 +411,11 @@ Transform Transform::operator*(const Transform& rhs) const {
return result;
}
Float& Transform::at(int i, int j) {
Float& Transform::at(int i, int j) noexcept {
return matrix[(i * 4) + j];
}
const Float& Transform::at(int i, int j) const {
const Float& Transform::at(int i, int j) const noexcept {
return matrix[(i * 4) + j];
}
@@ -104,47 +104,47 @@ struct Transform {
/*
* Returns the identity transform (`[1 0 0 0; 0 1 0 0; 0 0 1 0; 0 0 0 1]`).
*/
static Transform Identity();
static Transform Identity() noexcept;
/*
* Returns the vertival inversion transform (`[1 0 0 0; 0 -1 0 0; 0 0 1 0; 0 0
* 0 1]`).
*/
static Transform VerticalInversion();
static Transform VerticalInversion() noexcept;
/*
* Returns the horizontal inversion transform (`[-1 0 0 0; 0 1 0 0; 0 0 1 0; 0
* 0 0 1]`).
*/
static Transform HorizontalInversion();
static Transform HorizontalInversion() noexcept;
/*
* Returns a Perspective transform.
*/
static Transform Perspective(Float perspective);
static Transform Perspective(Float perspective) noexcept;
/*
* Returns a Scale transform.
*/
static Transform Scale(Float factorX, Float factorY, Float factorZ);
static Transform Scale(Float factorX, Float factorY, Float factorZ) noexcept;
/*
* Returns a Translate transform.
*/
static Transform Translate(Float x, Float y, Float z);
static Transform Translate(Float x, Float y, Float z) noexcept;
/*
* Returns a Skew transform.
*/
static Transform Skew(Float x, Float y);
static Transform Skew(Float x, Float y) noexcept;
/*
* Returns a transform that rotates by `angle` radians along the given axis.
*/
static Transform RotateX(Float radians);
static Transform RotateY(Float radians);
static Transform RotateZ(Float radians);
static Transform Rotate(Float angleX, Float angleY, Float angleZ);
static Transform RotateX(Float radians) noexcept;
static Transform RotateY(Float radians) noexcept;
static Transform RotateZ(Float radians) noexcept;
static Transform Rotate(Float angleX, Float angleY, Float angleZ) noexcept;
/**
* Perform an interpolation between lhs and rhs, given progress.
@@ -163,20 +163,20 @@ struct Transform {
const Transform& rhs,
const Size& size);
static bool isVerticalInversion(const Transform& transform);
static bool isHorizontalInversion(const Transform& transform);
static bool isVerticalInversion(const Transform& transform) noexcept;
static bool isHorizontalInversion(const Transform& transform) noexcept;
/*
* Equality operators.
*/
bool operator==(const Transform& rhs) const;
bool operator!=(const Transform& rhs) const;
bool operator==(const Transform& rhs) const noexcept;
bool operator!=(const Transform& rhs) const noexcept;
/*
* Matrix subscript.
*/
Float& at(int i, int j);
const Float& at(int i, int j) const;
Float& at(int i, int j) noexcept;
const Float& at(int i, int j) const noexcept;
/*
* Concatenates (multiplies) transform matrices.
+2 -2
View File
@@ -6,10 +6,10 @@ Scripts supporting local manual release testing. See also [How to Test a Release
For information on command arguments, run `node <command> --help`.
### `test-e2e-local`
### `test-release-local`
Set up, build, and install a given test app configuration.
### `test-e2e-local-clean`
### `test-release-local-clean`
Clean up all file system and cache state between tests.
@@ -11,7 +11,7 @@
'use strict';
/*
* This script, paired with test-e2e-local.js, is the full suite of
* This script, paired with test-release-local.js, is the full suite of
* tooling needed for a successful local testing experience.
* This script is an helper to clean up the environment fully
* before running the test suite.