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
Veroβ€’16mo ago
Don't forget to share your feedback when you test it πŸ˜„
soos
soosβ€’16mo ago
Nice
Unknown User
Unknown Userβ€’16mo ago
Message Not Public
Sign In & Join Server To View
Vero
Veroβ€’16mo 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β€’16mo ago
Message Not Public
Sign In & Join Server To View
cb
cbβ€’16mo ago
Is there an example pages WASM example? I can't find one in the docs
Vero
Veroβ€’16mo ago
The team is working on the docs, do you want a wasm example for something in particular? @cboskipper
cb
cbβ€’16mo ago
Yes please @veerooo Looking to modify the response sent to the browser. HTML rewriter.
Unknown User
Unknown Userβ€’16mo ago
Message Not Public
Sign In & Join Server To View
cb
cbβ€’16mo ago
Yes, using the two together. I have only seen a Rust -> WASM binding example on the docs site.
Vero
Veroβ€’16mo 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β€’16mo ago
Was waiting on the tutorial. This example seems to be what I was looking for.
Unknown User
Unknown Userβ€’15mo ago
Message Not Public
Sign In & Join Server To View
Vero
Veroβ€’15mo ago
Hi @neicudi, I'll ask pages team and get back to you tomorrow when they start working
Unknown User
Unknown Userβ€’15mo ago
Message Not Public
Sign In & Join Server To View
kian
kianβ€’15mo 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
Veroβ€’15mo ago
^ @neicudi