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

[WIP]: Implement WebSerial/wasm #224

Closed
wants to merge 1 commit into from
Closed

Conversation

i404788
Copy link

@i404788 i404788 commented Oct 23, 2024

Resolves #165. As stated in that issue it's not supported on all browsers although it has been 'stable' on those browsers since 2021.

Since WebSerial is entirely Promise based there is a lot of block_on to make it sync.

Currently status:

  • Core serial operations and options
  • Timeouts
  • Flow-control Inputs
  • *_to_read (see inline comment)

@sirhcel
Copy link
Contributor

sirhcel commented Oct 27, 2024

Thank you opening this draft PR @i404788! I know WebSerial only from hearsay. When progressing this PR, could you add an example for how to use WebSerial support?

@i404788
Copy link
Author

i404788 commented Oct 30, 2024

Hey @sirhcel,

Unfortunately we've hit a bit of a snag with the block_on, since it doesn't yield back to JS it will never complete the promises. It seems to be impossible at the moment to finish this PR

In theory if you could interrupt the wasm task a specific impl of block_on could exist, although I'm not familiar enough with wasm internals to know the feasibility of that. e.g. you could checkpoint with https://jubianchi.gitbook.io/wasmer-docs/glibc-reqs/integrations/examples/exit-early, there was a discussion about this but ended up not being spec'ed: WebAssembly/design#712

For now I'll close the PR as I don't believe this will be added in a generic way any time soon. (this also means #165 is impossible atm given the goals of this project).

@i404788 i404788 closed this Oct 30, 2024
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.

Tracking issue for WebSerial support.
2 participants