Skip to content

feat: Roundtrip unknown fields - #2209

Merged
dcodeIO merged 1 commit into
masterfrom
patch/unknown-fields-conformance
Apr 30, 2026
Merged

dcodeIO merged 1 commit into
masterfrom
patch/unknown-fields-conformance

Conversation

@dcodeIO

@dcodeIO dcodeIO commented Apr 30, 2026

Copy link
Copy Markdown
Member

Preserves unknown fields encountered during binary decoding and writes them back during encoding, enabling forward-compatible binary roundtrips.

Unknown field data is stored on messages as a non-enumerable, user-accessible $unknowns property. Deleting $unknowns discards preserved unknown fields explicitly. Also adds Reader#raw and Writer#raw helpers for reading and writing raw wire bytes directly.

Fixes #775
Fixes #1619 via Writer#raw

Supersedes #779
Supersedes #1912

Related: #296

@dcodeIO
dcodeIO merged commit 76fa03c into master Apr 30, 2026
4 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 30, 2026
@dcodeIO

dcodeIO commented Apr 30, 2026

Copy link
Copy Markdown
Member Author

Note: CI error after merge indicates overlap with #2208:

not ok 1201 should omit default string

@dcodeIO
dcodeIO deleted the patch/unknown-fields-conformance branch May 2, 2026 14:02
zeekay pushed a commit to hanzoai/protobuf.js that referenced this pull request Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to write raw fields directly into writer? add unknown field support

2 participants