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

Move rust-sdk wasm artifact into bundles directory #28718

Merged
merged 2 commits into from
Dec 11, 2024

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Dec 11, 2024

As of matrix-org/matrix-rust-sdk-crypto-wasm#167, the wasm build of matrix-sdk-crypto is actually shipped as a .wasm file, rather than base64-ed into Javascript. Our current webpack config then dumps it into the top level of the build directory, which will be a problem on redeployment (specifically, if you try to fetch the wasm artifact for vN after vN+1 has been deployed, you'll get a 404 and sadness).

So, instead we use Webpack's experimental support for WASM-as-ES-module, which makes Webpack put the wasm file in the bundle, along with everything else.

This is an alternative approach to a previous attempt, in #28624.

Fixes: #28632

As of matrix-org/matrix-rust-sdk-crypto-wasm#167, the
wasm build of matrix-sdk-crypto is actually shipped as a `.wasm` file, rather
than base64-ed into Javascript. Our current webpack config then dumps it into
the top level of the build directory, which will be a problem on redeployment
(specifically, if you try to fetch the wasm artifact for vN after vN+1 has been
deployed, you'll get a 404 and sadness).

So, instead we use Webpack's experimental support for WASM-as-ES-module, which
makes Webpack put the wasm file in the bundle, along with everything else.

Fixes: #28632
@richvdh richvdh requested a review from a team as a code owner December 11, 2024 13:36
@richvdh richvdh added the T-Task Tasks for the team like planning label Dec 11, 2024
@richvdh
Copy link
Member Author

richvdh commented Dec 11, 2024

This will be a no-op until matrix-org/matrix-rust-sdk-crypto-wasm#167 actually makes it into a release that we use.

@richvdh richvdh added this pull request to the merge queue Dec 11, 2024
Merged via the queue into develop with commit 299270e Dec 11, 2024
33 checks passed
@richvdh richvdh deleted the rav/wasm_in_bundle_2 branch December 11, 2024 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Task Tasks for the team like planning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

matrix-sdk-crypto-wasm 12 will break redeployment of element-web
2 participants