Skip to content

[generator] Add support for source map backed stack traces for debugging generator output#522

Draft
nikeokoronkwo wants to merge 23 commits intodart-lang:mainfrom
nikeokoronkwo:feat/stack_traces
Draft

[generator] Add support for source map backed stack traces for debugging generator output#522
nikeokoronkwo wants to merge 23 commits intodart-lang:mainfrom
nikeokoronkwo:feat/stack_traces

Conversation

@nikeokoronkwo
Copy link
Copy Markdown
Collaborator

@nikeokoronkwo nikeokoronkwo commented Mar 15, 2026

Fixes #505

This PR adds support for working with the web generator errors better using dart-style stack traces by mapping the stack trace frames from V8/NodeJS to Dart, using the related dart packages.

This makes the error messages much easier to debug and deal with, which improves debugging

Issues

  1. There are some issues mapping the frames completely, including but not limited to mapping npm dependency code in the stack frames. The major example here being that the frames occuring from the typescript package are being mapped to other unrelated packages. An example before:
    at getTypeFromTypeReference (~/web/web_generator/lib/src/node_modules/typescript/lib/typescript.js:65071:36)
    at getTypeFromTypeNodeWorker (~/web/web_generator/lib/src/node_modules/typescript/lib/typescript.js:67750:16)
    at getTypeFromTypeNode (~/web/web_generator/lib/src/node_modules/typescript/lib/typescript.js:67712:41)
    at Object.getTypeFromTypeNode (~/web/web_generator/lib/src/node_modules/typescript/lib/typescript.js:51140:21)
    at Transformer._transformType$4$isNullable$parameter$typeArg (~/web/web_generator/lib/src/dart_main.js:8064
    at Transformer._transformType$1 (~/web/web_generator/lib/src/dart_main.js:81095:19)

and after:

../../../../../../.pub-cache/hosted/pub.dev/dart_style-3.1.3/lib/src/front_end/piece_writer.dart 208:23  getTypeFromTypeReference
../../../../../../.pub-cache/hosted/pub.dev/dart_style-3.1.3/lib/src/short/rule/rule.dart 166:5          getTypeFromTypeNode
org-dartlang-sdk:///lib/_internal/js_shared/lib/js_util_patch.dart 149:10                                Transformer._transformType

commit 48b7512
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Sun Mar 1 06:52:52 2026 +0000

    Bump actions/stale from 10.1.1 to 10.2.0 in the github-actions group (dart-lang#520)

    Bumps the github-actions group with 1 update: [actions/stale](https://github.com/actions/stale).

    Updates `actions/stale` from 10.1.1 to 10.2.0
    <details>
    <summary>Release notes</summary>
    <p><em>Sourced from <a href="https://github.com/actions/stale/releases">actions/stale's releases</a>.</em></p>
    <blockquote>
    <h2>v10.2.0</h2>
    <h2>What's Changed</h2>
    <h3>Bug Fix</h3>
    <ul>
    <li>Fix checking state cache (fix <a href="https://redirect.github.com/actions/stale/issues/1136">#1136</a>) and switch to Octokit helper methods by <a href="https://github.com/itchyny"><code>@​itchyny</code></a> in <a href="https://redirect.github.com/actions/stale/pull/1152">actions/stale#1152</a></li>
    </ul>
    <h3>Dependency Updates</h3>
    <ul>
    <li>Upgrade js-yaml from  4.1.0 to 4.1.1 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/actions/stale/pull/1304">actions/stale#1304</a></li>
    <li>Upgrade lodash from 4.17.21 to 4.17.23 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/actions/stale/pull/1313">actions/stale#1313</a></li>
    <li>Upgrade actions/cache from 4.0.3 to 5.0.2 and actions/github from 5.1.1 to 7.0.0  by <a href="https://github.com/chiranjib-swain"><code>@​chiranjib-swain</code></a> in <a href="https://redirect.github.com/actions/stale/pull/1312">actions/stale#1312</a></li>
    </ul>
    <h2>New Contributors</h2>
    <ul>
    <li><a href="https://github.com/itchyny"><code>@​itchyny</code></a> made their first contribution in <a href="https://redirect.github.com/actions/stale/pull/1152">actions/stale#1152</a></li>
    </ul>
    <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/stale/compare/v10...v10.2.0">https://github.com/actions/stale/compare/v10...v10.2.0</a></p>
    </blockquote>
    </details>
    <details>
    <summary>Commits</summary>
    <ul>
    <li><a href="https://github.com/actions/stale/commit/b5d41d4e1d5dceea10e7104786b73624c18a190f"><code>b5d41d4</code></a> build(deps-dev): bump lodash from 4.17.21 to 4.17.23 (<a href="https://redirect.github.com/actions/stale/issues/1313">#1313</a>)</li>
    <li><a href="https://github.com/actions/stale/commit/dcd2b9469d2220b7e8d08aedc00c105d277fd46b"><code>dcd2b94</code></a> Fix punycode and url.parse Deprecation Warnings (<a href="https://redirect.github.com/actions/stale/issues/1312">#1312</a>)</li>
    <li><a href="https://github.com/actions/stale/commit/d6f8a33132340b15a7006f552936e4b9b39c00ec"><code>d6f8a33</code></a> build(deps-dev): bump js-yaml from 4.1.0 to 4.1.1 (<a href="https://redirect.github.com/actions/stale/issues/1304">#1304</a>)</li>
    <li><a href="https://github.com/actions/stale/commit/a21a0816299b11691f9592ef0d63d08e02f06d9d"><code>a21a081</code></a> Fix checking state cache (fix <a href="https://redirect.github.com/actions/stale/issues/1136">#1136</a>), also switch to octokit methods (<a href="https://redirect.github.com/actions/stale/issues/1152">#1152</a>)</li>
    <li>See full diff in <a href="https://github.com/actions/stale/compare/997185467fa4f803885201cee163a9f38240193d...b5d41d4e1d5dceea10e7104786b73624c18a190f">compare view</a></li>
    </ul>
    </details>
    <br />

    [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/stale&package-manager=github_actions&previous-version=10.1.1&new-version=10.2.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

    ---

    <details>
    <summary>Dependabot commands and options</summary>
    <br />

    You can trigger Dependabot actions by commenting on this PR:
    - `@dependabot rebase` will rebase this PR
    - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
    - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
    - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
    - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
    - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
    - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency
    - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions

    </details>

commit a6336c8
Author: Kevin Moore <kevmoo@users.noreply.github.com>
Date:   Mon Feb 23 11:09:23 2026 -0800

    remove dynamic calls from Stream helpers (dart-lang#519)

    Mode CustomEventProviders `abstract final`
    Deleted a bunch of unused code in the streams.dart internal library

commit 94d22fe
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Feb 3 17:21:35 2026 -0800

    Bump actions/checkout from 6.0.1 to 6.0.2 in the github-actions group (dart-lang#515)

    Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout).

    Updates `actions/checkout` from 6.0.1 to 6.0.2
    - [Release notes](https://github.com/actions/checkout/releases)
    - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
    - [Commits](actions/checkout@8e8c483...de0fac2)

    ---
    updated-dependencies:
    - dependency-name: actions/checkout
      dependency-version: 6.0.2
      dependency-type: direct:production
      update-type: version-update:semver-patch
      dependency-group: github-actions
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 5edd2dd
Author: Kevin Moore <kevmoo@users.noreply.github.com>
Date:   Tue Feb 3 17:18:04 2026 -0800

    Fix use_null_aware_elements lint (dart-lang#518)

commit d1958f8
Author: Sagar <halladakerisagar@gmail.com>
Date:   Wed Feb 4 06:29:06 2026 +0530

    Support TypeScript indexed access types in interop_gen (dart-lang#509)

    * Support TypeScript indexed access types in interop_gen

    * Fix:prevent IndexedAccessType fallback from generating unsupported bindings

    * Remove unused indexed access fallback flag and simplify resolution logic

    * fixed analyzer issue

    * fix format issue

    * Improve IndexedAccessType handling and add composed type tests

    * interop_gen: refactor indexed access resolution, remove dead code, and Add test for symbol indexed access with primitive return type

commit 2590763
Author: Harshita Yadav <seemayadavanuj123@gmail.com>
Date:   Mon Jan 26 23:40:27 2026 +0530

    docs: clarify document.cookie nullability when migrating from dart:html (dart-lang#510)

    * docs: clarify document.cookie nullability when migrating from dart:html

    * docs: organize migration notes under specific APIs

commit b9b1b38
Author: Sagar <halladakerisagar@gmail.com>
Date:   Sat Jan 17 02:31:52 2026 +0530

    Interop gen additional literal types (dart-lang#503)

    * interop_gen: support additional literal type expressions via TypeChecker

    * fixed analyzer warning

    * simplify literal parsing and improve readability

    * Refactor literal handling and expand literal tests

    Use a shared helper to reduce duplication, remove unused TSTypeFlags, and
    add integration tests for false, null, and negative numeric literals.

    * Use typed literal helpers in _transformType and add tests

    Refactor literal handling to use scoped, typed helpers instead of a
    generic value-based helper. Clean up unused TSTypeFlags and add
    integration tests for false, null, and resolved-type literals.

    * fix CI issue

    * enable fallback literal coverage and update expectations

commit 1dfcee7
Author: Harshita Yadav <seemayadavanuj123@gmail.com>
Date:   Fri Jan 16 03:21:37 2026 +0530

    docs(web_generator): document minimum supported Node.js version (dart-lang#508)

    * docs(web_generator): document minimum supported Node.js version

    * docs(web_generator): simplify Node.js version wording
Fixes dart-lang#505

This PR adds support for working with the web generator errors better using dart-style stack traces by mapping the stack trace frames from V8/NodeJS to Dart, using the related dart packages.

This makes the error messages much easier to debug and deal with, which improves debugging

## Issues
1. There are some issues mapping the frames completely, including but not limited to mapping `npm` dependency code in the stack frames. The major example here being that the frames occuring from the `typescript` package are being mapped to other unrelated packages. An example before:
```
    at getTypeFromTypeReference (~/web/web_generator/lib/src/node_modules/typescript/lib/typescript.js:65071:36)
    at getTypeFromTypeNodeWorker (~/web/web_generator/lib/src/node_modules/typescript/lib/typescript.js:67750:16)
    at getTypeFromTypeNode (~/web/web_generator/lib/src/node_modules/typescript/lib/typescript.js:67712:41)
    at Object.getTypeFromTypeNode (~/web/web_generator/lib/src/node_modules/typescript/lib/typescript.js:51140:21)
    at Transformer._transformType$4$isNullable$parameter$typeArg (~/web/web_generator/lib/src/dart_main.js:8064
    at Transformer._transformType$1 (~/web/web_generator/lib/src/dart_main.js:81095:19)
```

and after:
```
../../../../../../.pub-cache/hosted/pub.dev/dart_style-3.1.3/lib/src/front_end/piece_writer.dart 208:23  getTypeFromTypeReference
../../../../../../.pub-cache/hosted/pub.dev/dart_style-3.1.3/lib/src/short/rule/rule.dart 166:5          getTypeFromTypeNode
org-dartlang-sdk:///lib/_internal/js_shared/lib/js_util_patch.dart 149:10                                Transformer._transformType
```
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the debugging experience for the web_generator by implementing a mechanism to map V8/NodeJS stack traces to their corresponding Dart source locations. This transformation provides more readable and actionable error messages, making it easier to identify and resolve issues within the generated code. Additionally, it includes refactoring of event handling in package:web and updates to the generator's type processing capabilities.

Highlights

  • Dart-style Stack Trace Mapping: Implemented a mechanism to map V8/NodeJS stack traces from the web generator to Dart source locations, significantly improving error readability and debugging.
  • Raw Stack Trace Option: Introduced a --raw-stack-traces flag in gen_interop_bindings.dart to allow developers to view unmapped JavaScript stack traces if needed.
  • Event Provider Refactoring in package:web: Consolidated CustomEventProviders into EventStreamProviders for a cleaner and more consistent event handling API.
  • Enhanced Type Transformation in web_generator: Improved the web_generator's ability to correctly transform TypeScript literal types and indexed access types into their Dart equivalents.
  • Node.js Requirement Update: Updated the minimum Node.js version requirement for web_generator to v22 or newer.
Changelog
  • web/CHANGELOG.md
    • Removed CustomEventProviders and noted their migration to EventStreamProviders.
  • web/README.md
    • Documented that document.cookie is now non-nullable and always returns a String in package:web.
  • web/lib/src/helpers/events/events.dart
    • Migrated custom event extensions from CustomEventProviders to EventStreamProviders.
  • web/lib/src/helpers/events/providers.dart
    • Consolidated CustomEventProviders into EventStreamProviders by moving relevant static members.
  • web/lib/src/helpers/events/streams.dart
    • Removed unused Device import and simplified event listener wrapping logic.
  • web_generator/README.md
    • Added a requirement for Node.js v22 or newer for web_generator.
  • web_generator/bin/gen_interop_bindings.dart
    • Implemented source map-based stack trace mapping for Node.js errors.
    • Added a --raw-stack-traces flag to display unmapped JavaScript stack traces.
  • web_generator/lib/src/ast/declarations.dart
    • Refactored conditional list additions for constructors and extendees using if (x != null) x to [?x].
  • web_generator/lib/src/ast/merger.dart
    • Refactored conditional list additions for extensions and enums using if (x != null) x to [?x].
  • web_generator/lib/src/cli.dart
    • Refactored conditional list additions for supertypes using if (x != null) x to [?x].
  • web_generator/lib/src/dart_main.dart
    • Added a TODO comment regarding Dart stack traces in JS.
  • web_generator/lib/src/interop_gen/parser.dart
    • Enhanced error reporting for parsing diagnostics, adding ParseError prefix and conditional handleDiagnostics calls.
  • web_generator/lib/src/interop_gen/transform/transformer.dart
    • Refactored modifier parsing for class declarations.
    • Simplified name assignment for literal expressions.
    • Introduced helper functions for literal type creation.
    • Added comprehensive logic for transforming IndexedAccessType nodes.
  • web_generator/lib/src/js/typescript.dart
    • Exposed typeToString and typeToTypeNode methods from TypeScript's TSTypeChecker for advanced type introspection.
  • web_generator/lib/src/js/typescript.types.dart
    • Defined TSTypeFlags.BooleanLiteral and TSSyntaxKind.IndexedAccessType.
    • Added new extension types for TSLiteralType, TSNumberLiteralType, and TSStringLiteralType.
  • web_generator/pubspec.yaml
    • Added new dependencies: source_map_stack_trace, source_maps, and stack_trace.
  • web_generator/test/integration/interop_gen/indexed_access_test_expected.dart
    • Added expected output for indexed access type transformation tests.
  • web_generator/test/integration/interop_gen/indexed_access_test_input.d.ts
    • Added new TypeScript declaration file for indexed access type tests.
  • web_generator/test/integration/interop_gen/literal_test_expected.dart
    • Added expected output for literal type transformation tests.
  • web_generator/test/integration/interop_gen/literal_test_input.d.ts
    • Added new TypeScript declaration file for literal type tests.
Ignored Files
  • Ignored by pattern: .github/workflows/** (4)
    • .github/workflows/js_interop.yaml
    • .github/workflows/no-response.yml
    • .github/workflows/web.yaml
    • .github/workflows/web_generator.yaml
Activity
  • The pull request addresses issue [web_generator] Improve debugging of bin scripts with better stack traces #505 by implementing Dart-style stack trace mapping for web generator errors.
  • The author has provided example stack traces to demonstrate the improvement in error messages.
  • A known issue has been identified regarding difficulties in completely mapping frames from npm dependency code, specifically the typescript package.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@nikeokoronkwo nikeokoronkwo changed the title Feat/stack traces [generator] Add support for source map backed stack traces for debugging generator output Mar 15, 2026
Copy link
Copy Markdown
Contributor

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

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 significantly improves the debugging experience for the web generator by adding support for Dart-style stack traces. My review includes a suggestion to make the stack trace parsing more robust and a minor simplification in the IndexedAccessType logic.

Comment thread web_generator/bin/gen_interop_bindings.dart Outdated
Comment on lines +1976 to +1979
} else if (t is HomogenousEnumType) {
for (final sub in t.types) {
keys.addAll(collectKeys(sub));
}
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.

medium

Assuming HomogenousEnumType is a subtype of UnionType, this else if block is redundant. The logic for UnionType already handles iterating through types and recursively calling collectKeys. Removing this block will simplify the code without changing its behavior.

@nikeokoronkwo nikeokoronkwo requested a review from srujzs March 16, 2026 00:08
nikeokoronkwo and others added 12 commits March 15, 2026 20:09
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
* fix JSDate test overflow and simplify transformer code

* In `js_interop/test/date_test.dart`, set `date.date = 1` in `setUp` to
  avoid overflow when setting the month on dates like March 29th (which
  would wrap into March 1st if set to February on a non-leap year).
* In `js_interop/test/date_test.dart`, use a fresh `JSDate.nowAsDate()` in
  the `toDart` test to ensure comparison with `DateTime.now()` uses a
  consistent timezone and avoids state from other tests that may have
  modified the shared `date` instance.
* In `web_generator/lib/src/interop_gen/transform/transformer.dart`,
  simplify the reduction of referenced declarations using null-aware
  spreads (`...?`).

* test: prevent flaky file generation by synchronizing interop tests

- Implemented `compileBindingsGen` locking via `FileLock` to securely gate `npm install` and `dart compile js` across concurrent `package:test` isolates.
- Added smart evaluation to skip rebuilding if `dart_main.js` is newer than `lib/src` active files.
- Sorted test `inputDir.listSync()` iterations making testing order entirely deterministic.
- Included `.compile.lock` to `.gitignore` marker file omission.

* document and simplify
Bumps the github-actions group with 1 update: [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart).

Updates `dart-lang/setup-dart` from 1.7.1 to 1.7.2
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/dart-lang/setup-dart/releases">dart-lang/setup-dart's releases</a>.</em></p>
<blockquote>
<h2>v1.7.2</h2>
<ul>
<li>Update Node.js requirement to Node 24.</li>
<li>Fix open Dependabot alerts by bumping <code>undici</code> to <code>&gt;=6.24.0</code>.</li>
<li>Update GitHub Action dependencies (<code>@actions/core</code>, <code>@actions/exec</code>, <code>@actions/tool-cache</code>, <code>@actions/http-client</code>).</li>
<li>Update workflow actions to their latest versions (<code>actions/checkout</code> v6, <code>setup-flutter</code>).</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/dart-lang/setup-dart/blob/main/CHANGELOG.md">dart-lang/setup-dart's changelog</a>.</em></p>
<blockquote>
<h2>v1.7.2</h2>
<ul>
<li>Update Node.js requirement to Node 24.</li>
<li>Fix open Dependabot alerts by bumping <code>undici</code> to <code>&gt;=6.24.0</code>.</li>
<li>Update GitHub Action dependencies (<code>@actions/core</code>, <code>@actions/exec</code>, <code>@actions/tool-cache</code>, <code>@actions/http-client</code>).</li>
<li>Update workflow actions to their latest versions (<code>actions/checkout</code> v6, <code>setup-flutter</code>).</li>
</ul>
<h2>v1.7.1</h2>
<ul>
<li>Roll <code>undici</code> dependency to address <a href="https://github.com/nodejs/undici/security/advisories/GHSA-c76h-2ccp-4975">CVE-2025-22150</a>.</li>
<li>Update to the latest npm dependencies.</li>
<li>Recompile the action using the new Dart / JavaScript interop.</li>
</ul>
<h2>v1.7.0</h2>
<ul>
<li>
<p>Install flutter sdk in publishing step, allowing Flutter packages to be
published (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/68">#68</a>[])</p>
<p><a href="https://redirect.github.com/dart-lang/setup-dart/issues/68">#68</a>: <a href="https://redirect.github.com/dart-lang/setup-dart/issues/68">dart-lang/setup-dart#68</a></p>
</li>
</ul>
<h2>v1.6.5</h2>
<ul>
<li>Fix zip path handling on Windows 11 (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/118">#118</a>[])</li>
</ul>
<p><a href="https://redirect.github.com/dart-lang/setup-dart/issues/118">#118</a>: <a href="https://redirect.github.com/dart-lang/setup-dart/issues/118">dart-lang/setup-dart#118</a></p>
<h2>v1.6.4</h2>
<ul>
<li>Rebuild JS code.</li>
</ul>
<h2>v1.6.3</h2>
<ul>
<li>Roll <code>undici</code> dependency to address <a href="https://github.com/nodejs/undici/security/advisories/GHSA-m4v8-wqvr-p9f7">CVE-2024-30260</a> and <a href="https://github.com/nodejs/undici/security/advisories/GHSA-9qxr-qj54-h672">CVE-2024-30261</a>.</li>
</ul>
<h2>v1.6.2</h2>
<ul>
<li>Switch to running the workflow on <code>node20`` from </code>node16`. See also
<a href="https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/">Transitioning from Node 16 to Node 20</a>.</li>
</ul>
<h2>v1.6.1</h2>
<ul>
<li>Updated the google storage url for <code>main</code> channel releases.</li>
</ul>
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/dart-lang/setup-dart/commit/65eb853c7ba17dde3be364c3d2858773e7144260"><code>65eb853</code></a> chore: prepare v1.7.2 release (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/175">#175</a>)</li>
<li><a href="https://github.com/dart-lang/setup-dart/commit/6e0ff0bc3a029a9532ae6a86b1ea4906038921bc"><code>6e0ff0b</code></a> Node 24 (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/174">#174</a>)</li>
<li><a href="https://github.com/dart-lang/setup-dart/commit/03a180dbe1de8ea7fb700663cbb7d24ca4bbe82c"><code>03a180d</code></a> Group npm dependency updates (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/172">#172</a>)</li>
<li><a href="https://github.com/dart-lang/setup-dart/commit/74195ec01a320a45702f5d8d9aaae896f5a0b540"><code>74195ec</code></a> Bump <code>@​actions/exec</code> from 1.1.1 to 3.0.0 (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/167">#167</a>)</li>
<li><a href="https://github.com/dart-lang/setup-dart/commit/41705c951d02aaf00ead5b0423d0808ea495d9b5"><code>41705c9</code></a> Bump <code>@​actions/core</code> from 1.11.1 to 3.0.0 (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/168">#168</a>)</li>
<li><a href="https://github.com/dart-lang/setup-dart/commit/dd42013d4425790a72c8c6107773a99edeefd2a9"><code>dd42013</code></a> Bump <code>@​actions/tool-cache</code> from 2.0.2 to 4.0.0 (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/169">#169</a>)</li>
<li><a href="https://github.com/dart-lang/setup-dart/commit/b36cb5e0e609c7313088a6614db391df98780dce"><code>b36cb5e</code></a> Bump <code>@​actions/http-client</code> from 3.0.0 to 4.0.0 (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/170">#170</a>)</li>
<li><a href="https://github.com/dart-lang/setup-dart/commit/21e68f4d54916e6c2f68f8c290b2aed9b02cbd3e"><code>21e68f4</code></a> Bump actions/checkout from 5 to 6 in the github-actions group (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/162">#162</a>)</li>
<li><a href="https://github.com/dart-lang/setup-dart/commit/0bdb60234eb044854c1c73fb77b0f063cf290512"><code>0bdb602</code></a> Bump <code>@​actions/http-client</code> from 2.2.3 to 3.0.0 (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/160">#160</a>)</li>
<li><a href="https://github.com/dart-lang/setup-dart/commit/daef289245bc5d4ab7864e0788a58108a9be6c99"><code>daef289</code></a> Bump flutter-actions/setup-flutter in the github-actions group (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/159">#159</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/dart-lang/setup-dart/compare/e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c...65eb853c7ba17dde3be364c3d2858773e7144260">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=dart-lang/setup-dart&package-manager=github_actions&previous-version=1.7.1&new-version=1.7.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions

</details>
Move pkg:web to Dart 3.10 and regenerate
Move pkg:js_interop to Dart 3.10
Be MUCH smarter about running `npm` and compile
- Renamed package from `web_generator` to `js_interop_gen` to align with the monorepo structure.
- Removed `@webref` dependencies from `js_interop_gen/lib/src/package.json` to prevent implicit runtime reliance on the external `@webref` ecosystem.
- Refactored `generateBindingsForFiles` in `generate_bindings.dart` to pass an empty JS object instead of relying on missing global JS state for CSS and element definitions, resolving runtime crashes when dependencies were removed.
- Updated `idl_test.dart` to use a dummy BCD file to satisfy the parser and keep tests passing, while adding a TODO to track the removal of this cross-package dependency in the future.
- Fixed analyzer issues in `bcd.dart` related to type inference on collection literals (or specify if this was in generate_bindings.dart).
- Added GitHub CI status badges to the root `README.md` for all packages in the repository, removing the stale TODO comment.
…ate (dart-lang#538)

Greatly improves debugging when the generator (and tests) fail
Since it affects what we end up generating!
…g#534)

- Added generator logic to document the types that make up a union typedef.
- Mapped Web IDL primitives and special types to their corresponding `dart:js_interop` types (e.g., DOMString -> JSString, Function -> JSFunction) in docs.
- Wrapped types not generated in the package in backticks to avoid broken links.
- Correctly placed @DocImport directives on the library directive
dart-lang#540)

No need to create these if there is already a library import

Confirmed that we still have the same 811 doc issues before/after the change
So this makes things no worse!
- Added integration tests for inheritance fallback and name collisions in Web IDL:
  - `inheritance_fallback_input.idl` tests inheriting from a super type not defined in the IDL.
  - `name_collision_input.idl` tests operations with the same name as a defined type.
- Marked one of them as skipped because it reveals a crash. Fixing the crash messes up the existing handling of `Sensor`. So it's a reminder to revisit after the refactor.
@kevmoo
Copy link
Copy Markdown
Member

kevmoo commented Apr 29, 2026

@nikeokoronkwo – you going to run w/ this?

@nikeokoronkwo
Copy link
Copy Markdown
Collaborator Author

I will be back to this soon. I need to report an issue to the source_map_stack_traces library first, and I asked Srujan if he could take a look before I moved this from a draft. I have not gotten a response yet from him.

kevmoo and others added 8 commits May 4, 2026 09:35
Makes our final conversion a lot easier

ZERO code changes other than changing the order of elements in the library
…rt-lang#545)

Cleans up transformer.dart by moving isolated logic and pure utility
functions that do not rely on the core transformer state.

- Extracted `ExportReference` data class into a dedicated `export_reference.dart` file.
- Extracted context-independent helper functions (`parseModifiers`, `parseQualifiedNameParts`, `parseQualifiedNameFromTSQualifiedName`, `parseQualifiedName`, and `toCamelCase`) into a new `utils.dart` file.
- Inlined the short `parseNumericLiteral` and `parseStringLiteral` helpers directly at their call sites in the `Transformer` class.
- Updated imports, made the extracted utility functions public, and cleaned up unused imports.

No functional changes: All tests pass, and package:web code generation yields a zero diff.
commit 48b7512
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Sun Mar 1 06:52:52 2026 +0000

    Bump actions/stale from 10.1.1 to 10.2.0 in the github-actions group (dart-lang#520)

    Bumps the github-actions group with 1 update: [actions/stale](https://github.com/actions/stale).

    Updates `actions/stale` from 10.1.1 to 10.2.0
    <details>
    <summary>Release notes</summary>
    <p><em>Sourced from <a href="https://github.com/actions/stale/releases">actions/stale's releases</a>.</em></p>
    <blockquote>
    <h2>v10.2.0</h2>
    <h2>What's Changed</h2>
    <h3>Bug Fix</h3>
    <ul>
    <li>Fix checking state cache (fix <a href="https://redirect.github.com/actions/stale/issues/1136">#1136</a>) and switch to Octokit helper methods by <a href="https://github.com/itchyny"><code>@​itchyny</code></a> in <a href="https://redirect.github.com/actions/stale/pull/1152">actions/stale#1152</a></li>
    </ul>
    <h3>Dependency Updates</h3>
    <ul>
    <li>Upgrade js-yaml from  4.1.0 to 4.1.1 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/actions/stale/pull/1304">actions/stale#1304</a></li>
    <li>Upgrade lodash from 4.17.21 to 4.17.23 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/actions/stale/pull/1313">actions/stale#1313</a></li>
    <li>Upgrade actions/cache from 4.0.3 to 5.0.2 and actions/github from 5.1.1 to 7.0.0  by <a href="https://github.com/chiranjib-swain"><code>@​chiranjib-swain</code></a> in <a href="https://redirect.github.com/actions/stale/pull/1312">actions/stale#1312</a></li>
    </ul>
    <h2>New Contributors</h2>
    <ul>
    <li><a href="https://github.com/itchyny"><code>@​itchyny</code></a> made their first contribution in <a href="https://redirect.github.com/actions/stale/pull/1152">actions/stale#1152</a></li>
    </ul>
    <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/stale/compare/v10...v10.2.0">https://github.com/actions/stale/compare/v10...v10.2.0</a></p>
    </blockquote>
    </details>
    <details>
    <summary>Commits</summary>
    <ul>
    <li><a href="https://github.com/actions/stale/commit/b5d41d4e1d5dceea10e7104786b73624c18a190f"><code>b5d41d4</code></a> build(deps-dev): bump lodash from 4.17.21 to 4.17.23 (<a href="https://redirect.github.com/actions/stale/issues/1313">#1313</a>)</li>
    <li><a href="https://github.com/actions/stale/commit/dcd2b9469d2220b7e8d08aedc00c105d277fd46b"><code>dcd2b94</code></a> Fix punycode and url.parse Deprecation Warnings (<a href="https://redirect.github.com/actions/stale/issues/1312">#1312</a>)</li>
    <li><a href="https://github.com/actions/stale/commit/d6f8a33132340b15a7006f552936e4b9b39c00ec"><code>d6f8a33</code></a> build(deps-dev): bump js-yaml from 4.1.0 to 4.1.1 (<a href="https://redirect.github.com/actions/stale/issues/1304">#1304</a>)</li>
    <li><a href="https://github.com/actions/stale/commit/a21a0816299b11691f9592ef0d63d08e02f06d9d"><code>a21a081</code></a> Fix checking state cache (fix <a href="https://redirect.github.com/actions/stale/issues/1136">#1136</a>), also switch to octokit methods (<a href="https://redirect.github.com/actions/stale/issues/1152">#1152</a>)</li>
    <li>See full diff in <a href="https://github.com/actions/stale/compare/997185467fa4f803885201cee163a9f38240193d...b5d41d4e1d5dceea10e7104786b73624c18a190f">compare view</a></li>
    </ul>
    </details>
    <br />

    [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/stale&package-manager=github_actions&previous-version=10.1.1&new-version=10.2.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

    ---

    <details>
    <summary>Dependabot commands and options</summary>
    <br />

    You can trigger Dependabot actions by commenting on this PR:
    - `@dependabot rebase` will rebase this PR
    - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
    - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
    - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
    - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
    - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
    - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency
    - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions

    </details>

commit a6336c8
Author: Kevin Moore <kevmoo@users.noreply.github.com>
Date:   Mon Feb 23 11:09:23 2026 -0800

    remove dynamic calls from Stream helpers (dart-lang#519)

    Mode CustomEventProviders `abstract final`
    Deleted a bunch of unused code in the streams.dart internal library

commit 94d22fe
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Feb 3 17:21:35 2026 -0800

    Bump actions/checkout from 6.0.1 to 6.0.2 in the github-actions group (dart-lang#515)

    Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout).

    Updates `actions/checkout` from 6.0.1 to 6.0.2
    - [Release notes](https://github.com/actions/checkout/releases)
    - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
    - [Commits](actions/checkout@8e8c483...de0fac2)

    ---
    updated-dependencies:
    - dependency-name: actions/checkout
      dependency-version: 6.0.2
      dependency-type: direct:production
      update-type: version-update:semver-patch
      dependency-group: github-actions
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 5edd2dd
Author: Kevin Moore <kevmoo@users.noreply.github.com>
Date:   Tue Feb 3 17:18:04 2026 -0800

    Fix use_null_aware_elements lint (dart-lang#518)

commit d1958f8
Author: Sagar <halladakerisagar@gmail.com>
Date:   Wed Feb 4 06:29:06 2026 +0530

    Support TypeScript indexed access types in interop_gen (dart-lang#509)

    * Support TypeScript indexed access types in interop_gen

    * Fix:prevent IndexedAccessType fallback from generating unsupported bindings

    * Remove unused indexed access fallback flag and simplify resolution logic

    * fixed analyzer issue

    * fix format issue

    * Improve IndexedAccessType handling and add composed type tests

    * interop_gen: refactor indexed access resolution, remove dead code, and Add test for symbol indexed access with primitive return type

commit 2590763
Author: Harshita Yadav <seemayadavanuj123@gmail.com>
Date:   Mon Jan 26 23:40:27 2026 +0530

    docs: clarify document.cookie nullability when migrating from dart:html (dart-lang#510)

    * docs: clarify document.cookie nullability when migrating from dart:html

    * docs: organize migration notes under specific APIs

commit b9b1b38
Author: Sagar <halladakerisagar@gmail.com>
Date:   Sat Jan 17 02:31:52 2026 +0530

    Interop gen additional literal types (dart-lang#503)

    * interop_gen: support additional literal type expressions via TypeChecker

    * fixed analyzer warning

    * simplify literal parsing and improve readability

    * Refactor literal handling and expand literal tests

    Use a shared helper to reduce duplication, remove unused TSTypeFlags, and
    add integration tests for false, null, and negative numeric literals.

    * Use typed literal helpers in _transformType and add tests

    Refactor literal handling to use scoped, typed helpers instead of a
    generic value-based helper. Clean up unused TSTypeFlags and add
    integration tests for false, null, and resolved-type literals.

    * fix CI issue

    * enable fallback literal coverage and update expectations

commit 1dfcee7
Author: Harshita Yadav <seemayadavanuj123@gmail.com>
Date:   Fri Jan 16 03:21:37 2026 +0530

    docs(web_generator): document minimum supported Node.js version (dart-lang#508)

    * docs(web_generator): document minimum supported Node.js version

    * docs(web_generator): simplify Node.js version wording
Fixes dart-lang#505

This PR adds support for working with the web generator errors better using dart-style stack traces by mapping the stack trace frames from V8/NodeJS to Dart, using the related dart packages.

This makes the error messages much easier to debug and deal with, which improves debugging

1. There are some issues mapping the frames completely, including but not limited to mapping `npm` dependency code in the stack frames. The major example here being that the frames occuring from the `typescript` package are being mapped to other unrelated packages. An example before:
```
    at getTypeFromTypeReference (~/web/web_generator/lib/src/node_modules/typescript/lib/typescript.js:65071:36)
    at getTypeFromTypeNodeWorker (~/web/web_generator/lib/src/node_modules/typescript/lib/typescript.js:67750:16)
    at getTypeFromTypeNode (~/web/web_generator/lib/src/node_modules/typescript/lib/typescript.js:67712:41)
    at Object.getTypeFromTypeNode (~/web/web_generator/lib/src/node_modules/typescript/lib/typescript.js:51140:21)
    at Transformer._transformType$4$isNullable$parameter$typeArg (~/web/web_generator/lib/src/dart_main.js:8064
    at Transformer._transformType$1 (~/web/web_generator/lib/src/dart_main.js:81095:19)
```

and after:
```
../../../../../../.pub-cache/hosted/pub.dev/dart_style-3.1.3/lib/src/front_end/piece_writer.dart 208:23  getTypeFromTypeReference
../../../../../../.pub-cache/hosted/pub.dev/dart_style-3.1.3/lib/src/short/rule/rule.dart 166:5          getTypeFromTypeNode
org-dartlang-sdk:///lib/_internal/js_shared/lib/js_util_patch.dart 149:10                                Transformer._transformType
```
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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.

[web_generator] Improve debugging of bin scripts with better stack traces

2 participants