commit | fa4280c061f0043f1d3c5346ab1495512de4bef2 | [log] [tgz] |
---|---|---|
author | Devon Carew <devoncarew@google.com> | Tue Feb 27 11:35:18 2024 -0800 |
committer | GitHub <noreply@github.com> | Tue Feb 27 11:35:18 2024 -0800 |
tree | 4f865ecf3b7ba2ffed1ba502d28fc80b77d78a9c | |
parent | d96c01d2252372c9e0fa7ffa52d2d1df331c248b [diff] |
mention the migration guide in the readme (#187) * mention the migration guide in the readme * Update README.md Co-authored-by: Marya <111139605+MaryaBelanger@users.noreply.github.com> --------- Co-authored-by: Marya <111139605+MaryaBelanger@users.noreply.github.com>
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
.Based on:
For instructions on re-generating the DOM bindings, see the generator docs.