Skip to content

[js_interop] Add an api.txt golden - #609

Merged
kevmoo merged 1 commit into
mainfrom
js-interop-api-txt
Oct 29, 2026
Merged

kevmoo merged 1 commit into
mainfrom
js-interop-api-txt

Conversation

@kevmoo

@kevmoo kevmoo commented Oct 29, 2026

Copy link
Copy Markdown
Member

Adds a golden summary of package:js_interop's public API (js_interop/tool/api.txt, generated by package:api_summary and excluded from the published archive via .pubignore) so signature and member changes are visible in PR diffs, matching package:web (#590).

  • js_interop.yaml runs dart test -p vm test/api_test.dart once on the dev SDK since js_interop defaults to browser and Node test platforms and api_summary output tracks SDK analyzer updates.
  • dart pub publish --dry-run reports 0 warnings (compressed archive stays 14 KB with tool/api.txt excluded).

Track `package:js_interop`'s public API surface with `package:api_summary`
(`js_interop/tool/api.txt`, excluded from the published archive via
`.pubignore`) so signature and member changes are visible in PR diffs,
matching `package:web` (#590).

CI runs `test/api_test.dart` on the VM against the `dev` SDK since
`js_interop` defaults to browser and Node test platforms and `api_summary`
output tracks SDK analyzer updates.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces API summary testing to the js_interop package. It adds the api_summary package as a development dependency, creates a test to verify that the public API matches a golden file, and generates the initial golden file tool/api.txt. Additionally, a .pubignore file is added to exclude development-only files from package publication. There are no review comments, and I have no feedback to provide.

@kevmoo
kevmoo requested a review from srujzs October 29, 2026 19:11

@srujzs srujzs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there value in this? package:js_interop is not generated (maybe it might be in the future), so the changes will be obvious. If we think dart fixes might benefit from this summary then that's fine, but currently, this adds an additional step for any contributions.

@kevmoo

kevmoo commented Oct 29, 2026

Copy link
Copy Markdown
Member Author

Is there value in this? package:js_interop is not generated (maybe it might be in the future), so the changes will be obvious. If we think dart fixes might benefit from this summary then that's fine, but currently, this adds an additional step for any contributions.

The additional step is very clear, I think. Having unambiguous visibility into the APIs that are visible is useful, I think.

@srujzs srujzs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Talked offline, but I think this is fine and might prevent some accidental changes. We can always reevaluate of course.

@kevmoo
kevmoo merged commit a417931 into main Oct 29, 2026
20 checks passed
@kevmoo
kevmoo deleted the js-interop-api-txt branch October 29, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants