chore: split web op crate (#9635)
This commit starts splitting out the deno_web op crate into multiple
smaller crates. This commit splits out WebIDL and URL API, but in the
future I want to split out each spec into its own crate. That means we
will have (in rough order of loading): `webidl`, `dom`, `streams`,
`console`, `encoding`, `url`, `file`, `fetch`, `websocket`, and
`webgpu` crates.
2021-03-12 10:17:18 -05:00
|
|
|
# deno_webidl
|
|
|
|
|
2024-06-17 18:07:48 -04:00
|
|
|
**This crate implements WebIDL for Deno. It consists of infrastructure to do
|
|
|
|
ECMA -> WebIDL conversions.**
|
chore: split web op crate (#9635)
This commit starts splitting out the deno_web op crate into multiple
smaller crates. This commit splits out WebIDL and URL API, but in the
future I want to split out each spec into its own crate. That means we
will have (in rough order of loading): `webidl`, `dom`, `streams`,
`console`, `encoding`, `url`, `file`, `fetch`, `websocket`, and
`webgpu` crates.
2021-03-12 10:17:18 -05:00
|
|
|
|
2022-03-15 22:17:50 -04:00
|
|
|
Spec: https://webidl.spec.whatwg.org/
|
2024-06-17 18:07:48 -04:00
|
|
|
|
|
|
|
## Usage Example
|
|
|
|
|
|
|
|
From javascript, include the extension's source, and assign the following to the
|
|
|
|
global scope:
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
import * as webidl from "ext:deno_webidl/00_webidl.js";
|
|
|
|
Object.defineProperty(globalThis, webidl.brand, {
|
|
|
|
value: webidl.brand,
|
|
|
|
enumerable: false,
|
|
|
|
configurable: true,
|
|
|
|
writable: true,
|
|
|
|
});
|
|
|
|
```
|
|
|
|
|
|
|
|
Then from rust, provide `init_webidl::init_webidl::init_ops_and_esm()` in the
|
|
|
|
`extensions` field of your `RuntimeOptions`
|