quick-lint-js
quick-lint-js copied to clipboard
7$: web demo: Show browser-not-supported error if WASM or syntax isn't supported
https://quick-lint-js.com/demo/
On EdgeHTML 13, this page doesn't load (because of async
IIRC).
On browsers not supported wasm, this page doesn't load.
Show a message if the page couldn't be loaded. Otherwise, people will edit text but be confused why nothing happens.
Something which might be useful for it is the wasm-feature-detect library, used on this page: https://webassembly.org/roadmap/ In "Your browser" it dynamically shows which features are supported. At page load, it could be determined which features quicklint js needs, and then the same JavaScript mechanism the website uses, in combination with the wasm-feature-detect library, could show the warning. Note: despite the Firefox column, with Firefox 78.13 on Debian, "Threads and atomics" and "Fixed-width SIMD" is not supported, but Chrome supports it.
Or do just a test call at page load and check the result. But this would require, that all wasm functionality for all possible text inputs is used by this test call.
@Frank-Buss Thanks for the info. I didn't think to test individual features of WebAssembly.
I wonder if we could tune emscripten compilation to provide fallbacks or to target older WebAssembly versions.
Or do just a test call at page load and check the result.
Good idea. I think this approach makes sense.
I will try to do this
@Erik-Daniel Are you going to work on this task?
@strager I don't think I will be able to, sorry.