-
Notifications
You must be signed in to change notification settings - Fork 653
feat(rome_workspace): ensure all parameters and result structs on the workspace interface are serializable #2928
Conversation
… workspace interface are serializable
Deploying with
|
Latest commit: |
4628e0b
|
Status: | ✅ Deploy successful! |
Preview URL: | https://fa1cf558.tools-8rn.pages.dev |
Branch Preview URL: | https://feature-workspace-serde.tools-8rn.pages.dev |
Parser conformance results on ubuntu-latestjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
Re: test plan I presume that once we start using the new feature internally, we should start seeing its benefits/repercussions? |
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.
Looks good.
Does that mean that we limit ourself to a Workspace
facade that only uses serializable types? Do you see this as a limiting factor e.g. in a long-running CLI service that isn't restricted by the fact that the returned result types must be serializable? Would it be an option to have a specific Workspace
facade for consumers that require a serializable/message based interface or is this something you can still see us do in the future/
Besides laying out the groundwork for future work on a client-server system with a shared daemon process, one of the immediate application of this change could be in the JavaScript or WebAssembly bindings. Since this change transitively ensures that most of the "public API" types are serializable it opens the possibility of using serde for transmitting objects across FFI boundaries
Yes that's the general intent for the moment, obviously a lot of concepts for our internal client-server model still need to be fleshed out so the idea I'm currently going with is to have this interface as constrained as possible to facilitate future experimentation. |
… workspace interface are serializable (rome#2928)
Summary
This PR adds a new
serde_workspace
feature torome_service
that automatically derives theSerialize
andDeserialize
traits fromserde
on all the types that transit through theWorkspace
interface (including types declared in other crates and transitively included in this interface). This feature is currently disabled by default but prepares the way for the workspace potentially being callable across IPC or FFI boundaries, and in the meantime still imposes some limitations on how data can transit across theWorkspace
trait that forces it to work across languages (code actions for instance are now represented as language-agnostic text diffs, instead of language-specific syntax trees)Test Plan
This code is currently untested since the feature is disabled by default, however since it all relies on the procedural derive macros from
serde
simply runningcargo build -p rome_service --features serde_workspace
is enough to verify that everything compiles correctly, maybe this command could be added to the suite of tests being run on GitHub Actions ?