Skip to content

Add Variable Declaration Support #382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jun 18, 2025

Conversation

nikeokoronkwo
Copy link
Contributor

@nikeokoronkwo nikeokoronkwo commented Jun 11, 2025

Fixes #375

This pull requests aims to add support for Variable declaration to the Dart JS Interop Generation Tool, as well as introduce features to be used for supporting other declarations.

This pull request also aims to add base, foundational features to support handling future features like name collisions (overloading), filtering declarations, and making use of referencing types (i.e referencing a type in of itself or using typeof on a declaration) via the typescript type-checker API.

This PR contains an addition to the interop gen test suite to test these declarations. More will be added as dependent features are supported

@nikeokoronkwo nikeokoronkwo requested a review from kevmoo June 11, 2025 04:44
@nikeokoronkwo nikeokoronkwo marked this pull request as ready for review June 12, 2025 04:34
@kevmoo
Copy link
Member

kevmoo commented Jun 13, 2025

@srujzs ?

@kevmoo kevmoo requested a review from srujzs June 13, 2025 00:38
Copy link
Contributor

@srujzs srujzs left a comment

Choose a reason for hiding this comment

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

Thanks Nike, super cool to see! I added a first pass of comments. In general, I'd go through and add Dart doc comments on non-obvious declarations to detail what the function of each method is. I'd also wait to add functionality that doesn't get used yet so this PR is more focused.

@nikeokoronkwo nikeokoronkwo requested a review from srujzs June 17, 2025 21:12
Copy link
Contributor

@srujzs srujzs left a comment

Choose a reason for hiding this comment

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

LGTM % my comments, thanks!

@@ -117,17 +122,14 @@ class UnionType extends Type {

class VariableDeclaration extends NamedDeclaration
Copy link
Contributor

Choose a reason for hiding this comment

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

We talked briefly about having the IDL use this AST as well, but I'm okay either if you want to do this now as you're adding nodes or later when we have the necessary AST for the IDL generation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll add this later when I'm working with nodes similar to those in the IDL. Since we didn't find any instances of global declarations, the next AST declaration would be interfaces

Copy link
Contributor

@srujzs srujzs left a comment

Choose a reason for hiding this comment

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

Thanks Nike!

@srujzs srujzs merged commit 4b2f02e into dart-lang:main Jun 18, 2025
16 checks passed
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Jun 23, 2025
Revisions updated by `dart tools/rev_sdk_deps.dart`.

ai (https://github.com/dart-lang/ai/compare/f2b48c6..12ac0a4):
  12ac0a4  2025-06-18  Jacob MacDonald  make the log file test less flaky by retrying deletes and reads (dart-lang/ai#180)
  dbedc6d  2025-06-18  Jacob MacDonald  fix cruft in description (dart-lang/ai#179)
  3ab9482  2025-06-18  Jacob MacDonald  improve tool description for the dtd connection tool and improve error messages (dart-lang/ai#178)
  4ca0ff1  2025-06-18  Jacob MacDonald  Use shared Implementation type, add clientInfo field to MCPServer (dart-lang/ai#175)
  885a4c5  2025-06-18  Jacob MacDonald   Add `--log-file` argument to log all protocol traffic to a file (dart-lang/ai#176)
  7ca3eba  2025-06-17  Nate Bosch  Add JSON schema for test runner arguments (dart-lang/ai#169)

core (https://github.com/dart-lang/core/compare/dc97530..b59ecf4):
  b59ecf4c  2025-06-18  Lasse R.H. Nielsen  Optimize surrogate decoding. (dart-lang/core#894)

dartdoc (https://github.com/dart-lang/dartdoc/compare/4ceea6b..f1fe177):
  f1fe1775  2025-06-16  Sarah Zakarias  Refactor 404 error page to use div instead of p for search form (dart-lang/dartdoc#4064)

ecosystem (https://github.com/dart-lang/ecosystem/compare/64aac3a..d5233c6):
  d5233c6  2025-06-13  dependabot[bot]  Bump the github-actions group with 5 updates (dart-lang/ecosystem#351)

web (https://github.com/dart-lang/web/compare/c8c1c28..4b2f02e):
  4b2f02e  2025-06-18  nikeokoronkwo  Add Variable Declaration Support (dart-lang/web#382)

webdev (https://github.com/dart-lang/webdev/compare/661dafd..6dc3dde):
  6dc3ddef  2025-06-20  Jessy Yameogo  Fix duplicate connection/logs in Webdev (dart-lang/webdev#2635)
  0c8a17b4  2025-06-20  Morgan :)  Remove dependency overrides. (dart-lang/webdev#2634)
  a3218638  2025-06-16  Jessy Yameogo  modifying DWDS Injector to always inject client and introduce useDwdsWebSocketConnection flag (dart-lang/webdev#2629)
  2eb27546  2025-06-16  Morgan :)  Prepare for `build_runner` changes. (dart-lang/webdev#2633)

Change-Id: Ib323bea37dd77ed94387e77d9c504f889bfa8050
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/436021
Auto-Submit: Devon Carew <[email protected]>
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>
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.

Interop Gen: Support Variable Declarations
3 participants