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

fix: ensure wasm module matches frontend build #101

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kxxt
Copy link

@kxxt kxxt commented Jan 17, 2025

The frontend is built against the typst_ts_renderer_bg.wasm installed in node_modules. However, the cli ships a prebuilt typst_ts_renderer_bg.wasm from https://github.com/Myriad-Dreamin/typst/tree/assets-book-v0.2.0 . This mismatch can cause wasm load failures(#100).

This PR fixes it by copying the wasm module from node_modules to ensure a single source of truth for typst_ts_renderer_bg.wasm.

Fix #100

@Myriad-Dreamin
Copy link
Owner

Myriad-Dreamin commented Jan 18, 2025

Thank you for contribution. It should help develop with locally built WASM. The weird point is that we want to make cargo install https://github.com/Myriad-Dreamin/shiroa work, so we are shipping the WASM binary with the git submodule. I find it is not satisfied but I have no clue how we should go:

  1. continue using git submodule
  2. bundle the assets in some crate and upload them to crates.io
  3. don't allow cargo install https://github.com/Myriad-Dreamin/shiroa anymore.

@kxxt
Copy link
Author

kxxt commented Jan 19, 2025

The weird point is that we want to make cargo install https://github.com/Myriad-Dreamin/shiroa work, so we are shipping the WASM binary with the git submodule. I find it is not satisfied but I have no clue how we should go:

1. continue using git submodule

2. bundle the assets in some crate and upload them to crates.io

3. don't allow `cargo install https://github.com/Myriad-Dreamin/shiroa` anymore.

I think there is another way to go but it would require users to have yarn installed on their machine.

We can remove the independent build script and build the frontend in build.rs. POC: cargo install --git https://github.com/kxxt/shiroa --branch build-frontend-in-build.rs

kxxt@1453507

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.

shiroa.js failed to load LinkError: import object field '__wbindgen_closure_wrapper1668' is not a Function
2 participants