Skip to content

Commit

Permalink
deps: bump @bufbuild/protobuf from 1.10.0 to 2.0.0 (#139)
Browse files Browse the repository at this point in the history
* deps: bump @bufbuild/protobuf from 1.10.0 to 2.0.0

Bumps [@bufbuild/protobuf](https://github.com/bufbuild/protobuf-es/tree/HEAD/packages/protobuf) from 1.10.0 to 2.0.0.
- [Release notes](https://github.com/bufbuild/protobuf-es/releases)
- [Commits](https://github.com/bufbuild/protobuf-es/commits/v2.0.0/packages/protobuf)

---
updated-dependencies:
- dependency-name: "@bufbuild/protobuf"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore: update protobuf-es code

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex Potsides <[email protected]>
  • Loading branch information
dependabot[bot] and achingbrain authored Aug 7, 2024
1 parent b7de3e4 commit bbe93a2
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 177 deletions.
2 changes: 1 addition & 1 deletion packages/protons-benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"start:browser": "npx playwright-test dist/src/implementations/index.js --runner benchmark"
},
"dependencies": {
"@bufbuild/protobuf": "^1.0.0",
"@bufbuild/protobuf": "^2.0.0",
"@bufbuild/protoc-gen-es": "^2.0.0",
"@protobuf-ts/plugin": "^2.8.1",
"@protobuf-ts/runtime": "^2.8.1",
Expand Down
7 changes: 4 additions & 3 deletions packages/protons-benchmark/src/implementations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ $ node dist/src/index.js
$ npx playwright-test dist/src/index.js --runner benchmark
*/

import { create, toBinary, fromBinary } from '@bufbuild/protobuf'
import { expect } from 'aegir/chai'
import Benchmark from 'benchmark'
import { encodeTest as pbjsEncodeTest, decodeTest as pbjsDecodeTest } from './pbjs/bench.js'
import { Test as ProtobufEsTest } from './protobuf-es/bench_pb.js'
import { TestSchema as ProtobufEsTest } from './protobuf-es/bench_pb.js'
import { Test as ProtobufTsTest } from './protobuf-ts/bench.js'
import { Test as ProtobufjsTest } from './protobufjs/bench.js'
import { Test as ProtonsTest } from './protons/bench.js'
Expand Down Expand Up @@ -61,8 +62,8 @@ new Benchmark.Suite()
expectDecodedCorrectly(result)
})
.add('protobuf-es', () => {
const buf = new ProtobufEsTest(message).toBinary()
const result = ProtobufEsTest.fromBinary(buf)
const buf = toBinary(ProtobufEsTest, create(ProtobufEsTest, message))
const result = fromBinary(ProtobufEsTest, buf)

expectDecodedCorrectly(result)
})
Expand Down
248 changes: 75 additions & 173 deletions packages/protons-benchmark/src/implementations/protobuf-es/bench_pb.ts
Original file line number Diff line number Diff line change
@@ -1,152 +1,72 @@
// @generated by protoc-gen-es v1.0.0 with parameter "target=ts"
// @generated from file bench.proto (syntax proto3)
// @generated by protoc-gen-es v2.0.0 with parameter "target=ts"
// @generated from file packages/protons-benchmark/src/implementations/bench.proto (syntax proto3)
/* eslint-disable */
// @ts-nocheck

import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
import { Message, proto3 } from "@bufbuild/protobuf";
import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1";
import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1";
import type { Message } from "@bufbuild/protobuf";

/**
* @generated from enum FOO
* Describes the file packages/protons-benchmark/src/implementations/bench.proto.
*/
export enum FOO {
/**
* @generated from enum value: NONE = 0;
*/
NONE = 0,

/**
* @generated from enum value: LOL = 1;
*/
LOL = 1,

/**
* @generated from enum value: ABE = 3;
*/
ABE = 3,
}
// Retrieve enum metadata with: proto3.getEnumType(FOO)
proto3.util.setEnumType(FOO, "FOO", [
{ no: 0, name: "NONE" },
{ no: 1, name: "LOL" },
{ no: 3, name: "ABE" },
]);
export const file_packages_protons_benchmark_src_implementations_bench: GenFile = /*@__PURE__*/
fileDesc("CjpwYWNrYWdlcy9wcm90b25zLWJlbmNobWFyay9zcmMvaW1wbGVtZW50YXRpb25zL2JlbmNoLnByb3RvIh8KA0ZvbxIQCgNiYXoYASABKA1IAIgBAUIGCgRfYmF6IiUKA0JhchIWCgN0bXAYASABKAsyBC5Gb29IAIgBAUIGCgRfdG1wIhcKAllvEhEKA2xvbBgBIAMoDjIELkZPTyIwCgNMb2wSEAoDbG9sGAEgASgJSACIAQESDwoBYhgCIAEoCzIELkJhckIGCgRfbG9sIoABCgRUZXN0EhYKA21laBgGIAEoCzIELkxvbEgAiAEBEhIKBWhlbGxvGAMgASgNSAGIAQESEAoDZm9vGAEgASgJSAKIAQESFAoHcGF5bG9hZBgHIAEoDEgDiAEBQgYKBF9tZWhCCAoGX2hlbGxvQgYKBF9mb29CCgoIX3BheWxvYWQqIQoDRk9PEggKBE5PTkUQABIHCgNMT0wQARIHCgNBQkUQA2IGcHJvdG8z");

/**
* @generated from message Foo
*/
export class Foo extends Message<Foo> {
export type Foo = Message<"Foo"> & {
/**
* @generated from field: optional uint32 baz = 1;
*/
baz?: number;
};

constructor(data?: PartialMessage<Foo>) {
super();
proto3.util.initPartial(data, this);
}

static readonly runtime = proto3;
static readonly typeName = "Foo";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "baz", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true },
]);

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Foo {
return new Foo().fromBinary(bytes, options);
}

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Foo {
return new Foo().fromJson(jsonValue, options);
}

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Foo {
return new Foo().fromJsonString(jsonString, options);
}

static equals(a: Foo | PlainMessage<Foo> | undefined, b: Foo | PlainMessage<Foo> | undefined): boolean {
return proto3.util.equals(Foo, a, b);
}
}
/**
* Describes the message Foo.
* Use `create(FooSchema)` to create a new message.
*/
export const FooSchema: GenMessage<Foo> = /*@__PURE__*/
messageDesc(file_packages_protons_benchmark_src_implementations_bench, 0);

/**
* @generated from message Bar
*/
export class Bar extends Message<Bar> {
export type Bar = Message<"Bar"> & {
/**
* @generated from field: optional Foo tmp = 1;
*/
tmp?: Foo;
};

constructor(data?: PartialMessage<Bar>) {
super();
proto3.util.initPartial(data, this);
}

static readonly runtime = proto3;
static readonly typeName = "Bar";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "tmp", kind: "message", T: Foo, opt: true },
]);

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Bar {
return new Bar().fromBinary(bytes, options);
}

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Bar {
return new Bar().fromJson(jsonValue, options);
}

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Bar {
return new Bar().fromJsonString(jsonString, options);
}

static equals(a: Bar | PlainMessage<Bar> | undefined, b: Bar | PlainMessage<Bar> | undefined): boolean {
return proto3.util.equals(Bar, a, b);
}
}
/**
* Describes the message Bar.
* Use `create(BarSchema)` to create a new message.
*/
export const BarSchema: GenMessage<Bar> = /*@__PURE__*/
messageDesc(file_packages_protons_benchmark_src_implementations_bench, 1);

/**
* @generated from message Yo
*/
export class Yo extends Message<Yo> {
export type Yo = Message<"Yo"> & {
/**
* @generated from field: repeated FOO lol = 1;
*/
lol: FOO[] = [];

constructor(data?: PartialMessage<Yo>) {
super();
proto3.util.initPartial(data, this);
}

static readonly runtime = proto3;
static readonly typeName = "Yo";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "lol", kind: "enum", T: proto3.getEnumType(FOO), repeated: true },
]);

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Yo {
return new Yo().fromBinary(bytes, options);
}

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Yo {
return new Yo().fromJson(jsonValue, options);
}

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Yo {
return new Yo().fromJsonString(jsonString, options);
}

static equals(a: Yo | PlainMessage<Yo> | undefined, b: Yo | PlainMessage<Yo> | undefined): boolean {
return proto3.util.equals(Yo, a, b);
}
}
lol: FOO[];
};

/**
* Describes the message Yo.
* Use `create(YoSchema)` to create a new message.
*/
export const YoSchema: GenMessage<Yo> = /*@__PURE__*/
messageDesc(file_packages_protons_benchmark_src_implementations_bench, 2);

/**
* @generated from message Lol
*/
export class Lol extends Message<Lol> {
export type Lol = Message<"Lol"> & {
/**
* @generated from field: optional string lol = 1;
*/
Expand All @@ -156,40 +76,19 @@ export class Lol extends Message<Lol> {
* @generated from field: Bar b = 2;
*/
b?: Bar;
};

constructor(data?: PartialMessage<Lol>) {
super();
proto3.util.initPartial(data, this);
}

static readonly runtime = proto3;
static readonly typeName = "Lol";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "lol", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
{ no: 2, name: "b", kind: "message", T: Bar },
]);

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Lol {
return new Lol().fromBinary(bytes, options);
}

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Lol {
return new Lol().fromJson(jsonValue, options);
}

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Lol {
return new Lol().fromJsonString(jsonString, options);
}

static equals(a: Lol | PlainMessage<Lol> | undefined, b: Lol | PlainMessage<Lol> | undefined): boolean {
return proto3.util.equals(Lol, a, b);
}
}
/**
* Describes the message Lol.
* Use `create(LolSchema)` to create a new message.
*/
export const LolSchema: GenMessage<Lol> = /*@__PURE__*/
messageDesc(file_packages_protons_benchmark_src_implementations_bench, 3);

/**
* @generated from message Test
*/
export class Test extends Message<Test> {
export type Test = Message<"Test"> & {
/**
* @generated from field: optional Lol meh = 6;
*/
Expand All @@ -209,35 +108,38 @@ export class Test extends Message<Test> {
* @generated from field: optional bytes payload = 7;
*/
payload?: Uint8Array;
};

/**
* Describes the message Test.
* Use `create(TestSchema)` to create a new message.
*/
export const TestSchema: GenMessage<Test> = /*@__PURE__*/
messageDesc(file_packages_protons_benchmark_src_implementations_bench, 4);

/**
* @generated from enum FOO
*/
export enum FOO {
/**
* @generated from enum value: NONE = 0;
*/
NONE = 0,

/**
* @generated from enum value: LOL = 1;
*/
LOL = 1,

constructor(data?: PartialMessage<Test>) {
super();
proto3.util.initPartial(data, this);
}

static readonly runtime = proto3;
static readonly typeName = "Test";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 6, name: "meh", kind: "message", T: Lol, opt: true },
{ no: 3, name: "hello", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true },
{ no: 1, name: "foo", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
{ no: 7, name: "payload", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true },
]);

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Test {
return new Test().fromBinary(bytes, options);
}

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Test {
return new Test().fromJson(jsonValue, options);
}

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Test {
return new Test().fromJsonString(jsonString, options);
}

static equals(a: Test | PlainMessage<Test> | undefined, b: Test | PlainMessage<Test> | undefined): boolean {
return proto3.util.equals(Test, a, b);
}
/**
* @generated from enum value: ABE = 3;
*/
ABE = 3,
}

/**
* Describes the enum FOO.
*/
export const FOOSchema: GenEnum<FOO> = /*@__PURE__*/
enumDesc(file_packages_protons_benchmark_src_implementations_bench, 0);

0 comments on commit bbe93a2

Please sign in to comment.