build(core): Add public API surface tracking with api-extractor#6093
Merged
build(core): Add public API surface tracking with api-extractor#6093
Conversation
Contributor
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
Contributor
Closes #6092 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
27d9a37 to
844877f
Compare
Prevents the API report from changing on every version bump. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced May 6, 2026
Contributor
|
I wonder if it’s really the best solution for this purpose. Have you explored any alternatives? I’ve just found this post with someone mostly complaining about api-extractor and started wondering: https://www.thecandidstartup.org/2024/07/19/bootstrapping-api-extractor.html |
Contributor
Author
|
@alwx I did a short research and didn't find something better for this purpose. I chose this since it is actively maintained and also used on the react native repo |
alwx
approved these changes
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📢 Type of change
📜 Description
Adds @microsoft/api-extractor to track the public API surface of
@sentry/react-native. A baseline report is generated and committed atpackages/core/etc/sentry-react-native.api.md. A CI job validates the report is up to date on every PR.New files:
packages/core/api-extractor.json— api-extractor configurationpackages/core/tsconfig.api-extractor.json— dedicated tsconfig for api-extractor compatibilitypackages/core/etc/sentry-react-native.api.md— committed API baseline (173 exported symbols)Modified files:
packages/core/package.json— added devDependency +api-report:generate/api-report:checkscriptspackage.json— addedyarn api-reportroot shortcut.github/workflows/buildandtest.yml— addedjob_api_reportCI job.gitignore— excludes api-extractor temp filesCONTRIBUTING.md— documents the developer workflow💡 Motivation and Context
The Sentry Cocoa SDK uses
swift-api-digesterand the Android SDK uses Metalava to track public API surfaces and prevent accidental breaking changes. The React Native SDK had no equivalent. This brings parity with the native SDKs.React Native core (
facebook/react-native) also uses@microsoft/api-extractorfor this purpose.Closes #6092
💚 How did you test it?
yarn api-report:generate— produced 751-line report with 173 exportsyarn api-report:checkpasses (no diff from baseline)yarn test)yarn lint)yarn circularDepCheck)📝 Checklist
sendDefaultPIIis enabled🔮 Next steps