Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working WASIX API #325

Closed
wants to merge 19 commits into from
Closed

Working WASIX API #325

wants to merge 19 commits into from

Conversation

WanderLanz
Copy link

@WanderLanz WanderLanz commented Jul 20, 2023

Before any consideration for merging, compatibility with @wasmer/wasi is broken, so the package under @wasmer/wasix to prevent accidental breakage. No consideration was made to make it 1-1 compatible.

I tried to stay as close as possible to wasi-web in hopes of being able to just copy/sync in the future.

Added

  • networking via fetch
  • threading via workers
  • TTY (immutable unless handled by JavaScript consumer)
  • dynamic NodeJS polyfills for crypto, fetch, & Worker
  • WasiConfig options "concurrency" (1-16) & "tty" (starting TTY State)
  • console_error_panic_hook, wee_alloc, & tracing features

Changed

  • IO now using WritableStream/ReadableStream for more interactivity.
  • wasm-pack wasm artifact is not inlined, node uses node:fs to load instead of fetch
  • file Read API now more closely resembles WebAPI (Blob/File)
  • init() arguments and behavior, to avoid problems with Workers using init()
  • enabled Reference Types, enabled WeakRefs, added -Zbuild-std=panic_abort,std to scripts
  • Modernized browserlist, will not be as compatible with outdated or LTS browsers
  • some simplifying naming changes

Todo

  • create tests for new API
  • update examples
  • update documentation
  • fix CI for nightly requirement

syrusakbary and others added 8 commits February 16, 2023 22:57
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	pkg/wasmer_wasi_js.js
#	pkg/wasmer_wasi_js_bg.wasm
The global `Buffer` is used for loading base64 encoded string.
However, this **implicit** and **global** dependency makes some
confusions and problems (#294, #305, and ruby/ruby.wasm#182).

The use of `Buffer` here is limited, so we can easily replace this
by using `atob` function. This simplifies user's build settings
and reduces the file size since there is no need to include Buffer.
@Michael-F-Bryan Michael-F-Bryan self-requested a review July 20, 2023 08:00
@syrusakbary
Copy link
Member

Hey @WanderLanz , this PR is awesome work.

We want to add some of the bits of it back into the Wasmer repo (so it's available for anyone trying to compile Wasmer to the browser), but most of the glue things that you created look great. Really good work on updating everything, including reworking current tests.

We'll probably rebase your PR with the new one once things get merged upstream.

@WanderLanz
Copy link
Author

WanderLanz commented Jul 24, 2023

@syrusakbary Awesome! I'm glad it'll be of help, hopefully everything goes well.

@WanderLanz
Copy link
Author

Hey just checking back in, it seems like @`Michael-F-Bryan already got the useful parts in the wasix branch, I'll go ahead and close this. Thank you!

@WanderLanz WanderLanz closed this Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants