You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 79d7419
Browse filesBrowse the repository at this point in the historyBrowse files
Summary:
`ReactAndroid.api` tracks the public Java/Kotlin API of ReactAndroid, but nothing in this repo could regenerate or check it, so a contributor changing a public Android API had no way to update the snapshot (#60446).
This adds `yarn android-api-build` and `yarn android-api-validate`, which work like `yarn cxx-api-build` and `yarn cxx-api-validate`:
- A new `publicApiDump` Gradle task on ReactAndroid compiles the release classes and dumps their public API with the `binary-compatibility-validator` library, using the filters already in `ReactAndroid/gradle.properties`. The validator plugin's own `apiDump`/`apiCheck` tasks never existed here: they only attach to projects that apply `kotlin-android`, which AGP 9's built-in Kotlin replaces, and `validationDisabled=true` turns them off anyway.
- `scripts/android-api/build-android-api.js` runs that dump, then writes the snapshot or prints a diff against it.
- The validator moves to 0.17.0, and `kotlin-metadata-jvm` joins the root build script classpath because the validator library needs it at runtime.
The snapshot itself does not change. It also records entries the Gradle build does not produce: Kotlin `$DefaultImpls` classes and forwarders to inherited interface default methods, `$$ReactModuleInfoProvider` classes for `ReactModuleList` packages, and bridges for some internal members. The script carries those over from the committed snapshot: `$DefaultImpls` members follow each interface's default methods, and `$DefaultImpls` classes, forwarders and bridges go away with the class or default method they belong to. It does not predict new ones. A Gradle dump of an unchanged tree reproduces `ReactAndroid.api` byte for byte.
`yarn android-api-validate` prints the difference with `git diff --no-index` rather than `diff`, which Windows does not have, and compares CRLF checkouts as LF.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D135395265
Copy file name to clipboardExpand all lines: AGENTS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,7 @@ Never hand-edit generated output — change the source and regenerate. CI valida
69
69
- Native modules and components are declared by JavaScript specs (`Native*.js`, `*NativeComponent.js`); their native counterparts are generated at build time.
70
70
- Feature flags are declared in `packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js`; `yarn featureflags` regenerates the JavaScript, Java, and C++ accessors.
71
71
- 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.
72
-
- The public native API is snapshotted as well: C++ under `scripts/cxx-api` (`yarn cxx-api-build`), and Android in `packages/react-native/ReactAndroid/api/ReactAndroid.api`.
72
+
- The public native API is snapshotted as well: C++ under `scripts/cxx-api` (`yarn cxx-api-build`), and Android in `packages/react-native/ReactAndroid/api/ReactAndroid.api` (`yarn android-api-build`).
73
73
-`CHANGELOG.md` is compiled at release time from pull request descriptions.
0 commit comments