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

wasm support to run geomedea in the browser #6

Merged
merged 2 commits into from
Jul 17, 2024
Merged

Conversation

michaelkirk
Copy link
Owner

This is a bit hack-and-slash at the moment, but I can run some demos in browser now, which is neat.

@michaelkirk michaelkirk force-pushed the mkirk/async-zstd-rs branch 13 times, most recently from 4a794b3 to a959e58 Compare July 16, 2024 05:32
@michaelkirk
Copy link
Owner Author

By way of an update, you can now see the examples from /geomedea-wasm/web_root/examples running in your browser at https://michaelkirk.github.io/geomedea/examples/maplibre/

There's still some fleshing out to do - in particular I still need to handle non-string properties, but I think I should be able to wrap it up "soon" (like in the next couple days).

@michaelkirk michaelkirk force-pushed the mkirk/async-zstd-rs branch 2 times, most recently from 0e96aee to 913d536 Compare July 16, 2024 21:11
relocate their definitions to a more neutral location
@michaelkirk michaelkirk force-pushed the mkirk/async-zstd-rs branch from 913d536 to 8ce5bd1 Compare July 16, 2024 21:15
@michaelkirk michaelkirk marked this pull request as ready for review July 17, 2024 00:29
The `zstd` crate we used for reading and writing zstd does not support wasm.

The (pure rust) `ruzstd` supports wasm, but only supports reading.

So we now use `ruzstd` for reading, and `zstd` for writing. So, writing
is not supported on wasm, only reading.

Introduces a javascript API in the new geomedea-wasm package (based on `wasm-pack new geomedea-wasm`)
@michaelkirk michaelkirk force-pushed the mkirk/async-zstd-rs branch from 8ce5bd1 to f355203 Compare July 17, 2024 00:39
@michaelkirk
Copy link
Owner Author

Ok - I think this is ready to go. Let me know if you want any help trying this out.

@michaelkirk michaelkirk merged commit dc991c5 into main Jul 17, 2024
3 checks passed
@michaelkirk
Copy link
Owner Author

Disclaimer: it currently depends on a forked version of async-compression which makes some previously private methods public to allow implementing their traits on an external decoder.

@michaelkirk
Copy link
Owner Author

Also note that in the meanwhile there was a breaking change to the format in #7

So you'll need to regenerate any geomedea with the latest version of cargo install --git https://github.com/michaelkirk/geozero.git --branch mkirk/geomedea-integration

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.

1 participant