Skip to content

Commit 8ddb782

Browse files
committed
Merge branch 'main' into improve-lineheight-calc-ios
2 parents be95918 + 089276a commit 8ddb782

2,366 files changed

Lines changed: 211539 additions & 79714 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ private/react-native-codegen-typescript-test/lib/**/*
1717
**/Pods/*
1818
**/*.macos.js
1919
**/*.windows.js
20+
**/__fixtures__/**

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ module.exports = {
9898
'**/__fixtures__/**/*.js',
9999
'**/__mocks__/**/*.js',
100100
'**/__tests__/**/*.js',
101-
'packages/react-native/jest/**/*.js',
101+
'packages/jest-preset/jest/**/*.js',
102102
'packages/rn-tester/**/*.js',
103103
],
104104
globals: {

.flowconfig

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
; Ignore the codegen e2e tests
99
<PROJECT_ROOT>/packages/react-native-codegen/e2e/__test_fixtures__/modules/NativeEnumTurboModule.js
1010

11-
; Ignore the Dangerfile
12-
<PROJECT_ROOT>/private/react-native-bots/dangerfile.js
13-
1411
; Ignore "BUCK" generated dirs
1512
<PROJECT_ROOT>/\.buckd/
1613

@@ -98,4 +95,4 @@ untyped-import
9895
untyped-type-import
9996

10097
[version]
101-
^0.295.0
98+
^0.310.0

.github/actions/build-android/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ runs:
2626
# already set from the 'create release' commits on the release branch.
2727
# For testing RC.0, though, the version has not been set yet. In that case, we are on Stable branch and
2828
# it is the only case when the version is still 1000.0.0
29-
if: ${{ !endsWith(github.ref_name, '-stable') || endsWith(github.ref_name, '-stable') && steps.read-rn-version.outputs.rn-version == '1000.0.0' }}
29+
# We also skip this when the PR targets a stable branch (github.base_ref ends with '-stable'),
30+
# since the version is already set on the stable branch.
31+
if: ${{ !endsWith(github.ref_name, '-stable') && !endsWith(github.base_ref || '', '-stable') || endsWith(github.ref_name, '-stable') && steps.read-rn-version.outputs.rn-version == '1000.0.0' }}
3032
shell: bash
3133
run: node ./scripts/releases/set-rn-artifacts-version.js --build-type ${{ inputs.release-type }}
3234
- name: Setup gradle
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Build Fantom Runner
2+
inputs:
3+
release-type:
4+
required: true
5+
description: The type of release we are building. It could be nightly, release or dry-run
6+
gradle-cache-encryption-key:
7+
description: "The encryption key needed to store the Gradle Configuration cache"
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- name: Install dependencies
13+
shell: bash
14+
run: |
15+
sudo apt update
16+
sudo apt install -y git cmake openssl libssl-dev clang
17+
- name: Setup git safe folders
18+
shell: bash
19+
run: git config --global --add safe.directory '*'
20+
- name: Setup node.js
21+
uses: ./.github/actions/setup-node
22+
- name: Install node dependencies
23+
uses: ./.github/actions/yarn-install
24+
- name: Setup gradle
25+
uses: ./.github/actions/setup-gradle
26+
with:
27+
cache-read-only: "false"
28+
cache-encryption-key: ${{ inputs.gradle-cache-encryption-key }}
29+
- name: Restore Fantom ccache
30+
uses: actions/cache/restore@v5
31+
with:
32+
path: /github/home/.cache/ccache
33+
key: v2-ccache-fantom-${{ github.job }}-${{ github.ref }}-${{ hashFiles(
34+
'packages/react-native/ReactAndroid/**/*.cpp',
35+
'packages/react-native/ReactAndroid/**/*.h',
36+
'packages/react-native/ReactAndroid/**/CMakeLists.txt',
37+
'packages/react-native/ReactCommon/**/*.cpp',
38+
'packages/react-native/ReactCommon/**/*.h',
39+
'packages/react-native/ReactCommon/**/CMakeLists.txt',
40+
'private/react-native-fantom/tester/**/*.cpp',
41+
'private/react-native-fantom/tester/**/*.h',
42+
'private/react-native-fantom/tester/**/CMakeLists.txt'
43+
) }}
44+
restore-keys: |
45+
v2-ccache-fantom-${{ github.job }}-${{ github.ref }}-
46+
v2-ccache-fantom-${{ github.job }}-
47+
v2-ccache-fantom-
48+
- name: Show ccache stats (before)
49+
shell: bash
50+
run: ccache -s -v
51+
- name: Build Fantom Runner
52+
shell: bash
53+
run: yarn workspace @react-native/fantom build
54+
env:
55+
CC: clang
56+
CXX: clang++
57+
- name: Save Fantom ccache
58+
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }}
59+
uses: actions/cache/save@v5
60+
with:
61+
path: /github/home/.cache/ccache
62+
key: v2-ccache-fantom-${{ github.job }}-${{ github.ref }}-${{ hashFiles(
63+
'packages/react-native/ReactAndroid/**/*.cpp',
64+
'packages/react-native/ReactAndroid/**/*.h',
65+
'packages/react-native/ReactAndroid/**/CMakeLists.txt',
66+
'packages/react-native/ReactCommon/**/*.cpp',
67+
'packages/react-native/ReactCommon/**/*.h',
68+
'packages/react-native/ReactCommon/**/CMakeLists.txt',
69+
'private/react-native-fantom/tester/**/*.cpp',
70+
'private/react-native-fantom/tester/**/*.h',
71+
'private/react-native-fantom/tester/**/CMakeLists.txt'
72+
) }}
73+
- name: Show ccache stats (after)
74+
shell: bash
75+
run: ccache -s -v
76+
- name: Copy shared libraries
77+
shell: bash
78+
run: cp packages/react-native/ReactAndroid/hermes-engine/build/hermes/lib/libhermesvm.so private/react-native-fantom/build/tester/
79+
- name: Upload Fantom Runner binary
80+
uses: actions/upload-artifact@v6
81+
with:
82+
name: fantom-runner-binary
83+
compression-level: 1
84+
path: private/react-native-fantom/build/tester/
Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,34 @@
11
name: diff-js-api-changes
22
description: Check for breaking changes in the public React Native JS API
3+
outputs:
4+
message:
5+
description: Formatted markdown message describing API changes, or empty if no changes
6+
value: ${{ steps.format_output.outputs.message }}
37
runs:
48
using: composite
59
steps:
6-
- name: Compute merge base with main
10+
- name: Fetch PR and main, compute merge base
711
id: merge_base
812
shell: bash
13+
env:
14+
PR_SHA: ${{ github.event.pull_request.head.sha }}
915
run: |
1016
git fetch origin main
11-
git fetch --deepen=500
12-
echo "merge_base=$(git merge-base HEAD origin/main)" >> $GITHUB_OUTPUT
17+
git fetch origin "$PR_SHA" --depth=500
18+
echo "merge_base=$(git merge-base "$PR_SHA" origin/main)" >> $GITHUB_OUTPUT
1319
14-
- name: Output snapshot before state for comparison
20+
- name: Extract before and after API snapshots
1521
shell: bash
1622
env:
1723
SCRATCH_DIR: ${{ runner.temp }}/diff-js-api-changes
24+
MERGE_BASE: ${{ steps.merge_base.outputs.merge_base }}
25+
PR_SHA: ${{ github.event.pull_request.head.sha }}
1826
run: |
1927
mkdir -p $SCRATCH_DIR
20-
git show ${{ steps.merge_base.outputs.merge_base }}:packages/react-native/ReactNativeApi.d.ts > $SCRATCH_DIR/ReactNativeApi-before.d.ts \
28+
git show "$MERGE_BASE":packages/react-native/ReactNativeApi.d.ts > $SCRATCH_DIR/ReactNativeApi-before.d.ts \
2129
|| echo "" > $SCRATCH_DIR/ReactNativeApi-before.d.ts
30+
git show "$PR_SHA":packages/react-native/ReactNativeApi.d.ts > $SCRATCH_DIR/ReactNativeApi-after.d.ts \
31+
|| echo "" > $SCRATCH_DIR/ReactNativeApi-after.d.ts
2232
2333
- name: Run breaking change detection
2434
shell: bash
@@ -27,5 +37,37 @@ runs:
2737
run: |
2838
node ./scripts/js-api/diff-api-snapshot \
2939
$SCRATCH_DIR/ReactNativeApi-before.d.ts \
30-
./packages/react-native/ReactNativeApi.d.ts \
40+
$SCRATCH_DIR/ReactNativeApi-after.d.ts \
3141
> $SCRATCH_DIR/output.json
42+
43+
- name: Format output message
44+
id: format_output
45+
shell: bash
46+
env:
47+
SCRATCH_DIR: ${{ runner.temp }}/diff-js-api-changes
48+
run: |
49+
if [ ! -f "$SCRATCH_DIR/output.json" ]; then
50+
echo "message=" >> $GITHUB_OUTPUT
51+
exit 0
52+
fi
53+
54+
RESULT=$(cat $SCRATCH_DIR/output.json | jq -r '.result // empty')
55+
if [ -z "$RESULT" ] || [ "$RESULT" = "NON_BREAKING" ]; then
56+
echo "message=" >> $GITHUB_OUTPUT
57+
exit 0
58+
fi
59+
60+
# Use delimiter for multiline output
61+
{
62+
echo "message<<EOF"
63+
echo "> [!WARNING]"
64+
echo "> **JavaScript API change detected**"
65+
echo ">"
66+
echo "> This PR commits an update to \`ReactNativeApi.d.ts\`, indicating a change to React Native's public JavaScript API."
67+
echo ">"
68+
echo "> - Please include a **clear changelog message**."
69+
echo "> - This change will be subject to additional review."
70+
echo ">"
71+
echo "> This change was flagged as: \`${RESULT}\`"
72+
echo "EOF"
73+
} >> $GITHUB_OUTPUT

.github/actions/lint/action.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.github/actions/maestro-ios/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ runs:
3030
run: |
3131
brew tap facebook/fb
3232
brew install facebook/fb/idb-companion
33-
- name: Set up JDK 11
33+
- name: Set up JDK 17
3434
uses: actions/setup-java@v5
3535
with:
3636
java-version: '17'
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: post-pr-comment
2+
description: Post or update a PR comment, or delete if no sections
3+
inputs:
4+
sections:
5+
description: 'JSON array of markdown sections to include in comment'
6+
required: false
7+
default: '[]'
8+
header:
9+
description: 'Optional header text to display at the top of the comment'
10+
required: false
11+
default: ''
12+
marker:
13+
description: 'HTML comment marker to identify this comment'
14+
required: true
15+
runs:
16+
using: composite
17+
steps:
18+
- name: Create, update, or delete comment
19+
uses: actions/github-script@v8
20+
env:
21+
SECTIONS_INPUT: ${{ inputs.sections }}
22+
MARKER_INPUT: ${{ inputs.marker }}
23+
HEADER_INPUT: ${{ inputs.header }}
24+
with:
25+
script: |
26+
const marker = process.env.MARKER_INPUT;
27+
const header = process.env.HEADER_INPUT;
28+
const sections = JSON.parse(process.env.SECTIONS_INPUT)
29+
.filter(Boolean)
30+
.filter(s => s.trim());
31+
32+
const {owner, repo} = context.repo;
33+
const issue_number = context.issue.number;
34+
35+
const {data: comments} = await github.rest.issues.listComments({
36+
owner, repo, issue_number,
37+
});
38+
39+
const existing = comments.find(c => c.body?.includes(marker));
40+
41+
if (!sections.length) {
42+
if (existing) {
43+
await github.rest.issues.deleteComment({owner, repo, comment_id: existing.id});
44+
}
45+
return;
46+
}
47+
48+
const content = sections.join('\n\n');
49+
const body = header ? `${marker}\n## ${header}\n\n${content}` : `${marker}\n${content}`;
50+
51+
if (existing) {
52+
await github.rest.issues.updateComment({owner, repo, comment_id: existing.id, body});
53+
} else {
54+
await github.rest.issues.createComment({owner, repo, issue_number, body});
55+
}

0 commit comments

Comments
 (0)