Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates the wasmtime dependency from version 31.0.0 to 36.0.0, requiring significant changes to adapt to the new API. The update involves adjusting type constraints, import paths, and API method calls to maintain compatibility with the newer wasmtime version.
Key changes include:
- Adding
'staticlifetime constraints to generic type parameters throughout the codebase - Updating import paths for WASI modules and related functionality
- Modifying API calls to use new method names and signatures introduced in wasmtime 36.0.0
Reviewed Changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Updates wasmtime dependencies from 31.0.0 to 36.0.0 and adds wasmtime-wasi-io |
| crates/runtime/src/store.rs | Adds 'static lifetime bounds to Store struct and trait implementations |
| crates/runtime/src/service.rs | Adds 'static lifetime bound to Service State associated type |
| crates/runtime/src/logger.rs | Major refactor to use AsyncWrite instead of OutputStream, updates imports and method signatures |
| crates/runtime/src/lib.rs | Updates WASI-related imports and adds 'static bounds to Data and engine structs |
| crates/runtime/Cargo.toml | Adds tokio and wasmtime-wasi-io dependencies |
| crates/reactor/src/lib.rs | Updates bindgen configuration syntax from async/tracing flags to imports syntax |
| crates/key-value-store/Cargo.toml | Relaxes async-trait version constraint |
| crates/http-service/src/lib.rs | Updates WASI linker calls and adds HasSelf type parameters |
| crates/http-service/src/executor/wasi_http.rs | Adds 'static lifetime bound to executor struct |
| crates/http-service/src/executor/http.rs | Updates method calls and error handling to use new async logger API |
| crates/http-backend/Cargo.toml | Relaxes version constraints for several dependencies |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| if let Err(error) = Box::into_pin(self.async_stream()) | ||
| .write_all(msg.as_bytes()) | ||
| .await |
There was a problem hiding this comment.
The Box::into_pin() call creates unnecessary heap allocation for each write operation. Consider storing the pinned writer as a field in the Logger struct or using a different approach that avoids repeated boxing.
| })?; | ||
|
|
||
| reactor::gcore::fastedge::http_client::add_to_linker(linker, |data| { | ||
| reactor::gcore::fastedge::http_client::add_to_linker::<_, HasSelf<_>>(linker, |data| { |
There was a problem hiding this comment.
[nitpick] The repeated use of HasSelf<_> type parameter suggests this could be extracted into a type alias or helper function to reduce duplication and improve maintainability.
| })?; | ||
|
|
||
| reactor::gcore::fastedge::dictionary::add_to_linker(linker, |data| { | ||
| reactor::gcore::fastedge::dictionary::add_to_linker::<_, HasSelf<_>>(linker, |data| { |
There was a problem hiding this comment.
[nitpick] The repeated use of HasSelf<_> type parameter suggests this could be extracted into a type alias or helper function to reduce duplication and improve maintainability.
| })?; | ||
|
|
||
| reactor::gcore::fastedge::secret::add_to_linker(linker, |data| &mut data.secret_store)?; | ||
| reactor::gcore::fastedge::secret::add_to_linker::<_, HasSelf<_>>(linker, |data| { |
There was a problem hiding this comment.
[nitpick] The repeated use of HasSelf<_> type parameter suggests this could be extracted into a type alias or helper function to reduce duplication and improve maintainability.
| })?; | ||
|
|
||
| reactor::gcore::fastedge::key_value::add_to_linker(linker, |data| { | ||
| reactor::gcore::fastedge::key_value::add_to_linker::<_, HasSelf<_>>(linker, |data| { |
There was a problem hiding this comment.
[nitpick] The repeated use of HasSelf<_> type parameter suggests this could be extracted into a type alias or helper function to reduce duplication and improve maintainability.
No description provided.