Skip to content

Conversation

@danbopes
Copy link
Contributor

@danbopes danbopes commented Feb 7, 2026

Implement the browser WASI HTTP shim using the fetch() API with JSPI for async suspension, replacing the previous non-functional stubs.

  • Rewrite http.js with Fields, OutgoingRequest, IncomingResponse, IncomingBody, FutureIncomingResponse, and outgoing-handler.handle()
  • Fix Pollable in io.js: add ready(), block(), subscribe() support
  • Fix clocks.js: subscribeDuration(0) yields via setTimeout, fix subscribeInstant this-binding for standalone function calls
  • Fix blockingRead double-reader bug on ReadableStream
  • Add browser tests ported from wasmtime p2_* suite (clocks, poll, HTTP)
  • Replace hand-written WIT deps with canonical versions via wkg

Copy link
Collaborator

@vados-cosmonic vados-cosmonic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fantastic work @danbopes , thanks for contributing so much implementation to the browser preview2-shim, it has not gotten any attention for a long time.

I have a few nitpicks/small changes proposed, please take a look and let me know if you have any questions/disagree!

@vados-cosmonic
Copy link
Collaborator

Hey @danbopes thanks for your hard work here and iterating so fast and explaining stuff to me where necessary.

If I can ask for one more thing -- can you either format your commits to match the conventional commits standard or squash to one commit with a title like the following:

feat(p2-shim): implement browser HTTP fetch support via JSPI

The tagging is picked up by the automation in-repo, and we don't squash actually -- we fast-forward so that we can (easily) catch non-conforming commit titles in CI

@danbopes
Copy link
Contributor Author

danbopes commented Feb 8, 2026

@vados-cosmonic Done

@vados-cosmonic vados-cosmonic added this pull request to the merge queue Feb 8, 2026
Merged via the queue into bytecodealliance:main with commit 8a5249a Feb 8, 2026
35 checks passed
@jco-release-bot
Copy link
Collaborator

🎉 The code in this PR was made available in the following release:
https://github.com/bytecodealliance/jco/releases/tag/preview2-shim-v0.17.8

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