buffa-remote-derive: generate feature-gated serde/Arbitrary/reflection forwarders
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 28/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- json, rust
- Domain
- developer-experience, testing
Research direction
Start by reading the buffa-remote-derive crate plus the hand-written reference pattern in examples/custom-types/src/types/ and that example's README serde matrix. The issue lists serde, arbitrary::Arbitrary, and ReflectList/ReflectMap forwarders, but the feature-flag versus attribute design and serde delegation model are still unsettled. Done requires an agreed design and generated forwarders matching it.
Written by the indexing model from the issue text.
Description
#251 landed the buffa-remote-derive crate (ProtoString/ProtoBytes/ProtoList/ProtoBox/MapStorage derives for newtypes over remote types), scoped to the binary codec only. This issue tracks the remaining piece of #212's design sketch: optionally generating the feature-gated forwarders so a derived newtype is usable in JSON, fuzzing, and reflection builds without hand-written impls.
What the derives currently do not generate, and where the gap bites:
- serde forwarders — a string newtype used as a repeated element, an
optionalfield, or a map value serializes through its ownSerialize/Deserialize; without them agenerate_json(true)build fails with a trait-bound error deep in generated message code. (Bytes newtypes are exempt: all bytes positions route through the base64with-modules.) The crate docs' "Scope: the binary codec only" section documents the current hand-written workaround (#[derive(serde::Serialize, serde::Deserialize)]+#[serde(transparent)]). arbitrary::Arbitrary— needed for fuzz targets that construct messages containing the newtype.- reflection (
ReflectList/ReflectMap) — needed for vtable-reflection builds where the newtype backs arepeatedormapfield.
Design questions to settle before implementing:
- Feature flags on the derive crate (
json/arbitrary/reflect) versus derive-attribute opt-ins (#[buffa(serde)]); a proc-macro crate's features are unified across the dependency graph, which argues for per-derive attributes. - Whether the serde forwarder should be
#[serde(transparent)]-equivalent (delegate to the remote type's serde) or route throughAsRef/Fromlike buffa's own with-modules, which would drop the remote-type-must-support-serde requirement.
Until then, the hand-written pattern in examples/custom-types/src/types/ is the reference, and the per-position serde matrix lives in that example's README.
- Dominant language
- Rust
- Stars
- 900
- Forks
- 95
- Avg merge
- 5d 10h
- Merged PRs (30d)
- 57
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from anthropics/buffa
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
anthropics/buffa#487 ·
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
anthropics/buffa#490 ·
Maintainers usually reply within 2 days
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 55/100
anthropics/buffa#482 · 1 comment ·
Maintainers usually reply within 2 days
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
anthropics/buffa#463 ·
Maintainers usually reply within 2 days
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
anthropics/buffa#450 ·
Maintainers usually reply within 2 days
All issues in anthropics/buffa
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
trezor/trezor-firmware#7997 ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
oxidecomputer/management-gateway-service#506 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
scylladb/nodejs-rs-driver#566 ·
Maintainers usually reply within 1 day
-
A-ABI needs-triage relnotes relnotes-needs-review relnotes-tracking-issue T-lang T-libs T-opsem
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day