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
Don't forget to share your feedback when you test it 😄
Nice
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
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•2y ago
Message Not Public
Sign In & Join Server To View
Is there an example pages WASM example? I can't find one in the docs
The team is working on the docs, do you want a wasm example for something in particular?
@cboskipper
Yes please @veerooo Looking to modify the response sent to the browser. HTML rewriter.
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?
https://github.com/cloudflare/workers-sdk/tree/main/fixtures/pages-functions-wasm-app
@cboskipper Our wrangler fixtures are also a good place to start:
https://github.com/cloudflare/workers-sdk/tree/main/fixtures/pages-workerjs-wasm-app
Yes, using the two together. I have only seen a Rust -> WASM binding example on the docs site.
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
Was waiting on the tutorial. This example seems to be what I was looking for.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Hi @neicudi, I'll ask pages team and get back to you tomorrow when they start working
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
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
^ @neicudi