Skip to content

Commit

Permalink
Switch from bincode to postcard [skip ci] (#410)
Browse files Browse the repository at this point in the history
Co-authored-by: UkoeHB <37489173+UkoeHB@users.noreply.github.com>
  • Loading branch information
Shatur and UkoeHB authored Feb 7, 2025
1 parent af91293 commit 753e5d8
Show file tree
Hide file tree
Showing 33 changed files with 681 additions and 458 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Update `ReplicatedClients` immediately to let users set visibility on `ClientConnected` trigger.

### Changed

- Replace `bincode` with `postcard`. It has more suitable variable integer encoding and potentially unlocks `no_std` support. If you use custom ser/de functions, replace `DefaultOptions::new().serialize_into(message, event)` with `postcard_utils::to_extend_mut(event, message)` and `DefaultOptions::new().deserialize_from(cursor)` with `postcard_utils::from_buf(message)`.
- All serde methods now use `postcard::Result` instead of `bincode::Result`.
- All deserialization methods now accept `Bytes` instead of `std::io::Cursor` because deserialization from `std::io::Read` requires a temporary buffer. `Bytes` already provide cursor-like functionality. The crate now re-exported under `bevy_replicon::bytes`.

## [0.30.0] - 2025-02-04

### Added
Expand Down
7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ serde = "1.0"
bevy = { workspace = true, features = ["serialize"] }
thiserror = "2.0"
typeid = "1.0"
bytes = "1.5"
bincode = "1.3"
bytes = "1.10"
serde.workspace = true
integer-encoding = "4.0"
ordered-multimap = "0.7"
bitflags = "2.6"
bitflags = { version = "2.6", features = ["serde"] }
postcard = { version = "1.1", default-features = false }

[dev-dependencies]
bevy = { workspace = true, features = [
Expand Down
Loading

0 comments on commit 753e5d8

Please sign in to comment.