Skip to content

Commit 59709ec

Browse files
docs(site): add by-wire-format conformance breakdown to the guide
1 parent f93d0f7 commit 59709ec

1 file changed

Lines changed: 42 additions & 23 deletions

File tree

  • site/app/docs/serialization/protobuf

site/app/docs/serialization/protobuf/page.jsx

Lines changed: 42 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,45 @@ const CONFORMANCE = [
1414
{ suite: "Total", pass: 2060, skip: 4147, fail: 0, total: true },
1515
];
1616

17+
// The same run, split by wire format: binary is fully covered; JSON, text-format,
18+
// and the proto2 binary cases (the 684 binary skips) are out of scope by design.
19+
const CONFORMANCE_FMT = [
20+
{ suite: "Binary", pass: 2060, skip: 684, fail: 0 },
21+
{ suite: "JSON", pass: 0, skip: 2620, fail: 0 },
22+
{ suite: "Text format", pass: 0, skip: 843, fail: 0 },
23+
{ suite: "Total", pass: 2060, skip: 4147, fail: 0, total: true },
24+
];
25+
26+
function ConformanceTable({ label, rows, firstCol }) {
27+
return (
28+
<div className="mt-6">
29+
<p className="mb-2 text-xs font-medium uppercase tracking-wide text-zinc-400">{label}</p>
30+
<div className="overflow-hidden rounded-xl border border-zinc-200">
31+
<table className="w-full text-left text-sm">
32+
<thead className="bg-zinc-50 text-zinc-600">
33+
<tr>
34+
<th className="px-4 py-3 font-medium">{firstCol}</th>
35+
<th className="px-3 py-3 text-right font-medium">Passed</th>
36+
<th className="px-3 py-3 text-right font-medium">Skipped</th>
37+
<th className="px-4 py-3 text-right font-medium">Failed</th>
38+
</tr>
39+
</thead>
40+
<tbody className="divide-y divide-zinc-100">
41+
{rows.map((r) => (
42+
<tr className={r.total ? "bg-zinc-50/60 font-medium" : "hover:bg-zinc-50/60"}>
43+
<td className="px-4 py-2.5 text-zinc-700">{r.suite}</td>
44+
<td className="px-3 py-2.5 text-right font-mono text-brand-700">{r.pass.toLocaleString()}</td>
45+
<td className="px-3 py-2.5 text-right font-mono text-zinc-500">{r.skip.toLocaleString()}</td>
46+
<td className="px-4 py-2.5 text-right font-mono text-zinc-700">{r.fail}</td>
47+
</tr>
48+
))}
49+
</tbody>
50+
</table>
51+
</div>
52+
</div>
53+
);
54+
}
55+
1756
export default function ProtobufParserDoc() {
1857
return (
1958
<DocsShell active="/docs/serialization/protobuf">
@@ -86,30 +125,10 @@ console.log(acct.status); // "ARCHIVED"`} title="protobuf_types.js" lang="js
86125
Conformance
87126
</h2>
88127
<p className="mt-2 text-zinc-600 leading-relaxed">
89-
Verified against the official protobuf conformance suite (v29.3), split by message category. The codec is binary&harr;binary, so JSON, JSPB, text-format, and proto2 cases are reported as <code className="rounded bg-zinc-100 px-1.5 py-0.5 text-[13px]">skipped</code> — never failed.
128+
Verified against the official protobuf conformance suite (v29.3). The codec is binary&harr;binary, so JSON, JSPB, text-format, and proto2 cases are reported as <code className="rounded bg-zinc-100 px-1.5 py-0.5 text-[13px]">skipped</code> — never failed.
90129
</p>
91-
<div className="mt-6 overflow-hidden rounded-xl border border-zinc-200">
92-
<table className="w-full text-left text-sm">
93-
<thead className="bg-zinc-50 text-zinc-600">
94-
<tr>
95-
<th className="px-4 py-3 font-medium">Category</th>
96-
<th className="px-3 py-3 text-right font-medium">Passed</th>
97-
<th className="px-3 py-3 text-right font-medium">Skipped</th>
98-
<th className="px-4 py-3 text-right font-medium">Failed</th>
99-
</tr>
100-
</thead>
101-
<tbody className="divide-y divide-zinc-100">
102-
{CONFORMANCE.map((r) => (
103-
<tr className={r.total ? "bg-zinc-50/60 font-medium" : "hover:bg-zinc-50/60"}>
104-
<td className="px-4 py-2.5 text-zinc-700">{r.suite}</td>
105-
<td className="px-3 py-2.5 text-right font-mono text-brand-700">{r.pass.toLocaleString()}</td>
106-
<td className="px-3 py-2.5 text-right font-mono text-zinc-500">{r.skip.toLocaleString()}</td>
107-
<td className="px-4 py-2.5 text-right font-mono text-zinc-700">{r.fail}</td>
108-
</tr>
109-
))}
110-
</tbody>
111-
</table>
112-
</div>
130+
<ConformanceTable label="By message category" firstCol="Category" rows={CONFORMANCE} />
131+
<ConformanceTable label="By wire format" firstCol="Wire format" rows={CONFORMANCE_FMT} />
113132
</DocsShell>
114133
);
115134
}

0 commit comments

Comments
 (0)