Skip to content

Commit

Permalink
update the readme (#110)
Browse files Browse the repository at this point in the history
* update the readme

* Apply suggestions from code review

Co-authored-by: Srujan Gaddam <[email protected]>

* Update README.md

review feedback

---------

Co-authored-by: Srujan Gaddam <[email protected]>
  • Loading branch information
devoncarew and srujzs authored Nov 29, 2023
1 parent e5be5b3 commit d902401
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
32 changes: 29 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,35 @@

Lightweight browser API bindings built around JS static interop.

This package will *eventually* replace [`dart:html`](https://api.dart.dev/stable/dart-html/dart-html-library.html) and
similar libraries in the Dart SDK to fully support WebAssembly.
## 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`](https://api.dart.dev/stable/dart-html/dart-html-library.html) and
similar Dart SDK libraries. It will support access to browser APIs from Dart
code compiled to either JavaScript or WebAssembly.

## Status

The APIs in this package are still fairly provisional and could change rapidly.
We'll continue to use [semantic versioning](https://semver.org/) as we evolve
the APIs.

## Usage

```dart
import 'package:web/web.dart';
void main() {
final div = document.querySelector('div') as HTMLDivElement;
div.textContent = 'Text set at ${DateTime.now()}';
}
```

## Web IDL version

<!-- START updated by /tool/update_bindings.dart. Do not modify by hand -->
Based on [`@webref/idl 3.39.1`](https://www.npmjs.com/package/@webref/idl/v/3.39.1)
Based on [`@webref/idl 3.39.1`](https://www.npmjs.com/package/@webref/idl/v/3.39.1).
<!-- END updated by /tool/update_bindings.dart. Do not modify by hand -->
4 changes: 2 additions & 2 deletions tool/update_bindings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ ${RegExp.escape(_endComment)}

final idlVersion = _webRefIdlVersion();

final idlReference =
'Based on [`$_webRefIdl $idlVersion`](https://www.npmjs.com/package/$_webRefIdl/v/$idlVersion)';
final idlReference = 'Based on [`$_webRefIdl $idlVersion`]'
'(https://www.npmjs.com/package/$_webRefIdl/v/$idlVersion).';

final newContent = sourceContent.replaceFirst(replaceRegexp, '''
$_startComment
Expand Down

0 comments on commit d902401

Please sign in to comment.