scripts/js-api/README.md
TypeScript build pipeline for React Native's JavaScript API.
yarn build-types is a custom build pipeline for translating React Native's Flow source code to TypeScript.
Specifically, it reduces the runtime JavaScript API of react-native into two outputs:
packages/react-native/types_generated/packages/react-native/ReactNativeApi.d.tsyarn build-types makes use of the following dependencies, composed with other pre/post transformation steps and dependency resolution.
Maintainers should run this script whenever making intentional API changes.
# Build types + API snapshot
yarn build-types [--validate]
# Build types without API snapshot
yarn build-types --skip-snapshot
This script is run by CI to compare changes to ReactNativeApi.d.ts between commits.
# Compare two versions of the API snapshot
yarn js-api-diff <before.d.ts> <after.d.ts>
{
"result": "BREAKING",
"changedApis": [
"ViewStyle"
]
}
Sparse configuration options are defined and documented in scripts/js-api/config.js.
types_generated/
Directory providing TypeScript user types for the react-native package, distributed via npm.
index.d.ts entry point via package.json#exports.unstable_ and experimental_ APIs.ReactNative.d.ts
Provides a human-readable, maintainable reference of the React Native's public JavaScript API, optimized for developers and diff tooling.
unstable_ and experimental_ APIs.