Include MDN API documentation as class and member dartdoc comments (#143)

* scrape MDN for API documentation

* commit the parsed documentation information

* review feedback

* Update tool/scrape_mdn.dart

Co-authored-by: Kevin Moore <>

* switch to reading from markdown files from the git repo

* regenerate the mdn.json file

* update copyright

* Bump actions/stale from 8.0.0 to 9.0.0 (#132)

Bumps [actions/stale]( from 8.0.0 to 9.0.0.
<summary>Release notes</summary>
<p><em>Sourced from <a href="">actions/stale's releases</a>.</em></p>
<h2>Breaking Changes</h2>
<li>Action is now stateful: If the action ends because of <a href="">operations-per-run</a> then the next run will start from the first unprocessed issue skipping the issues processed during the previous run(s). The state is reset when all the issues are processed. This should be considered for scheduling workflow runs.</li>
<li>Version 9 of this action updated the runtime to Node.js 20. All scripts are now run with Node.js 20 instead of Node.js 16 and are affected by any breaking changes between Node.js 16 and 20.</li>
<h2>What Else Changed</h2>
<li>Performance optimization that removes unnecessary API calls by <a href=""><code>@​dsame</code></a> <a href="">#1033</a> fixes <a href="">#792</a></li>
<li>Logs displaying current github API rate limit by <a href=""><code>@​dsame</code></a> <a href="">#1032</a> addresses <a href="">#1029</a></li>
<p>For more information, please read the <a href="">action documentation</a> and its <a href="">section about statefulness</a></p>
<h2>New Contributors</h2>
<li><a href=""><code>@​jmeridth</code></a> made their first contribution in <a href="">actions/stale#984</a></li>
<li><a href=""><code>@​nikolai-laevskii</code></a> made their first contribution in <a href="">actions/stale#1020</a></li>
<li><a href=""><code>@​dusan-trickovic</code></a> made their first contribution in <a href="">actions/stale#1056</a></li>
<li><a href=""><code>@​aparnajyothi-y</code></a> made their first contribution in <a href="">actions/stale#1110</a></li>
<p><strong>Full Changelog</strong>: <a href=""></a></p>
<li><a href=""><code>28ca103</code></a> Upgrade Node to v20 (<a href="">#1110</a>)</li>
<li><a href=""><code>b69b346</code></a> build(deps-dev): bump <code>@​types/node</code> from 18.16.18 to 20.5.1 (<a href="">#1079</a>)</li>
<li><a href=""><code>88a6f4f</code></a> build(deps-dev): bump typescript from 5.1.3 to 5.2.2 (<a href="">#1083</a>)</li>
<li><a href=""><code>796531a</code></a> Merge pull request <a href="">#1080</a> from akv-platform/fix-delete-cache</li>
<li><a href=""><code>8986f62</code></a> Don not try to delete cache if it does not exists</li>
<li><a href=""><code>cab99b3</code></a> fix typo proceeded/processed</li>
<li><a href=""><code>184e7af</code></a> Merge pull request <a href="">#1064</a> from actions/dependabot/npm_and_yarn/typescript-esli...</li>
<li><a href=""><code>523885c</code></a> chore: update eslint-plugin, parser and eslint-plugin-jest</li>
<li><a href=""><code>2487a1d</code></a> build(deps-dev): bump <code>@​typescript-eslint/eslint-plugin</code></li>
<li><a href=""><code>60c722e</code></a> Merge pull request <a href="">#1063</a> from actions/dependabot/npm_and_yarn/jest-29.6.2</li>
<li>Additional commits viewable in <a href="">compare view</a></li>
<br />

[![Dependabot compatibility score](](

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`.


<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 merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


* write additional version info into the readme (#126)

* generate mdn docs as library dartdoc

* re-generate package:web w/ dartdoc comments

* update changelog

* regenerate lib/src/dom

* update changelog

* refactor mdn.json into a third_party directory

* Add docs for added trusted-types, fix changelog

* update the changelog

* review comments

* add a todo to improve dartdoc comment formatting


Co-authored-by: Kevin Moore <>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]>
Co-authored-by: Kevin Moore <>
132 files changed
tree: 1ca1bae1e1de8457f0c632215ca8bb84f51eb83e
  1. .github/
  2. example/
  3. lib/
  4. test/
  5. test_fixes/
  6. third_party/
  7. tool/
  8. .gitignore
  9. analysis_options.yaml
  12. pubspec.yaml

Dart CI pub package package publisher

Lightweight browser API bindings built around JS static interop.

What's this?

This package exposes browser APIs. It's generated from the Web IDL definitions and uses recent Dart language features for zero-overhead bindings.

This package is intended to replace dart:html and similar Dart SDK libraries. It will support access to browser APIs from Dart code compiled to either JavaScript or WebAssembly.


import 'package:web/web.dart';

void main() {
  final div = document.querySelector('div')!;
  div.text = 'Text set at ${}';

Migrating to package:web

package:web is replacing dart:html and other web libraries as Dart's long-term web interop solution. To learn how to migrate from dart:html APIs to package:web, see our migration guide.

Generation conventions

The generator scripts use a number of conventions to consistently handle Web IDL definitions:


  • Interfaces are emitted as extension types that wrap and implement JSObject.
  • Interface inheritance is maintained using implements between extension types.
  • Members of partial interfaces, partial mixins, and mixins are added to the interfaces that include them, and therefore do not have separate declarations.


  • Generic types include the generic in the case of JSArray and JSPromise.
  • Enums are typedef'd to String.
  • Callbacks and callback interfaces are typedef'd to JSFunction.
  • In general, we prefer the Dart primitive over the JS type equivalent wherever possible. For example, APIs use String instead of JSString.
  • If a type appears in a generic position and it was typedef'd to a Dart primitive type, it is replaced with the JS type equivalent to respect the type bound of JSAny?.
  • Union types are computed by picking the least upper bound of the types in the JS type hierarchy, where every interface is equivalent to JSObject.


  • The generator uses the MDN compatibility data to determine what members and interfaces to emit. Currently, we only emit code that is standards track and supported on Chrome, Firefox, and Safari to reduce the number of breaking changes. This is currently WIP and some members may be added or removed.

Web IDL version

Based on:

For instructions on re-generating the DOM bindings, see the generator docs.