nushell/crates/nu-plugin-protocol
Devyn Cairns f4940e115f
Remove bincode and use MessagePack instead for plugin custom values (#13745)
# Description

This changes the serialization of custom values within the plugin
protocol to use MessagePack instead of bincode, removing the dependency
on bincode entirely.

Bincode does not seem to be very maintained anymore, and the externally
tagged enum representation doesn't seem to always work now even though
it should. Since we use MessagePack already anyway for the plugin
protocol, this seems like an obvious choice. This uses the unnamed
variant of the serialization rather than the named variant, which is
what the plugin protocol in general uses. The unnamed variant does not
include field names, which aren't really required here, so this should
give us something that's more or less as efficient as bincode is.

Should fix #13743.

# User-Facing Changes

- Will need to recompile plugins (but always do anyway)
- Doesn't technically break the plugin protocol (custom value data is a
black box / plugin implementation specific), but breaks compatibility
between `nu-plugin-engine` and `nu-plugin` so they do need to both be
updated to match.

# Tests + Formatting

All tests pass.

# After Submitting

- [ ] release notes
2024-09-01 17:33:10 +02:00
..
src Remove bincode and use MessagePack instead for plugin custom values (#13745) 2024-09-01 17:33:10 +02:00
Cargo.toml Remove bincode and use MessagePack instead for plugin custom values (#13745) 2024-09-01 17:33:10 +02:00
LICENSE Split the plugin crate (#12563) 2024-04-27 12:08:12 -05:00
README.md Split the plugin crate (#12563) 2024-04-27 12:08:12 -05:00

nu-plugin-protocol

This crate provides serde-compatible types for implementing the Nushell plugin protocol. It is primarily used by the nu-plugin family of crates, but can also be used separately as well.

The specifics of I/O and serialization are not included in this crate. Use serde_json and/or rmp-serde (with the named serialization) to turn the types in this crate into data in the wire format.