WASM support for Pages Functions

Hey @Pages developers, WASM support for Pages Functions beta is here! Share your pages.dev URL in the thread, and we'll enable it for you to test!
18 Replies
Vero
VeroOP•2y ago
Don't forget to share your feedback when you test it 😄
soos
soos•2y ago
Nice
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Vero
VeroOP•2y ago
Hey @larry.mac they're working on the release blog post at the moment. Regarding your question, the team told me that on the Pages they don't set any limits for wasm in particular. but they know there are some general constraints, which will probably apply for wasm as well. Maybe @gregbrimble can give more details but if you're talking about: https://developers.cloudflare.com/workers/platform/limits/#worker-limits, those apply for wasm in functions as well, then no, you can't use more than those 128mb, which is the worker memory limit
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
cb
cb•2y ago
Is there an example pages WASM example? I can't find one in the docs
Vero
VeroOP•2y ago
The team is working on the docs, do you want a wasm example for something in particular? @cboskipper
cb
cb•2y ago
Yes please @veerooo Looking to modify the response sent to the browser. HTML rewriter.
GregBrimble
GregBrimble•2y ago
Do you want to call HTMLRewriter from within your Wasm? Or are you just looking for an example of using the two together in a Pages Functions endpoint?
cb
cb•2y ago
Yes, using the two together. I have only seen a Rust -> WASM binding example on the docs site.
Vero
VeroOP•2y ago
Hi @cboskipper, I didn't find an example for exactly what you're looking for, but here's another one https://github.com/CarmenPopoviciu/pages-fns-with-wasm-demo. Did you already manage to do what you wanted? Hi @jkroe_7, @sooswastaken did you try using wasm in functions? Please let me know if you have any questions/feedback
cb
cb•2y ago
Was waiting on the tutorial. This example seems to be what I was looking for.
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Vero
VeroOP•2y ago
Hi @neicudi, I'll ask pages team and get back to you tomorrow when they start working
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
kian
kian•2y ago
What project are you using for the WebAssembly? That error is since Workers (and Functions) cannot instantiate WebAssembly from a buffer or anything like that, only bundled modules https://github.com/kvnang/workers-og and https://github.com/PaganMuffin/og-image-test should both work on Workers
Vero
VeroOP•2y ago
^ @neicudi
Want results from more Discord servers?
Add your server