Skip to content

Drop SignedSource hash from ReactNativeApi.d.ts - #60461

Open
zoontek wants to merge 1 commit into
react:mainfrom
zoontek:drop-signedsource-js-api-snapshot
Open

zoontek wants to merge 1 commit into
react:mainfrom
zoontek:drop-signedsource-js-api-snapshot

Conversation

@zoontek

@zoontek zoontek commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Summary:

Two PRs that touch the public JS API always conflict in packages/react-native/ReactNativeApi.d.ts, even when their changes are far apart. The cause is the @generated SignedSource<<...>> hash in the header: it is an MD5 of the whole file, so it changes on every API change.

Nothing in OSS verifies this signature. yarn build-types --validate compares the full file text. This PR replaces the hash with a plain @generated marker, like the C++ API snapshots in scripts/cxx-api/api-snapshots.

Changelog:

[INTERNAL] [CHANGED] - Drop SignedSource hash from ReactNativeApi.d.ts

Test Plan:

I ran yarn build-types, which changed only the header line of the snapshot, then confirmed that yarn build-types --validate passes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 2, 2026
@facebook-github-tools facebook-github-tools Bot added p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Dec 2, 2026
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<d85687fceb0705d7e07b3a0b4529a17f>>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keen for us to validate this header, rather than delete it. We should prevent humans or agents from manually modifying this file. And it's an added level of intentionality — this file, and the API, isn't (quite) changed every day.

It's indeed a little inconvenient for merge conflicts, but agents are instructed to handle this (and in my use, do so transparently now).

- JavaScript sources are typed with Flow, and the public API is exported from `packages/react-native/index.js`. TypeScript types are generated from those sources, and `packages/react-native/ReactNativeApi.d.ts` is a committed snapshot of that API — run `yarn build-types` to regenerate both whenever the public API changes, then `yarn test-generated-typescript` to type-check the result.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

2 participants