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

Web Assembly #74

Open
matthew-dean opened this issue Feb 2, 2017 · 13 comments
Open

Web Assembly #74

matthew-dean opened this issue Feb 2, 2017 · 13 comments

Comments

@matthew-dean
Copy link

matthew-dean commented Feb 2, 2017

Will you be adding web assembly builds soon? Or is the Web Assembly MVP not sufficient enough for libsass?

@rodneyrehm
Copy link
Member

I have not dabbled with WebAssembly yet and I don't plan to in the sort term, but I'm sure sass.js will eventually be a WebAssembly thing.

@rodneyrehm
Copy link
Member

I've tried my luck with WebAssembly but wasn't able to make native-wasm work.

-s WASM=1 -o test.html will generate eveything needed for execution, but I get the following error:

trying binaryen method: native-wasm
failed to compile wasm module: RangeError: WebAssembly.Module(): Wasm compilation exceeds internal limits in this context for the provided arguments
Uncaught no binaryen method succeeded. consider enabling more options, like interpreting, if you want that: https://github.com/kripken/emscripten/wiki/WebAssembly#binaryen-methods

Firefox and Chrome can't run the generated test.wasm directly either, they abort because of a version mismatch. … will try again in a few weeks.

@rodneyrehm
Copy link
Member

Via a tweet I noticed that @AshKyd made some changes to sass.js to get wasm to work.

@AshKyd do you want to send a PR for that? Does this still work in browsers not supporting WASM?

@AshKyd
Copy link

AshKyd commented Aug 6, 2017

@rodneyrehm Was more a learning experience. It doesn't work in Node 8 (not sure why), and there's no fallback either so it's not mergeable without more work.

I can't commit to anything, but if nobody else picks it up I might have another look when I have some time. :)

@mgreter
Copy link

mgreter commented Feb 6, 2018

FYI: sass/node-sass#2220

@rodneyrehm
Copy link
Member

Thanks for the nudge @mgreter - I've just released a beta for WASM: 0.11.0-beta.1

Please try it out and tell me if something goes wrong with the relative loading of libsass.wasm. Not sure if I should consider this a (potentially) breaking change or not…

@aapoalas
Copy link

aapoalas commented Mar 5, 2018

Hey

I am currently testing the WASM beta and at least for a simple use case it works fine with no issues.

My use case is a Browser-based Monaco Editor sass => sass.js => inject to styles -WYSIWYG editor.

@rodneyrehm
Copy link
Member

I guess we'll have to try some more (and probably produce a bigger build), because IE11 doesn't support WASM…

no native wasm support detected
no binaryen method succeeded. consider enabling more options, like interpreting, if you want that: https://github.com/kripken/emscripten/wiki/WebAssembly#binaryen-methods

@rodneyrehm
Copy link
Member

https://gist.github.com/surma/b2705b6cca29357ebea1c9e6e15684cc might help with switching from this archaic grunt build thing to webpack with support for wasm.

@rodneyrehm
Copy link
Member

https://developer.microsoft.com/en-us/microsoft-edge/platform/status/webassemblymvp/ suggests that Edge is now supporting WASM as well

@bundyo
Copy link

bundyo commented May 21, 2019

Can we get a new WebAssembly build after all these updates? :)

@rodneyrehm
Copy link
Member

Can we get a new WebAssembly build after all these updates? :)

were you using the 0.11.0-beta.1 build already?

@bundyo
Copy link

bundyo commented May 21, 2019

Yes, it is about 2 seconds faster for my setup.

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

No branches or pull requests

6 participants