Skip to content

Commit 784b175

Browse files
authored
feat(serde-feather): implement phase 3 named-struct derive MVP (#187)
## Summary - implement Phase 3 MVP derive support for `serde-feather` - stabilize and expose `FeatherSerialize` / `FeatherDeserialize` behind the `derive` feature - enforce `derive` => `std`, and keep no-std derive out of scope for this phase - add compile-time validation for unsupported inputs (enums, tuple structs, generics, unsupported serde attrs) - add runtime + compile-fail tests for MVP contract coverage - update `docs/project-serde-feather.md` and `crates/AGENTS.md` to align contracts with implementation ## Implementation details - runtime crate: - re-export stable derive macros - add compile-time guard message for invalid feature configuration - macro crate: - add `#[proc_macro_derive(FeatherSerialize, attributes(serde))]` - add `#[proc_macro_derive(FeatherDeserialize, attributes(serde))]` - support only non-generic named structs - support attrs: - container: `rename` - field: `rename`, `default`, `skip`, `skip_serializing`, `skip_deserializing` - ignore unknown fields during deserialization - resolve crate path robustly via `proc-macro-crate` ## Validation - `cargo fmt --all` - `cargo check -p serde-feather` - `cargo check -p serde-feather-macros` - `cargo check -p serde-feather --features derive` - `cargo check -p serde-feather --no-default-features` - `cargo check -p serde-feather --no-default-features --features derive` - `cargo test -p serde-feather -p serde-feather-macros` - `cargo test -p serde-feather --features derive` - `cargo test`
1 parent db8838f commit 784b175

23 files changed

Lines changed: 1087 additions & 35 deletions

Cargo.lock

Lines changed: 143 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
- Keep `serde-feather` as the runtime-facing crate and `serde-feather-macros` as the proc-macro crate.
4343
- Keep binary-size-first defaults: minimal default features and no convenience dependencies by default.
44-
- Do not stabilize public derive macro identifiers before they are documented in `docs/project-serde-feather.md`.
44+
- Keep stable derive macro identifiers (`FeatherSerialize`, `FeatherDeserialize`) aligned with `docs/project-serde-feather.md`.
4545

4646
### dexdex-Specific Rules
4747

crates/serde-feather-macros/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ publish = false
1010
proc-macro = true
1111

1212
[dependencies]
13+
proc-macro-crate = "3.3.0"
1314
proc-macro2 = "1.0.94"
1415
quote = "1.0.39"
1516
syn = { version = "2.0.100", features = ["full"] }

0 commit comments

Comments
 (0)