-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add Observe SDK support #3
Comments
Wait for Observe SDK breaking changes to land . Ping @chrisdickinson |
In order to accomplish this, we need to:
|
neuronicnobody
added
question
Further information is requested
and removed
enhancement
New feature or request
question
Further information is requested
labels
Nov 27, 2023
chrisdickinson
added a commit
that referenced
this issue
Nov 27, 2023
`createPlugin` now accepts two additional manifest types (`response` and `module`) as well as `Response` and `WebAssembly.Module`. There are four goals here: 1. Allow us to target the Cloudflare Workers platform. CF Workers only support loading Wasm via `import` statements; these resolve to `WebAssembly.Module` objects, which means we need to allow users to pass `Module`s in addition to our other types. 2. Play nicely with V8's [Wasm caching][1]; in particular V8 will use metadata from the `Response` to build a key for caching the results of Wasm compilation. 3. This sets us up to implement [Wasm linking][2] by allowing us to introspect plugin modules imports and exports before instantiation. 4. And finally, resolving to modules instead of arraybuffers allows us to add [hooks for observe-sdk][3] (especially in advance of adding [thread pooling][4]). Because Bun lacks support for `WebAssembly.compileStreaming` and `Response.clone()`, we provide an alternate implementation for converting a response to a module and its metadata. One caveat is that there's no way to get the source bytes of a `WebAssembly.Module`, so `{module}` cannot be used with `{hash}` in a `Manifest`. Fixes #9 [1]: https://v8.dev/blog/wasm-code-caching#stream [2]: #29 [3]: #3 [4]: #31
chrisdickinson
added a commit
that referenced
this issue
Nov 27, 2023
`createPlugin` now accepts two additional manifest types (`response` and `module`) as well as `Response` and `WebAssembly.Module`. There are four goals here: 1. Allow us to target the Cloudflare Workers platform. CF Workers only support loading Wasm via `import` statements; these resolve to `WebAssembly.Module` objects, which means we need to allow users to pass `Module`s in addition to our other types. 2. Play nicely with V8's [Wasm caching][1]; in particular V8 will use metadata from the `Response` to build a key for caching the results of Wasm compilation. 3. This sets us up to implement [Wasm linking][2] by allowing us to introspect plugin modules imports and exports before instantiation. 4. And finally, resolving to modules instead of arraybuffers allows us to add [hooks for observe-sdk][3] (especially in advance of adding [thread pooling][4]). Because Bun lacks support for `WebAssembly.compileStreaming` and `Response.clone()`, we provide an alternate implementation for converting a response to a module and its metadata. One caveat is that there's no way to get the source bytes of a `WebAssembly.Module`, so `{module}` cannot be used with `{hash}` in a `Manifest`. Fixes #9 [1]: https://v8.dev/blog/wasm-code-caching#stream [2]: #29 [3]: #3 [4]: #31
chrisdickinson
added a commit
that referenced
this issue
Nov 28, 2023
`createPlugin` now accepts two additional manifest types (`response` and `module`) as well as `Response` and `WebAssembly.Module`. There are four goals here: 1. Allow us to target the Cloudflare Workers platform. CF Workers only support loading Wasm via `import` statements; these resolve to `WebAssembly.Module` objects, which means we need to allow users to pass `Module`s in addition to our other types. 2. Play nicely with V8's [Wasm caching][1]; in particular V8 will use metadata from the `Response` to build a key for caching the results of Wasm compilation. 3. This sets us up to implement [Wasm linking][2] by allowing us to introspect plugin modules imports and exports before instantiation. 4. And finally, resolving to modules instead of arraybuffers allows us to add [hooks for observe-sdk][3] (especially in advance of adding [thread pooling][4]). Because Bun lacks support for `WebAssembly.compileStreaming` and `Response.clone()`, we provide an alternate implementation for converting a response to a module and its metadata. One caveat is that there's no way to get the source bytes of a `WebAssembly.Module`, so `{module}` cannot be used with `{hash}` in a `Manifest`. Fixes #9 [1]: https://v8.dev/blog/wasm-code-caching#stream [2]: #29 [3]: #3 [4]: #31
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is different than extism/extism#470
Because we don't rely on libextism in this library, I believe we should be able to add Observe support independently.
The text was updated successfully, but these errors were encountered: