You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.
introspect Webpack's module graph for wasm binaries
concatenate JavaScript files
generate the bindings file
inject a prologue, that polyfills fetch + window
Here are the changes for moving the logic in wrangler:
I don't think it would be a good idea to send back to wrangler the entire Webpack graph because it can get pretty big; we should aggregate the information in wrangler-js and concatenate files I think.
The files could be written from wrangler.
The bindings file can be generated in wranger.
The prologue is just a string, it's easy to do in wrangler.
Problem
Currently
wrangler
is coupled to wasm-pack, which makes it unpracticable for non-rust projects (especially JavaScript projects).Proposal
Use Webpack as a backend to build any projects that use a Webpack configuration.
For prototyping, I made
wranger-js
and came up with a few demos https://github.com/xtuc/wrangler-js-demo to give you a better idea.Note that we don't want to have multiple tools but rather add that support in
wrangler
to have a single tool.Context about Webpack
With the integration of WebAssembly in Webpack, any loader can emit a wasm binary in Webpack that will be bundled along the JavaScript project.
That integration already implements the ECMAScript module integration, which make working with Wasm module easier in JavaScript.
Allows npm dependecies
Webpack is a bundler, npm dependecies are supported.
Optimize JavaScript
Webpack runs, in production mode, a JavaScript minifier. Also we could add Wasm optimization.
Auto generate the Worker's metadata.json
Webpack constructs the module graph of the project, we can look at it to find any wasm modules and generate the corresponding metadata.json.
The text was updated successfully, but these errors were encountered: