Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

remove webpack specific change #1730

Merged
merged 1 commit into from
Jan 20, 2021
Merged

remove webpack specific change #1730

merged 1 commit into from
Jan 20, 2021

Conversation

xtuc
Copy link
Member

@xtuc xtuc commented Jan 14, 2021

We used to hook directly into webpack internals to rewrite the runtime
that loads Wasm to make it point to the Worker binding instead of a
network fetch.

This change removes the webpack specific change and injects a generic
runtime to load Wasm from the binding.

Demo of the webpack's generated code: https://gist.github.com/xtuc/1a96d6793a3729016a518416ecf5b585#file-demo-js-L2-L9. I used https://github.com/xtuc/rust-webpack-worker-demo to test.

@xtuc xtuc requested a review from a team as a code owner January 14, 2021 23:12
@xtuc xtuc force-pushed the sven/remove-webpack-change branch from f45bba2 to b239c43 Compare January 14, 2021 23:15
src/wranglerjs/bundle.rs Outdated Show resolved Hide resolved
@xtuc xtuc force-pushed the sven/remove-webpack-change branch from b239c43 to 472faa1 Compare January 14, 2021 23:19
@xtuc xtuc requested review from a team January 15, 2021 15:11
Copy link
Contributor

@xortive xortive left a comment

Choose a reason for hiding this comment

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

Tested with provided template, works great :)

We used to hook directly into webpack internals to rewrite the runtime
that loads Wasm to make it point to the Worker binding instead of a
network fetch.

This change removes the webpack specific change and injects a generic
runtime to load Wasm from the binding.
@xtuc xtuc force-pushed the sven/remove-webpack-change branch from 472faa1 to 1d033db Compare January 18, 2021 09:31
@xtuc
Copy link
Member Author

xtuc commented Jan 18, 2021

changed to emit the JS runtime only if wasm is actually used. Avoids breaking source maps for others

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants