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

build(wasm): use vite to embed the WASM module in base64 #283

Merged
merged 2 commits into from
Jun 11, 2024

Conversation

irvingoujAtDevolution
Copy link
Contributor

Use Vite to rebuild Picky WASM into Base64 encoded JavaScript. This approach have the following benefits for angular 18:

  1. Import and use, no extra configuration
    In Angular 18, if we want to use WASM, we need to configure Vite (that is used bu Angular 18) to use vite-plugin-wasm.
  2. Zero interface change
  3. Backward compatibility
    As it is just JavaScript file, any project can just import it without worrying about how to load WASM

@CBenoit
Copy link
Member

CBenoit commented Jun 4, 2024

Thank you, exactly what I wanted!! I’ll review that more in depth tomorrow.

@CBenoit CBenoit changed the title chore(wasm):use vite to rebuild wasm package into base64 js build(wasm): use vite to embed the WASM module in base64 Jun 5, 2024
@CBenoit
Copy link
Member

CBenoit commented Jun 5, 2024

In Angular 18, if we want to use WASM, we need to configure Vite (that is used bu Angular 18) to use vite-plugin-wasm.

I understand that we only need to use this vite plugin when bundling our npm package together, but this is not required in the consuming project, am I correct?

@irvingoujAtDevolution
Copy link
Contributor Author

@CBenoit , yes, you are correct, consumers can use anything they want.

Copy link
Member

@CBenoit CBenoit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@CBenoit CBenoit merged commit a919545 into master Jun 11, 2024
10 checks passed
@CBenoit CBenoit deleted the test-use-vite branch June 11, 2024 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants