commit | 9b7e29d6e4bd2d62f82a3a55080de6976025aeb6 | [log] [tgz] |
---|---|---|
author | Devon Carew <devoncarew@google.com> | Tue Mar 12 08:58:39 2024 -0700 |
committer | GitHub <noreply@github.com> | Tue Mar 12 08:58:39 2024 -0700 |
tree | c4d09548ff06c6c67705d002174127d6cef330e6 | |
parent | 51e594b35b516b8678825e27e2f2d8051a594a57 [diff] |
Add a 'sourced from mdn docs' line to the MDN sourced dartdoc (#198) * add a 'docs from mdn' line to the interface type docs * re-generate package files * update the changelog; link to specific types * review feedback
Lightweight browser API bindings built around JS static interop.
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 ${DateTime.now()}'; }
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.
The generator scripts use a number of conventions to consistently handle Web IDL definitions:
JSObject
.implements
between extension types.JSArray
and JSPromise
.String
.JSFunction
.String
instead of JSString
.JSAny?
.JSObject
.Most of the APIs in this package are generated from public assets. See tool/README.md for information on the spec and IDL versions the package was generated from, and for the process for updating the package.