From 12deb38cbade6e2469925c249d89719d11968592 Mon Sep 17 00:00:00 2001 From: Dawid Malecki Date: Tue, 28 Oct 2025 16:29:56 +0100 Subject: [PATCH 01/11] run danger --- .github/workflows/danger-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/danger-pr.yml b/.github/workflows/danger-pr.yml index cf28b788105a76..06daf7ee8378c8 100644 --- a/.github/workflows/danger-pr.yml +++ b/.github/workflows/danger-pr.yml @@ -15,7 +15,7 @@ permissions: jobs: danger: runs-on: ubuntu-latest - if: github.repository == 'facebook/react-native' + if: github.repository == 'coado/react-native' steps: - uses: actions/checkout@v4 - name: Setup Node.js From 085854dade519ca8052f86edfe42f233ce3f547c Mon Sep 17 00:00:00 2001 From: Dawid Malecki Date: Tue, 28 Oct 2025 16:51:45 +0100 Subject: [PATCH 02/11] changing API --- packages/react-native/ReactNativeApi.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactNativeApi.d.ts b/packages/react-native/ReactNativeApi.d.ts index 2ac82083cbfec3..402e13c843923c 100644 --- a/packages/react-native/ReactNativeApi.d.ts +++ b/packages/react-native/ReactNativeApi.d.ts @@ -36,7 +36,7 @@ declare const $$AnimatedImage: AnimatedComponentType< React.ComponentRef > declare const $$AnimatedImplementation: { - add: typeof addImpl + // add: typeof addImpl attachNativeEvent: typeof attachNativeEventImpl Color: typeof AnimatedColor_default createAnimatedComponent: typeof createAnimatedComponent_default From 2c2c7be5a4028a659212866a65630763543294a5 Mon Sep 17 00:00:00 2001 From: Dawid Malecki Date: Tue, 28 Oct 2025 16:52:53 +0100 Subject: [PATCH 03/11] change API --- packages/react-native/ReactNativeApi.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactNativeApi.d.ts b/packages/react-native/ReactNativeApi.d.ts index 402e13c843923c..2ac82083cbfec3 100644 --- a/packages/react-native/ReactNativeApi.d.ts +++ b/packages/react-native/ReactNativeApi.d.ts @@ -36,7 +36,7 @@ declare const $$AnimatedImage: AnimatedComponentType< React.ComponentRef > declare const $$AnimatedImplementation: { - // add: typeof addImpl + add: typeof addImpl attachNativeEvent: typeof attachNativeEventImpl Color: typeof AnimatedColor_default createAnimatedComponent: typeof createAnimatedComponent_default From 6e1028be5458bd936623c0a40efbe15ebf14b3e3 Mon Sep 17 00:00:00 2001 From: Dawid Malecki Date: Tue, 28 Oct 2025 17:19:39 +0100 Subject: [PATCH 04/11] snapshot output --- private/react-native-bots/dangerfile.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/private/react-native-bots/dangerfile.js b/private/react-native-bots/dangerfile.js index 1bff20819a9709..005ff55d67d796 100644 --- a/private/react-native-bots/dangerfile.js +++ b/private/react-native-bots/dangerfile.js @@ -39,6 +39,9 @@ const snapshot_output = JSON.parse( 'utf8', ), ); + +console.log('Snapshot output:', snapshot_output); + if (snapshot_output && snapshot_output.result !== 'NON_BREAKING') { const title = ':exclamation: JavaScript API change detected'; const idea = From 5db6f3cff8374623ca7055e88cad62861227b8c6 Mon Sep 17 00:00:00 2001 From: Dawid Malecki Date: Mon, 3 Nov 2025 10:36:36 +0100 Subject: [PATCH 05/11] changing api --- packages/react-native/ReactNativeApi.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactNativeApi.d.ts b/packages/react-native/ReactNativeApi.d.ts index 2ac82083cbfec3..ff992b3137d856 100644 --- a/packages/react-native/ReactNativeApi.d.ts +++ b/packages/react-native/ReactNativeApi.d.ts @@ -6115,7 +6115,7 @@ export { SectionListData, // 119baf83 SectionListProps, // c9ac8e07 SectionListRenderItem, // 1fad0435 - SectionListRenderItemInfo, // 745e1992 + SectionListRenderItemInfo, // 745e1994 Separators, // 6a45f7e3 Settings, // 4282b0da Share, // e4591b32 From 074b2daee01580175e2e6c7958ea5c5ecd0e7818 Mon Sep 17 00:00:00 2001 From: Dawid Malecki Date: Mon, 3 Nov 2025 10:37:45 +0100 Subject: [PATCH 06/11] revert: --- packages/react-native/ReactNativeApi.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactNativeApi.d.ts b/packages/react-native/ReactNativeApi.d.ts index ff992b3137d856..2ac82083cbfec3 100644 --- a/packages/react-native/ReactNativeApi.d.ts +++ b/packages/react-native/ReactNativeApi.d.ts @@ -6115,7 +6115,7 @@ export { SectionListData, // 119baf83 SectionListProps, // c9ac8e07 SectionListRenderItem, // 1fad0435 - SectionListRenderItemInfo, // 745e1994 + SectionListRenderItemInfo, // 745e1992 Separators, // 6a45f7e3 Settings, // 4282b0da Share, // e4591b32 From f931c523caebde6da28bc4559e66ffc67957edb6 Mon Sep 17 00:00:00 2001 From: Dawid Malecki Date: Mon, 3 Nov 2025 10:38:20 +0100 Subject: [PATCH 07/11] api change --- packages/react-native/ReactNativeApi.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactNativeApi.d.ts b/packages/react-native/ReactNativeApi.d.ts index 2ac82083cbfec3..073a1f2a9a1e15 100644 --- a/packages/react-native/ReactNativeApi.d.ts +++ b/packages/react-native/ReactNativeApi.d.ts @@ -6109,7 +6109,7 @@ export { ScrollViewProps, // 27986ff5 ScrollViewPropsAndroid, // 84e2134b ScrollViewPropsIOS, // d83c9733 - ScrollViewScrollToOptions, // 3313411e + ScrollViewScrollToOptions, // 33134111 SectionBase, // b376bddc SectionList, // ff1193b2 SectionListData, // 119baf83 From adc4279fb37abdca35e776e3111a7ce5b1ebe730 Mon Sep 17 00:00:00 2001 From: Dawid Malecki Date: Mon, 3 Nov 2025 10:43:07 +0100 Subject: [PATCH 08/11] danger fix --- .../diff-js-api-breaking-changes/action.yml | 3 ++ private/react-native-bots/dangerfile.js | 32 ++++++++----------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/.github/actions/diff-js-api-breaking-changes/action.yml b/.github/actions/diff-js-api-breaking-changes/action.yml index bc45b1b207aa83..8dbd744916d938 100644 --- a/.github/actions/diff-js-api-breaking-changes/action.yml +++ b/.github/actions/diff-js-api-breaking-changes/action.yml @@ -17,6 +17,9 @@ runs: env: SCRATCH_DIR: ${{ runner.temp }}/diff-js-api-breaking-changes run: | + # Check if the file was changed in this PR, if not, exit early without saving to the output.json + git diff --name-status | awk '{print $2}' | grep 'packages/react-native/ReactNativeApi.d.ts' || exit 0 + node ./scripts/js-api/diff-api-snapshot \ ${{ github.workspace }}/packages/react-native/ReactNativeApi.d.ts \ $SCRATCH_DIR/ReactNativeApi-after.d.ts \ diff --git a/private/react-native-bots/dangerfile.js b/private/react-native-bots/dangerfile.js index 005ff55d67d796..07a4a921e56682 100644 --- a/private/react-native-bots/dangerfile.js +++ b/private/react-native-bots/dangerfile.js @@ -30,26 +30,22 @@ const isFromPhabricator = body_contains('differential revision:'); // Provides advice if a summary section is missing, or body is too short const includesSummary = body_contains('## summary', 'summary:'); -const snapshot_output = JSON.parse( - fs.readFileSync( - path.join( - process.env.RUNNER_TEMP, - 'diff-js-api-breaking-changes/output.json', - ), - 'utf8', - ), +const snapshot_path = path.join( + process.env.RUNNER_TEMP, + 'diff-js-api-breaking-changes/output.json', ); -console.log('Snapshot output:', snapshot_output); - -if (snapshot_output && snapshot_output.result !== 'NON_BREAKING') { - const title = ':exclamation: JavaScript API change detected'; - const idea = - 'This PR commits an update to ReactNativeApi.d.ts, indicating a change to React Native's public JavaScript API. ' + - 'Please include a clear changelog message. ' + - 'This change will be subject to extra review.\n\n' + - `This change was flagged as: ${snapshot_output.result}`; - warn(`${title} - ${idea}`); +if (fs.existsSync(snapshot_path)) { + const snapshot_output = JSON.parse(fs.readFileSync(snapshot_path, 'utf8')); + if (snapshot_output && snapshot_output.result !== 'NON_BREAKING') { + const title = ':exclamation: JavaScript API change detected'; + const idea = + 'This PR commits an update to ReactNativeApi.d.ts, indicating a change to React Native's public JavaScript API. ' + + 'Please include a clear changelog message. ' + + 'This change will be subject to extra review.\n\n' + + `This change was flagged as: ${snapshot_output.result}`; + warn(`${title} - ${idea}`); + } } const hasNoUsefulBody = From b5d5f890a86e2ec7c2231426383b7efb0b66f6a0 Mon Sep 17 00:00:00 2001 From: Dawid Malecki Date: Mon, 3 Nov 2025 10:53:16 +0100 Subject: [PATCH 09/11] update danger --- .github/actions/diff-js-api-breaking-changes/action.yml | 2 +- private/react-native-bots/dangerfile.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/actions/diff-js-api-breaking-changes/action.yml b/.github/actions/diff-js-api-breaking-changes/action.yml index 8dbd744916d938..182f323d6b61c4 100644 --- a/.github/actions/diff-js-api-breaking-changes/action.yml +++ b/.github/actions/diff-js-api-breaking-changes/action.yml @@ -18,7 +18,7 @@ runs: SCRATCH_DIR: ${{ runner.temp }}/diff-js-api-breaking-changes run: | # Check if the file was changed in this PR, if not, exit early without saving to the output.json - git diff --name-status | awk '{print $2}' | grep 'packages/react-native/ReactNativeApi.d.ts' || exit 0 + git diff --name-status | awk '{print $2}' | grep 'packages/react-native/ReactNativeApi.d.ts' || echo "ReactNativeApi.d.ts not found, exiting" && exit 0 node ./scripts/js-api/diff-api-snapshot \ ${{ github.workspace }}/packages/react-native/ReactNativeApi.d.ts \ diff --git a/private/react-native-bots/dangerfile.js b/private/react-native-bots/dangerfile.js index 07a4a921e56682..7ed51328e3d324 100644 --- a/private/react-native-bots/dangerfile.js +++ b/private/react-native-bots/dangerfile.js @@ -36,7 +36,9 @@ const snapshot_path = path.join( ); if (fs.existsSync(snapshot_path)) { + console.log('JS API snapshot found, checking for changes...'); const snapshot_output = JSON.parse(fs.readFileSync(snapshot_path, 'utf8')); + console.log('Snapshot output:', snapshot_output); if (snapshot_output && snapshot_output.result !== 'NON_BREAKING') { const title = ':exclamation: JavaScript API change detected'; const idea = @@ -46,6 +48,8 @@ if (fs.existsSync(snapshot_path)) { `This change was flagged as: ${snapshot_output.result}`; warn(`${title} - ${idea}`); } +} else { + console.log('No JS API snapshot found, skipping JS API change check.'); } const hasNoUsefulBody = From a747c1ca479b14c6c8ef102c97636d9d0613d49b Mon Sep 17 00:00:00 2001 From: Dawid Malecki Date: Mon, 3 Nov 2025 10:55:53 +0100 Subject: [PATCH 10/11] changed api --- packages/react-native/ReactNativeApi.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactNativeApi.d.ts b/packages/react-native/ReactNativeApi.d.ts index 073a1f2a9a1e15..6befeb557b43d9 100644 --- a/packages/react-native/ReactNativeApi.d.ts +++ b/packages/react-native/ReactNativeApi.d.ts @@ -6115,7 +6115,7 @@ export { SectionListData, // 119baf83 SectionListProps, // c9ac8e07 SectionListRenderItem, // 1fad0435 - SectionListRenderItemInfo, // 745e1992 + SectionListRenderItemInfo, // 745e1995 Separators, // 6a45f7e3 Settings, // 4282b0da Share, // e4591b32 From d070c8bc553564f5a9c0b1edbc37cb0e847d1c45 Mon Sep 17 00:00:00 2001 From: Dawid Malecki Date: Mon, 3 Nov 2025 10:58:33 +0100 Subject: [PATCH 11/11] logs --- .github/actions/diff-js-api-breaking-changes/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/diff-js-api-breaking-changes/action.yml b/.github/actions/diff-js-api-breaking-changes/action.yml index 182f323d6b61c4..c3b1ae2124803d 100644 --- a/.github/actions/diff-js-api-breaking-changes/action.yml +++ b/.github/actions/diff-js-api-breaking-changes/action.yml @@ -18,6 +18,8 @@ runs: SCRATCH_DIR: ${{ runner.temp }}/diff-js-api-breaking-changes run: | # Check if the file was changed in this PR, if not, exit early without saving to the output.json + git diff --name-status + git diff --name-status | awk '{print $2}' git diff --name-status | awk '{print $2}' | grep 'packages/react-native/ReactNativeApi.d.ts' || echo "ReactNativeApi.d.ts not found, exiting" && exit 0 node ./scripts/js-api/diff-api-snapshot \