-
Notifications
You must be signed in to change notification settings - Fork 43
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
Support webassembly instantiate streaming #431
Support webassembly instantiate streaming #431
Conversation
d6f4f3f
to
134bf2a
Compare
…able to use WebAssembly.instantiateStreaming over WebAssembly.instantiate internally Signed-off-by: Eric Tucker <[email protected]>
Signed-off-by: Eric Tucker <[email protected]>
Signed-off-by: Eric Tucker <[email protected]>
134bf2a
to
b74af11
Compare
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.
Very nice, I've been wanting that, too. ✨ Thanks!
I'll take care of it next week! |
✔️ It's released: 1.9.0. I'm curious, what's your use case? How are you using OPA's wasm modules? 😃 |
Thank you! @srenatus We're using it in a monorepo. The policies/wasm build is all in its own package that's imported into the apps using it. The service itself needed to be usable in browsers and Node runtime so we're bundling the wasm policy with That same service is used by:
So we get to define the policies in a central place and essentially have 3 different runtimes benefit from using the exact same policies without having to redefine and keep everything in sync for each platform. |
That's awesome. 🚀 I'm currently working on something related to
too, so I've been wondering if you'd like to share notes. Are you on the OPA Slack? |
@srenatus I'd love to share notes and approaches! I'm not in the OPA Slack, do I need an invite to join? |
This allows passing a
Response
orPromise<Response>
toloadPolicy
which will pass the response toWebAssembly.instantiateStreaming()
instead ofWebAssembly.instantiate()
to allow fulfilling the suggestion from MDN