5 Commits

Author SHA1 Message Date
Guy Bedford d63185dc42 deps: update to WASI@0.2.1, Wasmtime@25 toolchain (#504) 2024-09-23 16:48:51 -07:00
Guy Bedford 7f1f11e00a feat: WebIDL support & browser test suite (#471) 2024-07-17 12:44:01 -07:00
Guy Bedford 0ca593873b fix: browser build, with tla compat (#288) 2023-12-04 12:45:58 -08:00
Ivan Enderlin fa0832ed76 feat: Allow --instantiation to generate non-async code (#254)
* feat: Allow `--instantiation` to generate non-async code.

The goal of this patch is to allow `--instantiation` to generate non-
async code as discussed in
https://github.com/bytecodealliance/jco/issues/245.

First off, this patch updates the `--instantiation` option to receive
a string value instead of a being a switch. The possible values are
`async` (the default) or `sync`. The fact that `async` is the default
value ensures the backward compatibility.

Next, this patch updates the `TranspileOpts::instantiation` field to be
`Option<InstantiationMode>` instead of `bool`. `InstantiationMode` is a
enum with 2 variants: `Async` and `Sync`. The code is updated
accordingly.

Finally, the same patch adds non-async code during the bindgen pass.

Everything is done in one patch in order to be atomic.

Note: `function_bindgen.rs` is updated to improve an error message. It's
helpful when one needs to debug its code.

* test: Allow multiple test files per fixture.

This patch allows one fixture to be tested by multiple test files.

* test: Add the `strings.sync.ts` test.

* chore: Rename and simplify the `instantiate` signature.

`compileCore` becomes `getCoreModule`, and its function type
definition is now `(path: string)` instead of `(path: string, imports:
Record<string, any>)`.
2023-11-14 11:32:00 -08:00
Guy Bedford 46be925f4f feat: simple browser build (#143) 2023-09-01 11:44:35 -07:00