WebAssembly Playground demo and interactive Quarto examples#185
Open
georgestagg wants to merge 7 commits intosqlitefrom
Open
WebAssembly Playground demo and interactive Quarto examples#185georgestagg wants to merge 7 commits intosqlitefrom
georgestagg wants to merge 7 commits intosqlitefrom
Conversation
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.
Note: Requires #182.
This PR adds npm packages in the
ggsql-wasmdirectory to build a ggsql playground website and also a script that can be loaded into a Quarto page to replace ggsql examples with interactive code blocks.We use a JS parquet/csv interpreter to read (and register the included demo datasets) data into ggsql because
polars/parquetandpolars/csvare not available under Wasm. This works using a JS-Rust bridge and is gated behind a wasm-only feature flag.If a code block cannot be executed in Wasm for whatever reason, the original render is left in place, non-editable.
The playground website has a bunch of pre-defined examples I just copied from the docs, we probably want to make them nicer at some point.
The script
build-wasm.shbuilds the WebAssembly binaries, JS libraries and copies them into place in the Quartodocdirectory. However, note that it requires LLVM withwasm32target support andwasm-optto be installed. If the script is not run, the Quarto website should still build OK, just without the interactive features.Closes #93, #136.