You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -300,14 +328,23 @@ In [`.github/workflows/web-host.yml`](./.github/workflows/web-host.yml), after t
300
328
301
329
To be sure that the preview server is up and running before running the tests, we use the [`webServer.command` option](https://playwright.dev/docs/test-webserver) of [playwright.config.ts](./packages/web-host/playwright.config.ts) to run `WAIT_FOR_SERVER_AT_URL=http://localhost:4173/webassembly-component-model-experiments/ npm run test:e2e:all:preview`
302
330
331
+
### plugins
332
+
333
+
There are currently plugins implemented in 3 languages (most of them are in rust):
334
+
335
+
#### Rust
303
336
304
-
### plugins (TypeScript)
337
+
You can write plugins in rust in [`crates/plugin-*`](./crates).
305
338
306
-
You can write plugins in rust in [`crates/plugin-*`](./crates), you can also write plugins in TypeScript in [`packages/plugin-*`](./packages), thanks to `jco componentize` (based on [componentize-js](https://github.com/bytecodealliance/componentize-js)).
339
+
#### C
307
340
308
-
There is a [`packages/plugin-echo`](./packages/plugin-echo/) example plugin in TypeScript.
341
+
You can write plugins in C in [`c_modules/plugin-*`](./c_modules), thanks to `wit-bindgen` (based on [wit-bindgen](https://github.com/bytecodealliance/wit-bindgen)).
309
342
310
-
The downsides of writing plugins in TypeScript is mostly that your `.wasm` file will be **much larger** than the one compiled from rust:
343
+
#### TypeScript
344
+
345
+
You can also write plugins in TypeScript in [`packages/plugin-*`](./packages), thanks to `jco componentize` (based on [componentize-js](https://github.com/bytecodealliance/componentize-js)).
346
+
347
+
The downsides of writing plugins in TypeScript is mostly that your `.wasm` file will be **much larger** than the one compiled from rust or C:
311
348
312
349
-~100KB of wasm for the rust plugin
313
350
- 11MB of wasm for the TypeScript plugin
@@ -316,9 +353,10 @@ The reason is that a JavaScript runtime needs to be embedded in the `.wasm` file
316
353
317
354
More about the [SpiderMonkey runtime embedding](https://github.com/bytecodealliance/ComponentizeJS?tab=readme-ov-file#explainer).
318
355
319
-
### plugins (Other languages)
356
+
#### Other languages
357
+
358
+
Coming.
320
359
321
-
Coming soon.
322
360
323
361
## Developer experience
324
362
@@ -346,6 +384,7 @@ Those are **optional** tools that are handy for WebAssembly development:
You can find here plugins written in C, some are re-implementations of the plugins written in Rust.
4
+
5
+
The `plugin_api.c`, `plugin_api.h` and `plugin_api.component_type.o` are generated with [`wit-bindgen`](https://github.com/bytecodealliance/wit-bindgen), based on the [wit files](../crates/pluginlab/wit) of the project.
6
+
7
+
The wasm files are compiled with the [wasi-sdk](https://github.com/WebAssembly/wasi-sdk) you downloaded with `just dl-wasi-sdk`, which contain the `clang` compiler.
8
+
9
+
All you have to do is run `just build` to build everything (including the C plugins) and `just test` to run the tests (including the C plugins).
0 commit comments