Skip to content

Commit 8c824ef

Browse files
committed
deploy: a2df88c
1 parent 1a0da66 commit 8c824ef

File tree

22 files changed

+318
-143
lines changed

22 files changed

+318
-143
lines changed

news/2023-04-11/index.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66
<a href="https://github.com/protocolbuffers/protocolbuffers.github.io/issues/new?title=Changes%20announced%20April%2011,%202023" class=td-page-meta--issue target=_blank rel=noopener><i class="fa-solid fa-list-check fa-fw"></i> Create documentation issue</a>
77
<a href=https://github.com/protocolbuffers/protobuf/issues/new class=td-page-meta--project-issue target=_blank rel=noopener><i class="fa-solid fa-list-check fa-fw"></i> Create project issue</a></div><div class=td-toc><nav id=TableOfContents><ul><li><a href=#deprecation>Syntax Reflection Deprecation</a></li><li><a href=#cord>Adding support for ctype=CORD in C++</a></li><li><a href=#retention>Option Retention</a></li><li><a href=#bazel>Dropping Support for Bazel &lt;5.3</a></li></ul></nav></div></aside><main class="col-12 col-md-9 col-xl-8 pl-md-5" role=main><nav aria-label=breadcrumb class=td-breadcrumbs><ol class=breadcrumb><li class=breadcrumb-item><a href=https://protobuf.dev/news/>News</a></li><li class="breadcrumb-item active" aria-current=page><a href=https://protobuf.dev/news/2023-04-11/ aria-disabled=true class="btn-link disabled">April 11, 2023</a></li></ol></nav><div class=td-content><h1>Changes announced April 11, 2023</h1><div class=lead>Changes announced for Protocol Buffers on April 11, 2023.</div><header class=article-meta></header><h2 id=deprecation>Syntax Reflection Deprecation</h2><p>v23 will deprecate the ability to check syntax version using reflection. The
88
deprecation will be included as warnings at build time. The capability will be
9-
removed in a future release.</p><h2 id=cord>Adding support for ctype=CORD in C++</h2><p>v23 will add <code>ctype=CORD</code> support for <code>singular</code>
10-
<code>bytes</code> fields, including <code>oneof</code> fields, to specify that data should be stored
11-
using
9+
removed in a future release.</p><h2 id=cord>Adding support for ctype=CORD in C++</h2><p>v23 will add <code>ctype=CORD</code> support for singular <code>bytes</code>
10+
fields, including <code>oneof</code> fields, to specify that data should be stored using
1211
<a href=https://github.com/abseil/abseil-cpp/blob/master/absl/strings/cord.h><code>absl::cord</code></a>
13-
instead of <code>string</code>. Support may be added in future releases for <code>singular</code>
12+
instead of <code>string</code>. Support may be added in future releases for singular
1413
<code>string</code> field types and for <code>repeated</code> <code>string</code> and <code>byte</code> fields if there is
1514
enough interest from the open source community.</p><p><code>ctype=CORD</code> will have no effect on extensions.</p><p>You will be able to add the support using field options:</p><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-proto data-lang=proto><span style=display:flex><span><span style=color:#204a87;font-weight:700>optional</span> <span style=color:#204a87;font-weight:700>bytes</span> <span style=color:#000>foo</span> <span style=color:#ce5c00;font-weight:700>=</span> <span style=color:#0000cf;font-weight:700>25</span> <span style=color:#000;font-weight:700>[</span><span style=color:#204a87;font-weight:700>ctype</span><span style=color:#ce5c00;font-weight:700>=</span><span style=color:#000>CORD</span><span style=color:#000;font-weight:700>];</span><span style=color:#a40000>
1615
</span></span></span></code></pre></div><h2 id=retention>Option Retention</h2><p>Options now have a notion of <em>retention</em>, which controls whether an option is

news/2023-04-28/index.html

Lines changed: 16 additions & 0 deletions
Large diffs are not rendered by default.

news/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
<a href="https://github.com/protocolbuffers/protocolbuffers.github.io/new/main/content/news/_index.md?filename=change-me.md&amp;value=---%0Atitle%3A+%22Long+Page+Title%22%0AlinkTitle%3A+%22Short+Nav+Title%22%0Aweight%3A+100%0Adescription%3A+%3E-%0A+++++Page+description+for+heading+and+indexes.%0A---%0A%0A%23%23+Heading%0A%0AEdit+this+template+to+create+your+new+page.%0A%0A%2A+Give+it+a+good+name%2C+ending+in+%60.md%60+-+e.g.+%60getting-started.md%60%0A%2A+Edit+the+%22front+matter%22+section+at+the+top+of+the+page+%28weight+controls+how+its+ordered+amongst+other+pages+in+the+same+directory%3B+lowest+number+first%29.%0A%2A+Add+a+good+commit+message+at+the+bottom+of+the+page+%28%3C80+characters%3B+use+the+extended+description+field+for+more+detail%29.%0A%2A+Create+a+new+branch+so+you+can+preview+your+new+file+and+request+a+review+via+Pull+Request.%0A" class=td-page-meta--child target=_blank rel=noopener><i class="fa-solid fa-pen-to-square fa-fw"></i> Create child page</a>
66
<a href="https://github.com/protocolbuffers/protocolbuffers.github.io/issues/new?title=News" class=td-page-meta--issue target=_blank rel=noopener><i class="fa-solid fa-list-check fa-fw"></i> Create documentation issue</a>
77
<a href=https://github.com/protocolbuffers/protobuf/issues/new class=td-page-meta--project-issue target=_blank rel=noopener><i class="fa-solid fa-list-check fa-fw"></i> Create project issue</a></div></aside><main class="col-12 col-md-9 col-xl-8 pl-md-5" role=main><nav aria-label=breadcrumb class="td-breadcrumbs td-breadcrumbs__single"><ol class=breadcrumb><li class="breadcrumb-item active" aria-current=page><a href=https://protobuf.dev/news/ aria-disabled=true class="btn-link disabled">News</a></li></ol></nav><div class=td-content><h1>News</h1><div class=lead>Get the latest news about Protocol Buffers.</div><header class=article-meta></header><p>News topics provide information about past events and changes with Protocol
8-
Buffers, and plans for upcoming changes.</p><ul><li><a href=/news/2023-04-20>April 20, 2023</a> - Update to Ruby
8+
Buffers, and plans for upcoming changes.</p><ul><li><a href=/news/2023-04-28>April 28, 2023</a> - Null no longer
9+
allowed in <code>json_name</code> field options</li><li><a href=/news/2023-04-20>April 20, 2023</a> - Update to Ruby
910
code generator</li><li><a href=/news/2023-04-11>April 11, 2023</a> - Removing syntax
10-
reflection, releasing C++ CORD support for singular bytes fields to OSS,
11+
reflection, releasing C++ CORD support for singular <code>bytes</code> fields to OSS,
1112
option retention, and dropping support for Bazel &lt;5.3</li><li><a href=/news/2022-08-03>August 3, 2022</a> - Platform Support
1213
Changes and Upcoming Changes in the C++ 22.x Line</li><li><a href=/news/2022-07-06>July 6, 2022</a> - Library Breaking
1314
Change Policy</li><li><a href=/news/2022-05-06>May 6, 2022</a> - Versioning, Python

overview/index.html

Lines changed: 7 additions & 6 deletions
Large diffs are not rendered by default.

programming-guides/encoding/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@
8484
</span></span></span><span style=display:flex><span><span style=color:#a40000></span><span style=color:#0000cf;font-weight:700>11111111</span> <span style=color:#0000cf;font-weight:700>11111111</span> <span style=color:#0000cf;font-weight:700>11111111</span> <span style=color:#0000cf;font-weight:700>11111111</span> <span style=color:#0000cf;font-weight:700>00000001</span><span style=color:#a40000>
8585
</span></span></span></code></pre></div><p>This is the <em>two&rsquo;s complement</em> of 2, defined in unsigned arithmetic as <code>~0 - 2 + 1</code>, where <code>~0</code> is the all-ones 64-bit integer. It is a useful exercise to
8686
understand why this produces so many ones.</p><p><code>sintN</code> uses the &ldquo;ZigZag&rdquo; encoding instead of two&rsquo;s complement to encode
87-
negative integers. Positive integers <code>n</code> are encoded as <code>2 * n</code> (the even
88-
numbers), while negative integers <code>-n</code> are encoded as <code>2 * n + 1</code> (the odd
87+
negative integers. Positive integers <code>p</code> are encoded as <code>2 * p</code> (the even
88+
numbers), while negative integers <code>n</code> are encoded as <code>2 * |n| - 1</code> (the odd
8989
numbers). The encoding thus &ldquo;zig-zags&rdquo; between positive and negative numbers.
9090
For example:</p><table><thead><tr><th>Signed Original</th><th>Encoded As</th></tr></thead><tbody><tr><td>0</td><td>0</td></tr><tr><td>-1</td><td>1</td></tr><tr><td>1</td><td>2</td></tr><tr><td>-2</td><td>3</td></tr><tr><td>&mldr;</td><td>&mldr;</td></tr><tr><td>0x7fffffff</td><td>0xfffffffe</td></tr><tr><td>-0x80000000</td><td>0xffffffff</td></tr></tbody></table><p>Using some bit tricks, it&rsquo;s cheap to convert <code>n</code> into its ZigZag representation:</p><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-fallback data-lang=fallback><span style=display:flex><span>((n + n) ^ -(n &lt; 0)) - (n &lt; 0)
9191
</span></span></code></pre></div><p>Here, we assume that the boolean <code>n &lt; 0</code> is converted into an integer 1 if true
9292
or an integer 0 if false.</p><p>When the <code>sint32</code> or <code>sint64</code> is parsed, its value is decoded back to the
9393
original, signed version.</p><p>In protoscope, suffixing an integer with a <code>z</code> will make it encode as ZigZag.
94-
For example, <code>-500z</code> is the same as the varint <code>1001</code>.</p><h3 id=non-varint-numbers>Non-varint Numbers</h3><p>Non-varint numeric types are simple &ndash; <code>double</code> and <code>fixed64</code> have wire type
94+
For example, <code>-500z</code> is the same as the varint <code>999</code>.</p><h3 id=non-varint-numbers>Non-varint Numbers</h3><p>Non-varint numeric types are simple &ndash; <code>double</code> and <code>fixed64</code> have wire type
9595
<code>I64</code>, which tells the parser to expect a fixed eight-byte lump of data. We can
9696
specify a <code>double</code> record by writing <code>5: 25.4</code>, or a <code>fixed64</code> record with <code>6: 200i64</code>. In both cases, omitting an explicit wire type infers the <code>I64</code> wire
9797
type.</p><p>Similarly <code>float</code> and <code>fixed32</code> have wire type <code>I32</code>, which tells it to expect

programming-guides/proto2/index.html

Lines changed: 55 additions & 10 deletions
Large diffs are not rendered by default.

programming-guides/proto3/index.html

Lines changed: 65 additions & 24 deletions
Large diffs are not rendered by default.

reference/cpp/cpp-generated/index.html

Lines changed: 31 additions & 15 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)