Skip to content

Releases: serde-rs/serde

v0.8.10

01 Oct 03:04
v0.8.10
2a2c098
Compare
Choose a tag to compare

This release deprecates the old Serde compiler plugin serde_macros in favor of the Macros 1.1-based implementation serde_derive.

We do not intend to release any further version of serde_macros, not even to fix breakage in future nightly versions. The design of Macros 1.1 is such that we do not expect to see the regular breakage with serde_derive that we used to see with serde_macros, as it depends on a far more limited set of unstable compiler internals.

See https://serde.rs/codegen-nightly.html for steps to set up serde_derive, or https://serde.rs/codegen-hybrid.html for steps to set up a hybrid serde_codegen/serde_derive approach that works on stable.

Old approach

[dependencies]
serde_macros = "0.8"
#![feature(plugin, custom_derive)]
#![plugin(serde_macros)]

New approach

[dependencies]
serde_derive = "0.8"
#![feature(rustc_macro)]

#[macro_use]
extern crate serde_derive;

// everything else is the same

v0.8.9

23 Sep 14:13
v0.8.9
429de89
Compare
Choose a tag to compare

Support for rustc 1.13.0-nightly (1265cbf4e 2016-09-15)

v0.8.8

08 Sep 15:40
v0.8.8
7cc36a9
Compare
Choose a tag to compare
  • Fix faulty generated code when using a serialize_with field attribute along with a nonstandard Result type in the same module (#546)

v0.8.7

05 Sep 16:50
v0.8.7
e85ca84
Compare
Choose a tag to compare
  • Add a forward_to_deserialize! macro to simplify JSON-like Deserializer implementations that want to ignore type hints given by Deserialize (#525)

    impl Deserializer for MyDeserializer {
        fn deserialize<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error>
            where V: Visitor
        {
            /* ... */
        }
    
        forward_to_deserialize! {
            bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 char str string
            unit option seq seq_fixed_size bytes map unit_struct newtype_struct
            tuple_struct struct struct_field tuple enum ignored_any
        }
    }
  • Add constructors for the Bytes and ByteBuf helpers (#520)

  • Allow MapDeserializer to be deserialized as a sequence of pairs instead of a map (#527)

  • Fix warnings in generated code for a non-unit struct with no fields (#536)

  • Minor cleanup of generated serialization code (#538)

v0.8.6

02 Sep 05:30
v0.8.6
248d937
Compare
Choose a tag to compare
  • Add a serde_derive crate which provides a Macros 1.1 implementation of #[derive(Serialize, Deserialize)] (#530)
  • Add serde_codegen::expand_str which is necessary for Macros 1.1

Using Macros 1.1 requires rustc support (not in nightly yet but available in rust-lang/rust#35957) and cargo support (available in rust-lang/cargo#3064). Using Macros 1.1 looks like this:

Cargo.toml

[dependencies]
serde = "0.8"
serde_derive = "0.8"

src/main.rs

#![feature(rustc_macro)]

#[macro_use]
extern crate serde_derive;

#[derive(Serialize, Deserialize)]
struct ItWorks {
    exciting: bool,
}

Advantages of this approach:

  • We expect Macros 1.1 to be stabilized much sooner than the features that serde_macros relies on, so we are finally in sight of having ergonomic Serde code generation available on stable Rust.
  • Even on nightly Rust, serde_derive is built in a way that is much more stable than serde_macros. It will not be affected by breaking libsyntax changes in the nightly compiler.

v0.8.5

31 Aug 20:06
v0.8.5
4bb9279
Compare
Choose a tag to compare

Support for rustc 1.13.0-nightly (eac41469d 2016-08-30)

v0.8.4

22 Aug 15:44
v0.8.4
d690ffd
Compare
Choose a tag to compare
  • Implement ValueDeserializer for Cow<str> (#513)
  • Support maps of unknown size in MapDeserializer (#514)

v0.8.3

19 Aug 17:20
v0.8.3
5fb7307
Compare
Choose a tag to compare
  • Fixes codegen for structs that have a lifetime parameter but no generic type parameter (#507)

v0.8.2

18 Aug 20:18
v0.8.2
Compare
Choose a tag to compare
  • Using Syntex, serde_codegen::expand now runs with a 16 MB stack by default because the previous default was often insufficient (#494, #503)

v0.8.1

11 Aug 16:13
v0.8.1
8c2359f
Compare
Choose a tag to compare
  • Impl Serialize and Deserialize for std::time::Duration (#476)
  • Use a thread in the build script of serde_codegen to allow env vars to control the stack size (#488)