bytecodealliance / javy

JS to WebAssembly toolchain
Apache License 2.0
2.1k stars 101 forks source link

Refactor the structure of the `Config`/APIs #646

Closed saulecabrera closed 2 months ago

saulecabrera commented 2 months ago

This change primarily rewrites the current APIs using "Intrinsics" as defined by rquickjs.

This change has several objectives:

Along the way, I had to make several changes to make all this work; the most relevant ones are: (i) deprecating the javy-apis crate (ii) enabling all the APIs by default and (iii) reworking a bit the Console implementation.

The reasoning to deprecate the javy-apis crate is mostly around: (i) the fact that we're revamping our extensilbity model in the near fuiture and (ii) the complexity around cyclical dependencies: javy exposes rquickjs and given that the cofiguration is tied to the runtime, javy needed to depend on javy-apis but the other way around was also true. I decided not to spend too much cycles on this mostly given point (i) above.

There are still things to follow-up on after this PR, namely

Checklist

saulecabrera commented 2 months ago

cc/ @surma since we chatted about using Intrinsics, I decided to give this a try as part of adding a faster JSON implementation.

saulecabrera commented 2 months ago

Do we plan to remove the stream I/O and console APIs into a plugin later after we've figured out a common extension mechanism?

...and the soon-to-be-introduced JSON functions. That would be the ideal outcome I believe, given that they introduce non-standard functionality and it will also allow us to test our extension mechanism.