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

Add a pure-browser version of the Pixlet UI #784

Merged
merged 2 commits into from
May 23, 2023
Merged

Conversation

rohansingh
Copy link
Member

Adds a WASM backend mode for Pixlet, which builds pixlet.wasm and
loads it in the browser. This WASM binary then runs Starlark, without
the need for the pixlet Go backend.

Use npm run start:wasm to try it.

`GOOS=js GOARCH=wasm make build` should work now.
Adds a WASM backend mode for Pixlet, which builds `pixlet.wasm` and
loads it in the browser. This WASM binary then runs Starlark, without
the need for the `pixlet` Go backend.

Use `npm run start:wasm` to try it.
@rohansingh
Copy link
Member Author

Notes:

  1. The WASM binary is quite large (~100 MB). It takes several seconds to load even on a good connection, and there is no indication that it's loading.

  2. Hard-refreshing the page (cmd+shift+R) causes an error for some reason. Normal refreshing (cmd+R) gets it to work again. I think hard refresh deregisters the service worker, and then the Pixlet UI fails because it tries to make requests before the worker is reloaded.

@betterengineering betterengineering merged commit bad0969 into main May 23, 2023
tavdog pushed a commit to tavdog/pixlet that referenced this pull request May 25, 2023
* Support compiling with GOOS=js GOARCH=wasm

`GOOS=js GOARCH=wasm make build` should work now.

* Add a pure-browser version of the Pixlet UI

Adds a WASM backend mode for Pixlet, which builds `pixlet.wasm` and
loads it in the browser. This WASM binary then runs Starlark, without
the need for the `pixlet` Go backend.

Use `npm run start:wasm` to try it.
@rohansingh rohansingh deleted the rohan/wasm branch January 17, 2024 03:33
rohansingh added a commit that referenced this pull request May 6, 2024
This was added in #784, but was no longer being used or maintained. We may
build a WASM version Pixlet again in the future, but it would probably just be
the Starlark runtime.
rohansingh added a commit that referenced this pull request May 6, 2024
This was added in #784, but was no longer being used or maintained. We may
build a WASM version Pixlet again in the future, but it would probably just be
the Starlark runtime.
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.

2 participants