feat: add support for GOARCH=wasm and GOOS=js | wasip1#1693
Open
neomantra wants to merge 8 commits into
Open
Conversation
Add platform-specific stubs for WASM builds (js/wasm) to enable BubbleTea to compile and run on WebAssembly without OS-level dependencies: - tty_wasm.go: stub initInput() and suspendProcess() (no TTY on WASM) - signals_wasm.go: stub listenForResize() (window events via JS) - termios_wasm.go: stub checkOptimizedMovements() (no terminal modes) - termios_other.go: exclude WASM from generic fallback BubbleTea now works with WASM frameworks that provide custom I/O and window management via JavaScript. Signed-off-by: Evan Wies <[email protected]>
Signed-off-by: Evan Wies <[email protected]>
We have an exclude list due to dependencies that are incompatible with WASM, eg. clipboard Signed-off-by: Evan Wies <[email protected]>
Brings examples/go.mod in sync with the root ultraviolet bump from fdcd0cf so the build-examples job's git diff --exit-code check passes on this branch instead of waiting for the master auto-tidy workflow.
Author
|
I added unit tests to the CI/CD. Note there is machinery to omit examples that depend on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These changes add support for compiling BubbleTea under
GOARCH=wasmand underGOOS=jsorGOOS=wasip1.I have been experimenting with this for
go-boobawhich helps bridge BubbleTea with thelibghostty. I started experimenting with ago toolfor monkey-patching BubbleTea for this. That way others could adopt it without changing their code.But, it makes much more sense to include these upstream.
You can see some browser-base demos I've pretty easily created:
Since all the changes are guarded by build tags, this should not affect any other architectures. Thank you for BubbleTea.
CONTRIBUTING.md.