Repository navigation
[js_interop] Add an api.txt golden - #609
Conversation
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.
There was a problem hiding this comment.
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.
srujzs
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
Talked offline, but I think this is fine and might prevent some accidental changes. We can always reevaluate of course.
Adds a golden summary of
package:js_interop's public API (js_interop/tool/api.txt, generated bypackage:api_summaryand excluded from the published archive via.pubignore) so signature and member changes are visible in PR diffs, matchingpackage:web(#590).js_interop.yamlrunsdart test -p vm test/api_test.dartonce on thedevSDK sincejs_interopdefaults to browser and Node test platforms andapi_summaryoutput tracks SDK analyzer updates.dart pub publish --dry-runreports 0 warnings (compressed archive stays 14 KB withtool/api.txtexcluded).