protoc 26.1.0 → 27.0.0-rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  protoc
2
2
  ======
3
3
 
4
- This package provides the Protobuf compiler `protoc` <!-- inject: release.tag_name -->v26.1<!-- end -->.
4
+ This package provides the Protobuf compiler `protoc` <!-- inject: release.tag_name -->v27.0-rc2<!-- end -->.
5
5
 
6
6
  ```shell script
7
7
  npm install --save-dev protoc
package/assets.json CHANGED
@@ -1,39 +1,39 @@
1
1
  [
2
2
  {
3
- "name": "protoc-26.1-linux-aarch_64.zip",
4
- "browser_download_url": "https://github.com/protocolbuffers/protobuf/releases/download/v26.1/protoc-26.1-linux-aarch_64.zip",
3
+ "name": "protoc-27.0-rc-2-linux-aarch_64.zip",
4
+ "browser_download_url": "https://github.com/protocolbuffers/protobuf/releases/download/v27.0-rc2/protoc-27.0-rc-2-linux-aarch_64.zip",
5
5
  "platform": "linux",
6
6
  "arch": "arm64",
7
7
  "dotExe": false,
8
8
  "executable": "protoc-linux-aarch_64"
9
9
  },
10
10
  {
11
- "name": "protoc-26.1-linux-x86_64.zip",
12
- "browser_download_url": "https://github.com/protocolbuffers/protobuf/releases/download/v26.1/protoc-26.1-linux-x86_64.zip",
11
+ "name": "protoc-27.0-rc-2-linux-x86_64.zip",
12
+ "browser_download_url": "https://github.com/protocolbuffers/protobuf/releases/download/v27.0-rc2/protoc-27.0-rc-2-linux-x86_64.zip",
13
13
  "platform": "linux",
14
14
  "arch": "x64",
15
15
  "dotExe": false,
16
16
  "executable": "protoc-linux-x86_64"
17
17
  },
18
18
  {
19
- "name": "protoc-26.1-osx-aarch_64.zip",
20
- "browser_download_url": "https://github.com/protocolbuffers/protobuf/releases/download/v26.1/protoc-26.1-osx-aarch_64.zip",
19
+ "name": "protoc-27.0-rc-2-osx-aarch_64.zip",
20
+ "browser_download_url": "https://github.com/protocolbuffers/protobuf/releases/download/v27.0-rc2/protoc-27.0-rc-2-osx-aarch_64.zip",
21
21
  "platform": "darwin",
22
22
  "arch": "arm64",
23
23
  "dotExe": false,
24
24
  "executable": "protoc-osx-aarch_64"
25
25
  },
26
26
  {
27
- "name": "protoc-26.1-osx-x86_64.zip",
28
- "browser_download_url": "https://github.com/protocolbuffers/protobuf/releases/download/v26.1/protoc-26.1-osx-x86_64.zip",
27
+ "name": "protoc-27.0-rc-2-osx-x86_64.zip",
28
+ "browser_download_url": "https://github.com/protocolbuffers/protobuf/releases/download/v27.0-rc2/protoc-27.0-rc-2-osx-x86_64.zip",
29
29
  "platform": "darwin",
30
30
  "arch": "x64",
31
31
  "dotExe": false,
32
32
  "executable": "protoc-osx-x86_64"
33
33
  },
34
34
  {
35
- "name": "protoc-26.1-win64.zip",
36
- "browser_download_url": "https://github.com/protocolbuffers/protobuf/releases/download/v26.1/protoc-26.1-win64.zip",
35
+ "name": "protoc-27.0-rc-2-win64.zip",
36
+ "browser_download_url": "https://github.com/protocolbuffers/protobuf/releases/download/v27.0-rc2/protoc-27.0-rc-2-win64.zip",
37
37
  "platform": "win32",
38
38
  "arch": "x64",
39
39
  "dotExe": true,
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -24,7 +24,35 @@ message CppFeatures {
24
24
  retention = RETENTION_RUNTIME,
25
25
  targets = TARGET_TYPE_FIELD,
26
26
  targets = TARGET_TYPE_FILE,
27
+ // TODO Enable this in google3 once protoc rolls out.
28
+ feature_support = {
29
+ edition_introduced: EDITION_2023,
30
+ edition_deprecated: EDITION_2023,
31
+ deprecation_warning: "The legacy closed enum treatment in C++ is "
32
+ "deprecated and is scheduled to be removed in "
33
+ "edition 2025. Mark enum type on the enum "
34
+ "definitions themselves rather than on fields.",
35
+ },
27
36
  edition_defaults = { edition: EDITION_PROTO2, value: "true" },
28
37
  edition_defaults = { edition: EDITION_PROTO3, value: "false" }
29
38
  ];
39
+
40
+ enum StringType {
41
+ STRING_TYPE_UNKNOWN = 0;
42
+ VIEW = 1;
43
+ CORD = 2;
44
+ STRING = 3;
45
+ }
46
+
47
+ optional StringType string_type = 2 [
48
+ retention = RETENTION_RUNTIME,
49
+ targets = TARGET_TYPE_FIELD,
50
+ targets = TARGET_TYPE_FILE,
51
+ // TODO Enable this in google3 once protoc rolls out.
52
+ feature_support = {
53
+ edition_introduced: EDITION_2023,
54
+ },
55
+ edition_defaults = { edition: EDITION_PROTO2, value: "STRING" },
56
+ edition_defaults = { edition: EDITION_2024, value: "VIEW" }
57
+ ];
30
58
  }
@@ -62,6 +62,10 @@ enum Edition {
62
62
  // A placeholder for an unknown edition value.
63
63
  EDITION_UNKNOWN = 0;
64
64
 
65
+ // A placeholder edition for specifying default behaviors *before* a feature
66
+ // was first introduced. This is effectively an "infinite past".
67
+ EDITION_LEGACY = 900;
68
+
65
69
  // Legacy syntax "editions". These pre-date editions, but behave much like
66
70
  // distinct editions. These can't be used to specify the edition of proto
67
71
  // files, but feature definitions must supply proto2/proto3 defaults for
@@ -448,12 +452,16 @@ message FileOptions {
448
452
  // This option does nothing.
449
453
  optional bool java_generate_equals_and_hash = 20 [deprecated=true];
450
454
 
451
- // If set true, then the Java2 code generator will generate code that
452
- // throws an exception whenever an attempt is made to assign a non-UTF-8
453
- // byte sequence to a string field.
454
- // Message reflection will do the same.
455
- // However, an extension field still accepts non-UTF-8 byte sequences.
456
- // This option has no effect on when used with the lite runtime.
455
+ // A proto2 file can set this to true to opt in to UTF-8 checking for Java,
456
+ // which will throw an exception if invalid UTF-8 is parsed from the wire or
457
+ // assigned to a string field.
458
+ //
459
+ // TODO: clarify exactly what kinds of field types this option
460
+ // applies to, and update these docs accordingly.
461
+ //
462
+ // Proto3 files already perform these checks. Setting the option explicitly to
463
+ // false has no effect: it cannot be used to opt proto3 files out of UTF-8
464
+ // checks.
457
465
  optional bool java_string_check_utf8 = 27 [default = false];
458
466
 
459
467
  // Generated classes can be optimized for speed or code size.
@@ -760,6 +768,28 @@ message FieldOptions {
760
768
  // Any features defined in the specific edition.
761
769
  optional FeatureSet features = 21;
762
770
 
771
+ // Information about the support window of a feature.
772
+ message FeatureSupport {
773
+ // The edition that this feature was first available in. In editions
774
+ // earlier than this one, the default assigned to EDITION_LEGACY will be
775
+ // used, and proto files will not be able to override it.
776
+ optional Edition edition_introduced = 1;
777
+
778
+ // The edition this feature becomes deprecated in. Using this after this
779
+ // edition may trigger warnings.
780
+ optional Edition edition_deprecated = 2;
781
+
782
+ // The deprecation warning text if this feature is used after the edition it
783
+ // was marked deprecated in.
784
+ optional string deprecation_warning = 3;
785
+
786
+ // The edition this feature is no longer available in. In editions after
787
+ // this one, the last default assigned will be used, and proto files will
788
+ // not be able to override it.
789
+ optional Edition edition_removed = 4;
790
+ }
791
+ optional FeatureSupport feature_support = 22;
792
+
763
793
  // The parser stores options it doesn't recognize here. See above.
764
794
  repeated UninterpretedOption uninterpreted_option = 999;
765
795
 
@@ -940,6 +970,10 @@ message FeatureSet {
940
970
  retention = RETENTION_RUNTIME,
941
971
  targets = TARGET_TYPE_FIELD,
942
972
  targets = TARGET_TYPE_FILE,
973
+ // TODO Enable this in google3 once protoc rolls out.
974
+ feature_support = {
975
+ edition_introduced: EDITION_2023,
976
+ },
943
977
  edition_defaults = { edition: EDITION_PROTO2, value: "EXPLICIT" },
944
978
  edition_defaults = { edition: EDITION_PROTO3, value: "IMPLICIT" },
945
979
  edition_defaults = { edition: EDITION_2023, value: "EXPLICIT" }
@@ -954,6 +988,10 @@ message FeatureSet {
954
988
  retention = RETENTION_RUNTIME,
955
989
  targets = TARGET_TYPE_ENUM,
956
990
  targets = TARGET_TYPE_FILE,
991
+ // TODO Enable this in google3 once protoc rolls out.
992
+ feature_support = {
993
+ edition_introduced: EDITION_2023,
994
+ },
957
995
  edition_defaults = { edition: EDITION_PROTO2, value: "CLOSED" },
958
996
  edition_defaults = { edition: EDITION_PROTO3, value: "OPEN" }
959
997
  ];
@@ -967,6 +1005,10 @@ message FeatureSet {
967
1005
  retention = RETENTION_RUNTIME,
968
1006
  targets = TARGET_TYPE_FIELD,
969
1007
  targets = TARGET_TYPE_FILE,
1008
+ // TODO Enable this in google3 once protoc rolls out.
1009
+ feature_support = {
1010
+ edition_introduced: EDITION_2023,
1011
+ },
970
1012
  edition_defaults = { edition: EDITION_PROTO2, value: "EXPANDED" },
971
1013
  edition_defaults = { edition: EDITION_PROTO3, value: "PACKED" }
972
1014
  ];
@@ -980,6 +1022,10 @@ message FeatureSet {
980
1022
  retention = RETENTION_RUNTIME,
981
1023
  targets = TARGET_TYPE_FIELD,
982
1024
  targets = TARGET_TYPE_FILE,
1025
+ // TODO Enable this in google3 once protoc rolls out.
1026
+ feature_support = {
1027
+ edition_introduced: EDITION_2023,
1028
+ },
983
1029
  edition_defaults = { edition: EDITION_PROTO2, value: "NONE" },
984
1030
  edition_defaults = { edition: EDITION_PROTO3, value: "VERIFY" }
985
1031
  ];
@@ -993,6 +1039,10 @@ message FeatureSet {
993
1039
  retention = RETENTION_RUNTIME,
994
1040
  targets = TARGET_TYPE_FIELD,
995
1041
  targets = TARGET_TYPE_FILE,
1042
+ // TODO Enable this in google3 once protoc rolls out.
1043
+ feature_support = {
1044
+ edition_introduced: EDITION_2023,
1045
+ },
996
1046
  edition_defaults = { edition: EDITION_PROTO2, value: "LENGTH_PREFIXED" }
997
1047
  ];
998
1048
 
@@ -1006,6 +1056,10 @@ message FeatureSet {
1006
1056
  targets = TARGET_TYPE_MESSAGE,
1007
1057
  targets = TARGET_TYPE_ENUM,
1008
1058
  targets = TARGET_TYPE_FILE,
1059
+ // TODO Enable this in google3 once protoc rolls out.
1060
+ feature_support = {
1061
+ edition_introduced: EDITION_2023,
1062
+ },
1009
1063
  edition_defaults = { edition: EDITION_PROTO2, value: "LEGACY_BEST_EFFORT" },
1010
1064
  edition_defaults = { edition: EDITION_PROTO3, value: "ALLOW" }
1011
1065
  ];
@@ -1016,6 +1070,8 @@ message FeatureSet {
1016
1070
  extensions 1001; // for Protobuf Java
1017
1071
  extensions 1002; // for Protobuf Go
1018
1072
 
1073
+ extensions 9990; // for deprecated Java Proto1
1074
+
1019
1075
  extensions 9995 to 9999; // For internal testing
1020
1076
  extensions 10000; // for https://github.com/bufbuild/protobuf-es
1021
1077
  }
@@ -1031,7 +1087,12 @@ message FeatureSetDefaults {
1031
1087
  // be used. This field must be in strict ascending order by edition.
1032
1088
  message FeatureSetEditionDefault {
1033
1089
  optional Edition edition = 3;
1034
- optional FeatureSet features = 2;
1090
+
1091
+ // Defaults of features that can be overridden in this edition.
1092
+ optional FeatureSet overridable_features = 4;
1093
+
1094
+ // Defaults of features that can't be overridden in this edition.
1095
+ optional FeatureSet fixed_features = 5;
1035
1096
  }
1036
1097
  repeated FeatureSetEditionDefault defaults = 1;
1037
1098
 
@@ -27,6 +27,15 @@ message JavaFeatures {
27
27
  retention = RETENTION_RUNTIME,
28
28
  targets = TARGET_TYPE_FIELD,
29
29
  targets = TARGET_TYPE_FILE,
30
+ // TODO Enable this in google3 once protoc rolls out.
31
+ feature_support = {
32
+ edition_introduced: EDITION_2023,
33
+ edition_deprecated: EDITION_2023,
34
+ deprecation_warning: "The legacy closed enum treatment in Java is "
35
+ "deprecated and is scheduled to be removed in "
36
+ "edition 2025. Mark enum type on the enum "
37
+ "definitions themselves rather than on fields.",
38
+ },
30
39
  edition_defaults = { edition: EDITION_PROTO2, value: "true" },
31
40
  edition_defaults = { edition: EDITION_PROTO3, value: "false" }
32
41
  ];
@@ -47,6 +56,16 @@ message JavaFeatures {
47
56
  retention = RETENTION_RUNTIME,
48
57
  targets = TARGET_TYPE_FIELD,
49
58
  targets = TARGET_TYPE_FILE,
59
+ // TODO Enable this in google3 once protoc rolls out.
60
+ feature_support = {
61
+ edition_introduced: EDITION_2023,
62
+ edition_deprecated: EDITION_2023,
63
+ deprecation_warning: "The Java-specific utf8 validation feature is "
64
+ "deprecated and is scheduled to be removed in "
65
+ "edition 2025. Utf8 validation behavior should "
66
+ "use the global cross-language utf8_validation "
67
+ "feature.",
68
+ },
50
69
  edition_defaults = { edition: EDITION_PROTO2, value: "DEFAULT" }
51
70
  ];
52
71
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "protoc",
3
- "version": "26.1.0",
4
- "upstreamVersion": "v26.1",
3
+ "version": "27.0.0-rc2",
4
+ "upstreamVersion": "v27.0-rc2",
5
5
  "description": "Installs the protocol buffer compiler \"protoc\" for you.",
6
6
  "bin": {
7
7
  "protoc": "protoc.cjs"