v2: Include VegaFusionRuntime in vegafusion-wasm #527
Merged
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.
This PR adds an embedded VegaFusionRuntime to the
vegafusion-wasm
package. This required a bit or feature flagging, but in the end I got the editor example updated to include a checkbox for whether to use the embedded VegaFusionRuntime, or to communicate with a VegaFusionServer instance over grpc-web.Support for loading files from
http
andhttps
URLs is provided by the object-store-wasm crate. Parquet is not currently supported due to issues compiling zstd.Updated editor demo:
Size
When compiled with opt-level z and 1 codegen unit the size isn't as bad as I feared:
npm package size: 4.3 MB
npm unpacked size: 16.6 MB
This is ~3x larger than the build that only supports connecting to VegaFusionServer over gRPC-Web, so we could potentially publish multiple packages in the future if there is demand, but going to keep it simple for now with a single package.
As one comparison point, the duckdb-wasm package is duckdb-wasm from https://www.jsdelivr.com/package/npm/@duckdb/duckdb-wasm is 28.8MB compressed and 147MB extracted.