Skip to content

[web_generator] Setting up web_generator for Dart JS Interop Gen #368

New issue

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

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

Already on GitHub? # to your account

Merged
merged 12 commits into from
Jun 6, 2025

Conversation

nikeokoronkwo
Copy link
Contributor

This PR is for setting up the web_generator to begin adding support for generating Dart JS interop interface code from TypeScript Declaration Code.

For more information, see the project overview

  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.

@nikeokoronkwo nikeokoronkwo marked this pull request as ready for review June 3, 2025 18:13
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.

Very cool to see us adding TSC and potentially start using it!

@nikeokoronkwo nikeokoronkwo changed the title [web_generator] Set up [web_generator] Setting up web_generator to add support for Dart JS Interop Interface Generation Jun 4, 2025
@nikeokoronkwo nikeokoronkwo changed the title [web_generator] Setting up web_generator to add support for Dart JS Interop Interface Generation [web_generator] Setting up web_generator for Dart JS Interop Gen Jun 4, 2025
@nikeokoronkwo nikeokoronkwo requested review from srujzs and kevmoo June 4, 2025 03:36
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!

@srujzs srujzs removed the request for review from kevmoo June 6, 2025 15:57
@srujzs srujzs merged commit 4d24eb5 into dart-lang:main Jun 6, 2025
15 checks passed
@nikeokoronkwo nikeokoronkwo deleted the webgen/skeletal-scaffold branch June 6, 2025 18:07
@kevmoo
Copy link
Member

kevmoo commented Jun 6, 2025

The tests don't run by default because they are VM tests.
And when I run them locally they fail because there is not test input/output data.

@kevmoo
Copy link
Member

kevmoo commented Jun 6, 2025

Also

diff --git a/web_generator/test/ts_bindings_test.dart b/web_generator/test/ts_bindings_test.dart
index 3470d7a..8ef208a 100644
--- a/web_generator/test/ts_bindings_test.dart
+++ b/web_generator/test/ts_bindings_test.dart
@@ -9,13 +9,12 @@ import 'package:test/test.dart';
 import 'package:web_generator/src/cli.dart';
 
 void main() {
-  final testGenFolder = p.join('test', 'gen');
-  final testGenDTSFiles = p.join(testGenFolder, 'input');
-
   group('Web Generator TS Bindings Integration Test', () {
+    final testGenFolder = p.join('test', 'gen');
+    final testGenDTSFiles = p.join(testGenFolder, 'input');
     final inputDir = Directory(testGenDTSFiles);
 
-    setUp(() async {
+    setUpAll(() async {
       // set up npm
       await runProc('npm', ['install'],
           workingDirectory: bindingsGeneratorPath, detached: true);

Should keep the group vars together.
Should use setUpAll so the compile is only run once – since there should be ZERO change between tests. But that's once we have tests 😄

@srujzs
Copy link
Contributor

srujzs commented Jun 6, 2025

The tests don't run by default because they are VM tests.
And when I run them locally they fail because there is not test input/output data.

It looks like we were skipping a test already because of this: #373.

@nikeokoronkwo I filed #372 to track unskipping this test now that I'm enabling it in the CI. We should add a data folder that we read from and have the test use that.

@nikeokoronkwo
Copy link
Contributor Author

The tests don't run by default because they are VM tests. And when I run them locally they fail because there is not test input/output data.

I wanted to work on test implementation once we started working on declarations, as adding test cases now would fail anyways.

We should add a data folder that we read from and have the test use that.

The folder I used for this is gen/input for input data and gen/expected for output (both actual and expected)

copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Jun 9, 2025
Revisions updated by `dart tools/rev_sdk_deps.dart`.

ai (https://github.com/dart-lang/ai/compare/1d9d60c..f2b48c6):
  f2b48c6  2025-06-09  Nate Bosch  Retain compatibility with 3.7 SDKs (dart-lang/ai#163)
  52adf08  2025-06-06  Jacob MacDonald  add homepage, repository, and documentation links to the pub result (dart-lang/ai#155)
  fa1c2be  2025-06-06  Nate Bosch  Always use the failures-only reporter for testing (dart-lang/ai#160)
  66a152f  2025-06-06  Nate Bosch  Instruct clients to prefer MCP (dart-lang/ai#161)
  55ad850  2025-06-05  Jacob MacDonald  Add a retroactive changelog (dart-lang/ai#157)
  b08a610  2025-06-05  Jacob MacDonald  Update instructions, add cursor install link (dart-lang/ai#159)

web (https://github.com/dart-lang/web/compare/f1becf0..de6b3e4):
  de6b3e4  2025-06-06  Srujan Gaddam  Add missing copyrights and delete empty files (dart-lang/web#371)
  74a33ba  2025-06-06  Kevin Moore  Add in a missing library directive, missing new line (dart-lang/web#370)
  4d24eb5  2025-06-06  nikeokoronkwo  [web_generator] Setting up `web_generator` for Dart JS Interop Gen (dart-lang/web#368)

webdev (https://github.com/dart-lang/webdev/compare/55941b0..661dafd):
  661dafd4  2025-06-08  Srujan Gaddam  Defer execution of main until resume for hot restart with DDC library bundle format (dart-lang/webdev#2623)
  01a3b9d7  2025-06-06  Nicholas Shahan  Remove skip from chrome proxy service test

Change-Id: If3d4326d0bacf47a4d95520dbd0aac5fb58de439
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433363
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants