-
Notifications
You must be signed in to change notification settings - Fork 774
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
feat: support [wasm_modules]
for service-worker format workers
#409
Conversation
🦋 Changeset detectedLatest commit: 2bd500d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
wrangler prerelease is available for testing: npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/1817713440/wrangler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A handful of nits.
This lands support for `[wasm_modules]` as defined by cloudflare/wrangler-legacy#1677. wasm modules can be defined in service-worker format with configuration in wrangler.toml as - ``` [wasm_modules] MYWASM = "./path/to/my-wasm.wasm" ``` The module will then be available as the global `MYWASM` inside your code. Note that this ONLY makes sense in service-worker format workers (for now). (In the future, we MAY enable wasm module imports in service-worker format (i.e. `import MYWASM from './path/to/my-wasm.wasm'`) and global imports inside modules format workers.)
d914b37
to
2bd500d
Compare
This allows importing `.wasm` modules in service worker format workers. We do this by hijacking imports to `.wasm` modules, and instead registering them under `[wasm_modules]` (building on the work from #409).
This allows importing `.wasm` modules in service worker format workers. We do this by hijacking imports to `.wasm` modules, and instead registering them under `[wasm_modules]` (building on the work from #409).
This allows importing `.wasm` modules in service worker format workers. We do this by hijacking imports to `.wasm` modules, and instead registering them under `[wasm_modules]` (building on the work from #409).
This allows importing `.wasm` modules in service worker format workers. We do this by hijacking imports to `.wasm` modules, and instead registering them under `[wasm_modules]` (building on the work from #409).
This allows importing `.wasm` modules in service worker format workers. We do this by hijacking imports to `.wasm` modules, and instead registering them under `[wasm_modules]` (building on the work from #409).
This allows importing `.wasm` modules in service worker format workers. We do this by hijacking imports to `.wasm` modules, and instead registering them under `[wasm_modules]` (building on the work from #409).
This lands support for
[wasm_modules]
as defined by cloudflare/wrangler-legacy#1677.wasm modules can be defined in service-worker format with configuration in wrangler.toml as -
The module will then be available as the global
MYWASM
inside your code. Note that this ONLY makes sense in service-worker format workers (for now).(In the future, we MAY enable wasm module imports in service-worker format (i.e.
import MYWASM from './path/to/my-wasm.wasm'
) and global imports inside modules format workers.)