diff --git a/bundle-size/README.md b/bundle-size/README.md index 5d32c6042..0b11a1dae 100644 --- a/bundle-size/README.md +++ b/bundle-size/README.md @@ -17,12 +17,16 @@ The results are: | Name | Size | Artifact | |------|-----:|----------| -| esbuild | 82,796 bytes | dist/index.js | -| parcel | 72,685 bytes | dist/index.1756241d.js | -| rollup | 145,459 bytes | dist/index.js | -| vite | 54,732 bytes | dist/consumer-vite.js | -| webpack | 33,817 bytes | dist/main.js | -| webpack-ts | 33,817 bytes | dist/bundle.js | +| esbuild (js) | 83,741 bytes | dist/js/index.js | +| esbuild (ts) | 88,697 bytes | dist/ts/index.js | +| parcel (js) | 73,323 bytes | dist/js/index.cf4251ac.js | +| parcel (ts) | 76,825 bytes | dist/ts/index.dc635180.js | +| rollup (js) | 145,627 bytes | dist/js/index.js | +| rollup (ts) | 155,601 bytes | dist/ts/index.js | +| vite (js) | 55,512 bytes | dist/js/consumer-vite.js | +| vite (ts) | 58,166 bytes | dist/ts/consumer-vite.js | +| webpack (js) | 34,474 bytes | dist/js/main.js | +| webpack (ts) | 37,435 bytes | dist/ts/main.js | To run all tests, and update the table above: diff --git a/bundle-size/README.mjs b/bundle-size/README.mjs index 403898cd7..fa96ab908 100644 --- a/bundle-size/README.mjs +++ b/bundle-size/README.mjs @@ -12,11 +12,13 @@ function getResultsTable() { const fmt = new Intl.NumberFormat("en-US", {}); for (const workspace of workspaces) { const pkgPath = readFileSync(join(workspace, "package.json"), "utf-8"); - const { testOutputPath, name } = JSON.parse(pkgPath); - const testPath = join(workspace, testOutputPath); - const {size} = statSync(testPath); - console.log(`${name}: ${fmt.format(size)} bytes in ${testOutputPath}`); - rows.push(`| ${name.replace(/^consumer-/, "")} | ${fmt.format(size)} bytes | ${testOutputPath} |`) + const { testOutputPaths, name } = JSON.parse(pkgPath); + for (const [type, path] of Object.entries(testOutputPaths)) { + const testPath = join(workspace, path); + const {size} = statSync(testPath); + console.log(`${name} (${type}): ${fmt.format(size)} bytes in ${path}`); + rows.push(`| ${name.replace(/^consumer-/, "")} (${type}) | ${fmt.format(size)} bytes | ${path} |`) + } } return ["", ...rows, ""].join("\n"); } @@ -31,4 +33,4 @@ function injectResults(filePath, content) { const head = fileContent.substring(0, iStart + cStart.length); const foot = fileContent.substring(iEnd); writeFileSync(filePath, head + content + foot); -} \ No newline at end of file +} diff --git a/bundle-size/buf.gen.yaml b/bundle-size/buf.gen.yaml new file mode 100644 index 000000000..0798997ea --- /dev/null +++ b/bundle-size/buf.gen.yaml @@ -0,0 +1,14 @@ +version: v1 +plugins: + - name: es + out: src/js/gen + opt: target=js + - name: connect-es + out: src/js/gen + opt: target=js + - name: es + out: src/ts/gen + opt: target=ts+dts + - name: connect-es + out: src/ts/gen + opt: target=ts+dts diff --git a/bundle-size/esbuild/buf.gen.yaml b/bundle-size/esbuild/buf.gen.yaml deleted file mode 100644 index 21e57da6d..000000000 --- a/bundle-size/esbuild/buf.gen.yaml +++ /dev/null @@ -1,8 +0,0 @@ -version: v1 -plugins: - - name: es - out: src/gen - opt: target=js - - name: connect-es - out: src/gen - opt: target=js diff --git a/bundle-size/esbuild/package.json b/bundle-size/esbuild/package.json index fb938732c..f60cd1f75 100644 --- a/bundle-size/esbuild/package.json +++ b/bundle-size/esbuild/package.json @@ -2,10 +2,18 @@ "name": "consumer-esbuild", "scripts": { "pregenerate": "rm -rf dist", - "generate": "npx buf generate buf.build/connectrpc/eliza", - "build": "esbuild --log-level=error ./src/index.js --bundle --outfile=dist/index.js" + "generate": "npx buf generate ../proto --template ../buf.gen.yaml", + "build": "npm run build:js && npm run build:ts", + "build:js": "esbuild --log-level=error ./src/js/index.js --bundle --outfile=dist/js/index.js", + "build:ts": "esbuild --log-level=error ./src/ts/index.ts --bundle --outfile=dist/ts/index.js", + "test": "npm run test:js && npm run test:ts", + "test:js": "node dist/js/index.js", + "test:ts": "node dist/ts/index.js" + }, + "testOutputPaths": { + "js": "dist/js/index.js", + "ts": "dist/ts/index.js" }, - "testOutputPath": "dist/index.js", "type": "module", "dependencies": { "@connectrpc/connect": "^1.3.0", diff --git a/bundle-size/esbuild/src/index.js b/bundle-size/esbuild/src/index.js deleted file mode 100644 index edc7a135e..000000000 --- a/bundle-size/esbuild/src/index.js +++ /dev/null @@ -1,5 +0,0 @@ -import {compressedFlag} from "@connectrpc/connect/protocol" -import {SayRequest} from "./gen/connectrpc/eliza/v1/eliza_pb.js"; - -console.log(compressedFlag); -console.log(SayRequest); diff --git a/bundle-size/esbuild/src/gen/connectrpc/eliza/v1/eliza_connect.js b/bundle-size/esbuild/src/js/gen/connectrpc/eliza/v1/eliza_connect.js similarity index 100% rename from bundle-size/esbuild/src/gen/connectrpc/eliza/v1/eliza_connect.js rename to bundle-size/esbuild/src/js/gen/connectrpc/eliza/v1/eliza_connect.js diff --git a/bundle-size/parcel/src/gen/connectrpc/eliza/v1/eliza_pb.js b/bundle-size/esbuild/src/js/gen/connectrpc/eliza/v1/eliza_pb.js similarity index 76% rename from bundle-size/parcel/src/gen/connectrpc/eliza/v1/eliza_pb.js rename to bundle-size/esbuild/src/js/gen/connectrpc/eliza/v1/eliza_pb.js index edf8ada35..8afe1053a 100644 --- a/bundle-size/parcel/src/gen/connectrpc/eliza/v1/eliza_pb.js +++ b/bundle-size/esbuild/src/js/gen/connectrpc/eliza/v1/eliza_pb.js @@ -19,6 +19,30 @@ import { proto3 } from "@bufbuild/protobuf"; +/** + * @generated from enum connectrpc.eliza.v1.SayVolume + */ +export const SayVolume = proto3.makeEnum( + "connectrpc.eliza.v1.SayVolume", + [ + {no: 0, name: "SAY_VOLUME_UNSPECIFIED", localName: "UNSPECIFIED"}, + {no: 1, name: "SAY_VOLUME_LOUD", localName: "LOUD"}, + {no: 2, name: "SAY_VOLUME_SOFT", localName: "SOFT"}, + ], +); + +/** + * @generated from enum connectrpc.eliza.v1.ConverseVolume + */ +export const ConverseVolume = proto3.makeEnum( + "connectrpc.eliza.v1.ConverseVolume", + [ + {no: 0, name: "CONVERSE_VOLUME_UNSPECIFIED", localName: "UNSPECIFIED"}, + {no: 1, name: "CONVERSE_VOLUME_LOUD", localName: "LOUD"}, + {no: 2, name: "CONVERSE_VOLUME_SOFT", localName: "SOFT"}, + ], +); + /** * SayRequest is a single-sentence request. * @@ -28,6 +52,7 @@ export const SayRequest = proto3.makeMessageType( "connectrpc.eliza.v1.SayRequest", () => [ { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "volume", kind: "enum", T: proto3.getEnumType(SayVolume) }, ], ); @@ -53,6 +78,7 @@ export const ConverseRequest = proto3.makeMessageType( "connectrpc.eliza.v1.ConverseRequest", () => [ { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "volume", kind: "enum", T: proto3.getEnumType(ConverseVolume) }, ], ); diff --git a/bundle-size/esbuild/src/js/index.js b/bundle-size/esbuild/src/js/index.js new file mode 100644 index 000000000..255bf6791 --- /dev/null +++ b/bundle-size/esbuild/src/js/index.js @@ -0,0 +1,13 @@ +import { compressedFlag } from "@connectrpc/connect/protocol"; +import { SayRequest, SayVolume } from "./gen/connectrpc/eliza/v1/eliza_pb.js"; +import { proto3 } from "@bufbuild/protobuf"; + +const testEnum = proto3.getEnumType(SayVolume); + +if ( + compressedFlag === 1 && + SayRequest.typeName === "connectrpc.eliza.v1.SayRequest" && + testEnum.typeName === "connectrpc.eliza.v1.SayVolume" +) { + console.log("esbuild (js) OK"); +} diff --git a/bundle-size/esbuild/src/ts/gen/connectrpc/eliza/v1/eliza_connect.d.ts b/bundle-size/esbuild/src/ts/gen/connectrpc/eliza/v1/eliza_connect.d.ts new file mode 100644 index 000000000..1e5282a6c --- /dev/null +++ b/bundle-size/esbuild/src/ts/gen/connectrpc/eliza/v1/eliza_connect.d.ts @@ -0,0 +1,75 @@ +// Copyright 2022-2023 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-connect-es v1.3.0 with parameter "target=ts+dts" +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { ConverseRequest, ConverseResponse, IntroduceRequest, IntroduceResponse, SayRequest, SayResponse } from "./eliza_pb.js"; +import { MethodIdempotency, MethodKind } from "@bufbuild/protobuf"; + +/** + * ElizaService provides a way to talk to Eliza, a port of the DOCTOR script + * for Joseph Weizenbaum's original ELIZA program. Created in the mid-1960s at + * the MIT Artificial Intelligence Laboratory, ELIZA demonstrates the + * superficiality of human-computer communication. DOCTOR simulates a + * psychotherapist, and is commonly found as an Easter egg in emacs + * distributions. + * + * @generated from service connectrpc.eliza.v1.ElizaService + */ +export declare const ElizaService: { + readonly typeName: "connectrpc.eliza.v1.ElizaService", + readonly methods: { + /** + * Say is a unary RPC. Eliza responds to the prompt with a single sentence. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Say + */ + readonly say: { + readonly name: "Say", + readonly I: typeof SayRequest, + readonly O: typeof SayResponse, + readonly kind: MethodKind.Unary, + readonly idempotency: MethodIdempotency.NoSideEffects, + }, + /** + * Converse is a bidirectional RPC. The caller may exchange multiple + * back-and-forth messages with Eliza over a long-lived connection. Eliza + * responds to each ConverseRequest with a ConverseResponse. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Converse + */ + readonly converse: { + readonly name: "Converse", + readonly I: typeof ConverseRequest, + readonly O: typeof ConverseResponse, + readonly kind: MethodKind.BiDiStreaming, + }, + /** + * Introduce is a server streaming RPC. Given the caller's name, Eliza + * returns a stream of sentences to introduce itself. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Introduce + */ + readonly introduce: { + readonly name: "Introduce", + readonly I: typeof IntroduceRequest, + readonly O: typeof IntroduceResponse, + readonly kind: MethodKind.ServerStreaming, + }, + } +}; + diff --git a/bundle-size/webpack/src/gen/connectrpc/eliza/v1/eliza_connect.js b/bundle-size/esbuild/src/ts/gen/connectrpc/eliza/v1/eliza_connect.ts similarity index 99% rename from bundle-size/webpack/src/gen/connectrpc/eliza/v1/eliza_connect.js rename to bundle-size/esbuild/src/ts/gen/connectrpc/eliza/v1/eliza_connect.ts index e5a9bffce..193f2f45a 100644 --- a/bundle-size/webpack/src/gen/connectrpc/eliza/v1/eliza_connect.js +++ b/bundle-size/esbuild/src/ts/gen/connectrpc/eliza/v1/eliza_connect.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-connect-es v1.3.0 with parameter "target=js" +// @generated by protoc-gen-connect-es v1.3.0 with parameter "target=ts+dts" // @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -71,5 +71,5 @@ export const ElizaService = { kind: MethodKind.ServerStreaming, }, } -}; +} as const; diff --git a/bundle-size/esbuild/src/ts/gen/connectrpc/eliza/v1/eliza_pb.d.ts b/bundle-size/esbuild/src/ts/gen/connectrpc/eliza/v1/eliza_pb.d.ts new file mode 100644 index 000000000..b50630de8 --- /dev/null +++ b/bundle-size/esbuild/src/ts/gen/connectrpc/eliza/v1/eliza_pb.d.ts @@ -0,0 +1,230 @@ +// Copyright 2022-2023 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-es v1.7.2 with parameter "target=ts+dts" +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from enum connectrpc.eliza.v1.SayVolume + */ +export declare enum SayVolume { + /** + * @generated from enum value: SAY_VOLUME_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: SAY_VOLUME_LOUD = 1; + */ + LOUD = 1, + + /** + * @generated from enum value: SAY_VOLUME_SOFT = 2; + */ + SOFT = 2, +} + +/** + * @generated from enum connectrpc.eliza.v1.ConverseVolume + */ +export declare enum ConverseVolume { + /** + * @generated from enum value: CONVERSE_VOLUME_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: CONVERSE_VOLUME_LOUD = 1; + */ + LOUD = 1, + + /** + * @generated from enum value: CONVERSE_VOLUME_SOFT = 2; + */ + SOFT = 2, +} + +/** + * SayRequest is a single-sentence request. + * + * @generated from message connectrpc.eliza.v1.SayRequest + */ +export declare class SayRequest extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + /** + * @generated from field: connectrpc.eliza.v1.SayVolume volume = 2; + */ + volume: SayVolume; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.SayRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): SayRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): SayRequest; + + static fromJsonString(jsonString: string, options?: Partial): SayRequest; + + static equals(a: SayRequest | PlainMessage | undefined, b: SayRequest | PlainMessage | undefined): boolean; +} + +/** + * SayResponse is a single-sentence response. + * + * @generated from message connectrpc.eliza.v1.SayResponse + */ +export declare class SayResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.SayResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): SayResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): SayResponse; + + static fromJsonString(jsonString: string, options?: Partial): SayResponse; + + static equals(a: SayResponse | PlainMessage | undefined, b: SayResponse | PlainMessage | undefined): boolean; +} + +/** + * ConverseRequest is a single sentence request sent as part of a + * back-and-forth conversation. + * + * @generated from message connectrpc.eliza.v1.ConverseRequest + */ +export declare class ConverseRequest extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + /** + * @generated from field: connectrpc.eliza.v1.ConverseVolume volume = 2; + */ + volume: ConverseVolume; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.ConverseRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): ConverseRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): ConverseRequest; + + static fromJsonString(jsonString: string, options?: Partial): ConverseRequest; + + static equals(a: ConverseRequest | PlainMessage | undefined, b: ConverseRequest | PlainMessage | undefined): boolean; +} + +/** + * ConverseResponse is a single sentence response sent in answer to a + * ConverseRequest. + * + * @generated from message connectrpc.eliza.v1.ConverseResponse + */ +export declare class ConverseResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.ConverseResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): ConverseResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): ConverseResponse; + + static fromJsonString(jsonString: string, options?: Partial): ConverseResponse; + + static equals(a: ConverseResponse | PlainMessage | undefined, b: ConverseResponse | PlainMessage | undefined): boolean; +} + +/** + * IntroduceRequest asks Eliza to introduce itself to the named user. + * + * @generated from message connectrpc.eliza.v1.IntroduceRequest + */ +export declare class IntroduceRequest extends Message { + /** + * @generated from field: string name = 1; + */ + name: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.IntroduceRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): IntroduceRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): IntroduceRequest; + + static fromJsonString(jsonString: string, options?: Partial): IntroduceRequest; + + static equals(a: IntroduceRequest | PlainMessage | undefined, b: IntroduceRequest | PlainMessage | undefined): boolean; +} + +/** + * IntroduceResponse is one sentence of Eliza's introductory monologue. + * + * @generated from message connectrpc.eliza.v1.IntroduceResponse + */ +export declare class IntroduceResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.IntroduceResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): IntroduceResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): IntroduceResponse; + + static fromJsonString(jsonString: string, options?: Partial): IntroduceResponse; + + static equals(a: IntroduceResponse | PlainMessage | undefined, b: IntroduceResponse | PlainMessage | undefined): boolean; +} + diff --git a/bundle-size/esbuild/src/ts/gen/connectrpc/eliza/v1/eliza_pb.ts b/bundle-size/esbuild/src/ts/gen/connectrpc/eliza/v1/eliza_pb.ts new file mode 100644 index 000000000..78d081ae0 --- /dev/null +++ b/bundle-size/esbuild/src/ts/gen/connectrpc/eliza/v1/eliza_pb.ts @@ -0,0 +1,322 @@ +// Copyright 2022-2023 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-es v1.7.2 with parameter "target=ts+dts" +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from enum connectrpc.eliza.v1.SayVolume + */ +export enum SayVolume { + /** + * @generated from enum value: SAY_VOLUME_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: SAY_VOLUME_LOUD = 1; + */ + LOUD = 1, + + /** + * @generated from enum value: SAY_VOLUME_SOFT = 2; + */ + SOFT = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(SayVolume) +proto3.util.setEnumType(SayVolume, "connectrpc.eliza.v1.SayVolume", [ + { no: 0, name: "SAY_VOLUME_UNSPECIFIED" }, + { no: 1, name: "SAY_VOLUME_LOUD" }, + { no: 2, name: "SAY_VOLUME_SOFT" }, +]); + +/** + * @generated from enum connectrpc.eliza.v1.ConverseVolume + */ +export enum ConverseVolume { + /** + * @generated from enum value: CONVERSE_VOLUME_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: CONVERSE_VOLUME_LOUD = 1; + */ + LOUD = 1, + + /** + * @generated from enum value: CONVERSE_VOLUME_SOFT = 2; + */ + SOFT = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(ConverseVolume) +proto3.util.setEnumType(ConverseVolume, "connectrpc.eliza.v1.ConverseVolume", [ + { no: 0, name: "CONVERSE_VOLUME_UNSPECIFIED" }, + { no: 1, name: "CONVERSE_VOLUME_LOUD" }, + { no: 2, name: "CONVERSE_VOLUME_SOFT" }, +]); + +/** + * SayRequest is a single-sentence request. + * + * @generated from message connectrpc.eliza.v1.SayRequest + */ +export class SayRequest extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + /** + * @generated from field: connectrpc.eliza.v1.SayVolume volume = 2; + */ + volume = SayVolume.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.SayRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "volume", kind: "enum", T: proto3.getEnumType(SayVolume) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SayRequest { + return new SayRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SayRequest { + return new SayRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SayRequest { + return new SayRequest().fromJsonString(jsonString, options); + } + + static equals(a: SayRequest | PlainMessage | undefined, b: SayRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(SayRequest, a, b); + } +} + +/** + * SayResponse is a single-sentence response. + * + * @generated from message connectrpc.eliza.v1.SayResponse + */ +export class SayResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.SayResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SayResponse { + return new SayResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SayResponse { + return new SayResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SayResponse { + return new SayResponse().fromJsonString(jsonString, options); + } + + static equals(a: SayResponse | PlainMessage | undefined, b: SayResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(SayResponse, a, b); + } +} + +/** + * ConverseRequest is a single sentence request sent as part of a + * back-and-forth conversation. + * + * @generated from message connectrpc.eliza.v1.ConverseRequest + */ +export class ConverseRequest extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + /** + * @generated from field: connectrpc.eliza.v1.ConverseVolume volume = 2; + */ + volume = ConverseVolume.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.ConverseRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "volume", kind: "enum", T: proto3.getEnumType(ConverseVolume) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ConverseRequest { + return new ConverseRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ConverseRequest { + return new ConverseRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ConverseRequest { + return new ConverseRequest().fromJsonString(jsonString, options); + } + + static equals(a: ConverseRequest | PlainMessage | undefined, b: ConverseRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ConverseRequest, a, b); + } +} + +/** + * ConverseResponse is a single sentence response sent in answer to a + * ConverseRequest. + * + * @generated from message connectrpc.eliza.v1.ConverseResponse + */ +export class ConverseResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.ConverseResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ConverseResponse { + return new ConverseResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ConverseResponse { + return new ConverseResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ConverseResponse { + return new ConverseResponse().fromJsonString(jsonString, options); + } + + static equals(a: ConverseResponse | PlainMessage | undefined, b: ConverseResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ConverseResponse, a, b); + } +} + +/** + * IntroduceRequest asks Eliza to introduce itself to the named user. + * + * @generated from message connectrpc.eliza.v1.IntroduceRequest + */ +export class IntroduceRequest extends Message { + /** + * @generated from field: string name = 1; + */ + name = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.IntroduceRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): IntroduceRequest { + return new IntroduceRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): IntroduceRequest { + return new IntroduceRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): IntroduceRequest { + return new IntroduceRequest().fromJsonString(jsonString, options); + } + + static equals(a: IntroduceRequest | PlainMessage | undefined, b: IntroduceRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(IntroduceRequest, a, b); + } +} + +/** + * IntroduceResponse is one sentence of Eliza's introductory monologue. + * + * @generated from message connectrpc.eliza.v1.IntroduceResponse + */ +export class IntroduceResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.IntroduceResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): IntroduceResponse { + return new IntroduceResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): IntroduceResponse { + return new IntroduceResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): IntroduceResponse { + return new IntroduceResponse().fromJsonString(jsonString, options); + } + + static equals(a: IntroduceResponse | PlainMessage | undefined, b: IntroduceResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(IntroduceResponse, a, b); + } +} + diff --git a/bundle-size/esbuild/src/ts/index.ts b/bundle-size/esbuild/src/ts/index.ts new file mode 100644 index 000000000..ddeb631a3 --- /dev/null +++ b/bundle-size/esbuild/src/ts/index.ts @@ -0,0 +1,13 @@ +import { compressedFlag } from "@connectrpc/connect/protocol"; +import { SayRequest, SayVolume } from "./gen/connectrpc/eliza/v1/eliza_pb.js"; +import { proto3 } from "@bufbuild/protobuf"; + +const testEnum = proto3.getEnumType(SayVolume); + +if ( + compressedFlag === 1 && + SayRequest.typeName === "connectrpc.eliza.v1.SayRequest" && + testEnum.typeName === "connectrpc.eliza.v1.SayVolume" +) { + console.log("esbuild (ts) OK"); +} diff --git a/bundle-size/package-lock.json b/bundle-size/package-lock.json index 393214550..d903cf14a 100644 --- a/bundle-size/package-lock.json +++ b/bundle-size/package-lock.json @@ -10,10 +10,10 @@ "./parcel", "./rollup", "./vite", - "./webpack", - "./webpack-ts" + "./webpack" ], "devDependencies": { + "prettier": "^3.2.5", "process": "^0.11.10" } }, @@ -846,7 +846,6 @@ "version": "0.3.3", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", - "dev": true, "dependencies": { "@jridgewell/set-array": "^1.0.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -860,7 +859,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", - "dev": true, "engines": { "node": ">=6.0.0" } @@ -869,7 +867,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", - "dev": true, "engines": { "node": ">=6.0.0" } @@ -878,7 +875,6 @@ "version": "0.3.5", "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", - "dev": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.0", "@jridgewell/trace-mapping": "^0.3.9" @@ -887,14 +883,12 @@ "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.15", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.19", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", - "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -2597,11 +2591,35 @@ } } }, + "node_modules/@rollup/plugin-typescript": { + "version": "11.1.6", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-11.1.6.tgz", + "integrity": "sha512-R92yOmIACgYdJ7dJ97p4K69I8gg6IEHt8M7dUBxN3W6nrO8uUxX5ixl0yU/N3aZTi8WhPuICvOHXQvF6FaykAA==", + "dependencies": { + "@rollup/pluginutils": "^5.1.0", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.14.0||^3.0.0||^4.0.0", + "tslib": "*", + "typescript": ">=3.7.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + }, + "tslib": { + "optional": true + } + } + }, "node_modules/@rollup/pluginutils": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", "integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==", - "dev": true, "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^2.0.2", @@ -2851,7 +2869,6 @@ "version": "8.44.3", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.3.tgz", "integrity": "sha512-iM/WfkwAhwmPff3wZuPLYiHX18HI24jU8k1ZSH7P8FHwxTjZ2P6CoX2wnF43oprR+YXJM6UUxATkNvyv/JHd+g==", - "dev": true, "dependencies": { "@types/estree": "*", "@types/json-schema": "*" @@ -2861,7 +2878,6 @@ "version": "3.7.5", "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.5.tgz", "integrity": "sha512-JNvhIEyxVW6EoMIFIvj93ZOywYFatlpu9deeH6eSx6PE3WHYvHaQtmHmQeNw7aA81bYGBPPQqdtBm6b1SsQMmA==", - "dev": true, "dependencies": { "@types/eslint": "*", "@types/estree": "*" @@ -2870,20 +2886,17 @@ "node_modules/@types/estree": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.2.tgz", - "integrity": "sha512-VeiPZ9MMwXjO32/Xu7+OwflfmeoRwkE/qzndw42gGtgJwZopBnzy2gD//NN1+go1mADzkDcqf/KnFRSjTJ8xJA==", - "dev": true + "integrity": "sha512-VeiPZ9MMwXjO32/Xu7+OwflfmeoRwkE/qzndw42gGtgJwZopBnzy2gD//NN1+go1mADzkDcqf/KnFRSjTJ8xJA==" }, "node_modules/@types/json-schema": { "version": "7.0.13", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.13.tgz", - "integrity": "sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ==", - "dev": true + "integrity": "sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ==" }, "node_modules/@types/node": { "version": "20.8.2", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.2.tgz", - "integrity": "sha512-Vvycsc9FQdwhxE3y3DzeIxuEJbWGDsnrxvMADzTDF/lcdR9/K+AQIeAghTQsHtotg/q0j3WEOYS/jQgSdWue3w==", - "dev": true + "integrity": "sha512-Vvycsc9FQdwhxE3y3DzeIxuEJbWGDsnrxvMADzTDF/lcdR9/K+AQIeAghTQsHtotg/q0j3WEOYS/jQgSdWue3w==" }, "node_modules/@types/resolve": { "version": "1.20.2", @@ -2904,7 +2917,6 @@ "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", "integrity": "sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==", - "dev": true, "dependencies": { "@webassemblyjs/helper-numbers": "1.11.6", "@webassemblyjs/helper-wasm-bytecode": "1.11.6" @@ -2913,26 +2925,22 @@ "node_modules/@webassemblyjs/floating-point-hex-parser": { "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", - "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", - "dev": true + "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==" }, "node_modules/@webassemblyjs/helper-api-error": { "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", - "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", - "dev": true + "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==" }, "node_modules/@webassemblyjs/helper-buffer": { "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz", - "integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==", - "dev": true + "integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==" }, "node_modules/@webassemblyjs/helper-numbers": { "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", - "dev": true, "dependencies": { "@webassemblyjs/floating-point-hex-parser": "1.11.6", "@webassemblyjs/helper-api-error": "1.11.6", @@ -2942,14 +2950,12 @@ "node_modules/@webassemblyjs/helper-wasm-bytecode": { "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", - "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", - "dev": true + "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==" }, "node_modules/@webassemblyjs/helper-wasm-section": { "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz", "integrity": "sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==", - "dev": true, "dependencies": { "@webassemblyjs/ast": "1.11.6", "@webassemblyjs/helper-buffer": "1.11.6", @@ -2961,7 +2967,6 @@ "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", - "dev": true, "dependencies": { "@xtuc/ieee754": "^1.2.0" } @@ -2970,7 +2975,6 @@ "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", - "dev": true, "dependencies": { "@xtuc/long": "4.2.2" } @@ -2978,14 +2982,12 @@ "node_modules/@webassemblyjs/utf8": { "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", - "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", - "dev": true + "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==" }, "node_modules/@webassemblyjs/wasm-edit": { "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz", "integrity": "sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==", - "dev": true, "dependencies": { "@webassemblyjs/ast": "1.11.6", "@webassemblyjs/helper-buffer": "1.11.6", @@ -3001,7 +3003,6 @@ "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz", "integrity": "sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==", - "dev": true, "dependencies": { "@webassemblyjs/ast": "1.11.6", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", @@ -3014,7 +3015,6 @@ "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz", "integrity": "sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==", - "dev": true, "dependencies": { "@webassemblyjs/ast": "1.11.6", "@webassemblyjs/helper-buffer": "1.11.6", @@ -3026,7 +3026,6 @@ "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz", "integrity": "sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==", - "dev": true, "dependencies": { "@webassemblyjs/ast": "1.11.6", "@webassemblyjs/helper-api-error": "1.11.6", @@ -3040,7 +3039,6 @@ "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz", "integrity": "sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==", - "dev": true, "dependencies": { "@webassemblyjs/ast": "1.11.6", "@xtuc/long": "4.2.2" @@ -3093,14 +3091,12 @@ "node_modules/@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "dev": true + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==" }, "node_modules/@xtuc/long": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "dev": true + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==" }, "node_modules/abortcontroller-polyfill": { "version": "1.7.5", @@ -3112,7 +3108,6 @@ "version": "8.10.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", - "dev": true, "bin": { "acorn": "bin/acorn" }, @@ -3124,7 +3119,6 @@ "version": "1.9.0", "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", - "dev": true, "peerDependencies": { "acorn": "^8" } @@ -3133,7 +3127,6 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -3149,7 +3142,6 @@ "version": "3.5.2", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, "peerDependencies": { "ajv": "^6.9.1" } @@ -3158,7 +3150,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -3194,7 +3185,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, "dependencies": { "fill-range": "^7.0.1" }, @@ -3206,7 +3196,6 @@ "version": "4.22.1", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", "integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==", - "dev": true, "funding": [ { "type": "opencollective", @@ -3237,8 +3226,7 @@ "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" }, "node_modules/builtin-modules": { "version": "3.3.0", @@ -3265,7 +3253,6 @@ "version": "1.0.30001546", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001546.tgz", "integrity": "sha512-zvtSJwuQFpewSyRrI3AsftF6rM0X80mZkChIt1spBGEvRglCrjTniXvinc8JKRoqTwXAgvqTImaN9igfSMtUBw==", - "dev": true, "funding": [ { "type": "opencollective", @@ -3285,7 +3272,6 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -3301,7 +3287,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", - "dev": true, "engines": { "node": ">=6.0" } @@ -3333,7 +3318,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -3344,8 +3328,7 @@ "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "node_modules/colorette": { "version": "2.0.20", @@ -3382,10 +3365,6 @@ "resolved": "webpack", "link": true }, - "node_modules/consumer-webpack-ts": { - "resolved": "webpack-ts", - "link": true - }, "node_modules/cosmiconfig": { "version": "8.3.6", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz", @@ -3693,14 +3672,12 @@ "node_modules/electron-to-chromium": { "version": "1.4.543", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.543.tgz", - "integrity": "sha512-t2ZP4AcGE0iKCCQCBx/K2426crYdxD3YU6l0uK2EO3FZH0pbC4pFz/sZm2ruZsND6hQBTcDWWlo/MLpiOdif5g==", - "dev": true + "integrity": "sha512-t2ZP4AcGE0iKCCQCBx/K2426crYdxD3YU6l0uK2EO3FZH0pbC4pFz/sZm2ruZsND6hQBTcDWWlo/MLpiOdif5g==" }, "node_modules/enhanced-resolve": { "version": "5.15.0", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", - "dev": true, "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" @@ -3745,8 +3722,7 @@ "node_modules/es-module-lexer": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.3.1.tgz", - "integrity": "sha512-JUFAyicQV9mXc3YRxPnDlrfBKpqt6hUYzz9/boprUJHs4e4KVr3XwOF70doO6gwXUor6EWZJAyWAfKki84t20Q==", - "dev": true + "integrity": "sha512-JUFAyicQV9mXc3YRxPnDlrfBKpqt6hUYzz9/boprUJHs4e4KVr3XwOF70doO6gwXUor6EWZJAyWAfKki84t20Q==" }, "node_modules/esbuild": { "version": "0.19.4", @@ -3789,7 +3765,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true, "engines": { "node": ">=6" } @@ -3807,7 +3782,6 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" @@ -3820,7 +3794,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, "dependencies": { "estraverse": "^5.2.0" }, @@ -3832,7 +3805,6 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, "engines": { "node": ">=4.0" } @@ -3841,7 +3813,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, "engines": { "node": ">=4.0" } @@ -3849,14 +3820,12 @@ "node_modules/estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" }, "node_modules/events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true, "engines": { "node": ">=0.8.x" } @@ -3864,14 +3833,12 @@ "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, "node_modules/fastest-levenshtein": { "version": "1.0.16", @@ -3886,7 +3853,6 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -3933,8 +3899,7 @@ "node_modules/glob-to-regexp": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", - "dev": true + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==" }, "node_modules/globals": { "version": "13.23.0", @@ -3954,14 +3919,12 @@ "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, "node_modules/has": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", - "dev": true, "engines": { "node": ">= 0.4.0" } @@ -3970,7 +3933,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, "engines": { "node": ">=8" } @@ -4110,7 +4072,6 @@ "version": "2.13.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", - "dev": true, "dependencies": { "has": "^1.0.3" }, @@ -4155,7 +4116,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, "engines": { "node": ">=0.12.0" } @@ -4191,7 +4151,6 @@ "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", - "dev": true, "dependencies": { "@types/node": "*", "merge-stream": "^2.0.0", @@ -4205,7 +4164,6 @@ "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -4237,14 +4195,12 @@ "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, "node_modules/json5": { "version": "2.2.3", @@ -4533,7 +4489,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", - "dev": true, "engines": { "node": ">=6.11.5" } @@ -4554,7 +4509,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -4573,14 +4527,12 @@ "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" }, "node_modules/micromatch": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, "dependencies": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -4593,7 +4545,6 @@ "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, "engines": { "node": ">= 0.6" } @@ -4602,7 +4553,6 @@ "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, "dependencies": { "mime-db": "1.52.0" }, @@ -4680,8 +4630,7 @@ "node_modules/neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" }, "node_modules/node-addon-api": { "version": "7.0.0", @@ -4703,8 +4652,7 @@ "node_modules/node-releases": { "version": "2.0.13", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", - "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", - "dev": true + "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==" }, "node_modules/nth-check": { "version": "2.1.1", @@ -4849,8 +4797,7 @@ "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/path-type": { "version": "4.0.0", @@ -4864,14 +4811,12 @@ "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, "engines": { "node": ">=8.6" }, @@ -4974,6 +4919,21 @@ "node": ">=12" } }, + "node_modules/prettier": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", @@ -4987,7 +4947,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", - "dev": true, "engines": { "node": ">=6" } @@ -4996,7 +4955,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, "dependencies": { "safe-buffer": "^5.1.0" } @@ -5038,7 +4996,6 @@ "version": "1.22.6", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.6.tgz", "integrity": "sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw==", - "dev": true, "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", @@ -5085,7 +5042,7 @@ "version": "3.29.4", "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz", "integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==", - "dev": true, + "devOptional": true, "bin": { "rollup": "dist/bin/rollup" }, @@ -5101,7 +5058,6 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, "funding": [ { "type": "github", @@ -5121,7 +5077,6 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", - "dev": true, "dependencies": { "@types/json-schema": "^7.0.8", "ajv": "^6.12.5", @@ -5139,7 +5094,6 @@ "version": "7.5.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -5154,7 +5108,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", - "dev": true, "dependencies": { "randombytes": "^2.1.0" } @@ -5196,7 +5149,6 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -5214,7 +5166,6 @@ "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -5243,7 +5194,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -5255,7 +5205,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -5293,7 +5242,6 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", - "dev": true, "engines": { "node": ">=6" } @@ -5314,7 +5262,6 @@ "version": "5.21.0", "resolved": "https://registry.npmjs.org/terser/-/terser-5.21.0.tgz", "integrity": "sha512-WtnFKrxu9kaoXuiZFSGrcAvvBqAdmKx0SFNmVNYdJamMu9yyN3I/QF0FbH4QcqJQ+y1CJnzxGIKH0cSj+FGYRw==", - "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.8.2", @@ -5332,7 +5279,6 @@ "version": "5.3.9", "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz", "integrity": "sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==", - "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.17", "jest-worker": "^27.4.5", @@ -5365,8 +5311,7 @@ "node_modules/terser/node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" }, "node_modules/timsort": { "version": "0.3.0", @@ -5378,7 +5323,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -5387,15 +5331,15 @@ } }, "node_modules/ts-loader": { - "version": "9.4.4", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.4.tgz", - "integrity": "sha512-MLukxDHBl8OJ5Dk3y69IsKVFRA/6MwzEqBgh+OXMPB/OD01KQuWPFd1WAQP8a5PeSCAxfnkhiuWqfmFJzJQt9w==", - "dev": true, + "version": "9.5.1", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.5.1.tgz", + "integrity": "sha512-rNH3sK9kGZcH9dYzC7CewQm4NtxJTjSEVRJ2DyBZR7f8/wcta+iV44UPCXc5+nzDzivKtlzV6c9P4e+oFhDLYg==", "dependencies": { "chalk": "^4.1.0", "enhanced-resolve": "^5.0.0", "micromatch": "^4.0.0", - "semver": "^7.3.4" + "semver": "^7.3.4", + "source-map": "^0.7.4" }, "engines": { "node": ">=12.0.0" @@ -5405,11 +5349,19 @@ "webpack": "^5.0.0" } }, + "node_modules/ts-loader/node_modules/source-map": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "engines": { + "node": ">= 8" + } + }, "node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "dev": true + "devOptional": true }, "node_modules/type-fest": { "version": "0.20.2", @@ -5424,10 +5376,9 @@ } }, "node_modules/typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", - "dev": true, + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", + "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -5440,7 +5391,6 @@ "version": "1.0.13", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", - "dev": true, "funding": [ { "type": "opencollective", @@ -5470,7 +5420,6 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, "dependencies": { "punycode": "^2.1.0" } @@ -5932,7 +5881,6 @@ "version": "2.4.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", - "dev": true, "dependencies": { "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.1.2" @@ -5951,7 +5899,6 @@ "version": "5.88.2", "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.88.2.tgz", "integrity": "sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ==", - "dev": true, "dependencies": { "@types/eslint-scope": "^3.7.3", "@types/estree": "^1.0.0", @@ -6065,7 +6012,6 @@ "version": "3.2.3", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", - "dev": true, "engines": { "node": ">=10.13.0" } @@ -6100,14 +6046,14 @@ "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "parcel": { "name": "consumer-parcel", "dependencies": { "@bufbuild/protobuf": "^1.7.2", - "@connectrpc/connect": "^1.3.0" + "@connectrpc/connect": "^1.3.0", + "typescript": "^5.4.2" }, "devDependencies": { "@bufbuild/buf": "^1.29.0", @@ -6120,7 +6066,9 @@ "name": "consumer-rollup", "dependencies": { "@bufbuild/protobuf": "^1.7.2", - "@connectrpc/connect": "^1.3.0" + "@connectrpc/connect": "^1.3.0", + "@rollup/plugin-typescript": "^11.1.6", + "typescript": "^5.4.2" }, "devDependencies": { "@bufbuild/buf": "^1.29.0", @@ -6147,7 +6095,9 @@ "name": "consumer-webpack", "dependencies": { "@bufbuild/protobuf": "^1.7.2", - "@connectrpc/connect": "^1.3.0" + "@connectrpc/connect": "^1.3.0", + "ts-loader": "^9.5.1", + "typescript": "^5.4.2" }, "devDependencies": { "@bufbuild/buf": "^1.29.0", @@ -6159,6 +6109,7 @@ }, "webpack-ts": { "name": "consumer-webpack-ts", + "extraneous": true, "dependencies": { "@bufbuild/protobuf": "^1.7.2", "@connectrpc/connect": "^1.3.0" diff --git a/bundle-size/package.json b/bundle-size/package.json index a61abf639..245d04abb 100644 --- a/bundle-size/package.json +++ b/bundle-size/package.json @@ -4,7 +4,7 @@ "all": "npm run generate && npm run build && npm run test", "generate": "npm run --workspaces generate", "build": "npm run --workspaces build", - "test": "node README.mjs", + "test": "npm run --workspaces test && node README.mjs", "ci": "npm run generate && npm run build && npm run test" }, "workspaces": [ @@ -12,14 +12,14 @@ "./parcel", "./rollup", "./vite", - "./webpack", - "./webpack-ts" + "./webpack" ], "//": "parcel adds the dep on process", "@parcel/resolver-default": { "packageExports": true }, "devDependencies": { - "process": "^0.11.10" + "process": "^0.11.10", + "prettier": "^3.2.5" } } diff --git a/bundle-size/parcel/buf.gen.yaml b/bundle-size/parcel/buf.gen.yaml deleted file mode 100644 index 21e57da6d..000000000 --- a/bundle-size/parcel/buf.gen.yaml +++ /dev/null @@ -1,8 +0,0 @@ -version: v1 -plugins: - - name: es - out: src/gen - opt: target=js - - name: connect-es - out: src/gen - opt: target=js diff --git a/bundle-size/parcel/package.json b/bundle-size/parcel/package.json index ccb714b45..e216b2c15 100644 --- a/bundle-size/parcel/package.json +++ b/bundle-size/parcel/package.json @@ -2,24 +2,40 @@ "name": "consumer-parcel", "scripts": { "pregenerate": "rm -rf dist", - "generate": "npx buf generate buf.build/connectrpc/eliza", - "build": "parcel build --log-level error --no-cache --no-content-hash" + "generate": "npx buf generate ../proto --template ../buf.gen.yaml", + "build": "parcel build --log-level error --no-cache --no-content-hash", + "test": "npm run test:js && npm run test:ts", + "test:js": "node dist/js/index.cf4251ac.js", + "test:ts": "node dist/ts/index.dc635180.js" + }, + "testOutputPaths": { + "js": "dist/js/index.cf4251ac.js", + "ts": "dist/ts/index.dc635180.js" }, - "testOutputPath": "dist/index.1756241d.js", "type": "module", "dependencies": { + "@bufbuild/protobuf": "^1.7.2", "@connectrpc/connect": "^1.3.0", - "@bufbuild/protobuf": "^1.7.2" + "typescript": "^5.4.2" }, "devDependencies": { - "parcel": "^2.9.3", "@bufbuild/buf": "^1.29.0", "@bufbuild/protoc-gen-es": "^1.7.2", - "@connectrpc/protoc-gen-connect-es": "^1.3.0" + "@connectrpc/protoc-gen-connect-es": "^1.3.0", + "parcel": "^2.9.3" }, "//": "otherwise, parcel shakes everything away", "@parcel/resolver-default": { "packageExports": true }, - "source": "src/index.html" + "targets": { + "js": { + "source": "src/js/index.html", + "distDir": "./dist/js" + }, + "ts": { + "source": "src/ts/index.html", + "distDir": "./dist/ts" + } + } } diff --git a/bundle-size/parcel/src/index.js b/bundle-size/parcel/src/index.js deleted file mode 100644 index 846d658e8..000000000 --- a/bundle-size/parcel/src/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import {compressedFlag} from "@connectrpc/connect/protocol" -import {SayRequest} from "./gen/connectrpc/eliza/v1/eliza_pb.js"; - -console.log(compressedFlag); -console.log(SayRequest); -console.log('yoseph'); diff --git a/bundle-size/parcel/src/gen/connectrpc/eliza/v1/eliza_connect.js b/bundle-size/parcel/src/js/gen/connectrpc/eliza/v1/eliza_connect.js similarity index 100% rename from bundle-size/parcel/src/gen/connectrpc/eliza/v1/eliza_connect.js rename to bundle-size/parcel/src/js/gen/connectrpc/eliza/v1/eliza_connect.js diff --git a/bundle-size/esbuild/src/gen/connectrpc/eliza/v1/eliza_pb.js b/bundle-size/parcel/src/js/gen/connectrpc/eliza/v1/eliza_pb.js similarity index 76% rename from bundle-size/esbuild/src/gen/connectrpc/eliza/v1/eliza_pb.js rename to bundle-size/parcel/src/js/gen/connectrpc/eliza/v1/eliza_pb.js index edf8ada35..8afe1053a 100644 --- a/bundle-size/esbuild/src/gen/connectrpc/eliza/v1/eliza_pb.js +++ b/bundle-size/parcel/src/js/gen/connectrpc/eliza/v1/eliza_pb.js @@ -19,6 +19,30 @@ import { proto3 } from "@bufbuild/protobuf"; +/** + * @generated from enum connectrpc.eliza.v1.SayVolume + */ +export const SayVolume = proto3.makeEnum( + "connectrpc.eliza.v1.SayVolume", + [ + {no: 0, name: "SAY_VOLUME_UNSPECIFIED", localName: "UNSPECIFIED"}, + {no: 1, name: "SAY_VOLUME_LOUD", localName: "LOUD"}, + {no: 2, name: "SAY_VOLUME_SOFT", localName: "SOFT"}, + ], +); + +/** + * @generated from enum connectrpc.eliza.v1.ConverseVolume + */ +export const ConverseVolume = proto3.makeEnum( + "connectrpc.eliza.v1.ConverseVolume", + [ + {no: 0, name: "CONVERSE_VOLUME_UNSPECIFIED", localName: "UNSPECIFIED"}, + {no: 1, name: "CONVERSE_VOLUME_LOUD", localName: "LOUD"}, + {no: 2, name: "CONVERSE_VOLUME_SOFT", localName: "SOFT"}, + ], +); + /** * SayRequest is a single-sentence request. * @@ -28,6 +52,7 @@ export const SayRequest = proto3.makeMessageType( "connectrpc.eliza.v1.SayRequest", () => [ { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "volume", kind: "enum", T: proto3.getEnumType(SayVolume) }, ], ); @@ -53,6 +78,7 @@ export const ConverseRequest = proto3.makeMessageType( "connectrpc.eliza.v1.ConverseRequest", () => [ { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "volume", kind: "enum", T: proto3.getEnumType(ConverseVolume) }, ], ); diff --git a/bundle-size/parcel/src/index.html b/bundle-size/parcel/src/js/index.html similarity index 100% rename from bundle-size/parcel/src/index.html rename to bundle-size/parcel/src/js/index.html diff --git a/bundle-size/parcel/src/js/index.js b/bundle-size/parcel/src/js/index.js new file mode 100644 index 000000000..12b138b4e --- /dev/null +++ b/bundle-size/parcel/src/js/index.js @@ -0,0 +1,13 @@ +import { compressedFlag } from "@connectrpc/connect/protocol"; +import { SayRequest, SayVolume } from "./gen/connectrpc/eliza/v1/eliza_pb.js"; +import { proto3 } from "@bufbuild/protobuf"; + +const testEnum = proto3.getEnumType(SayVolume); + +if ( + compressedFlag === 1 && + SayRequest.typeName === "connectrpc.eliza.v1.SayRequest" && + testEnum.typeName === "connectrpc.eliza.v1.SayVolume" +) { + console.log("parcel (js) OK"); +} diff --git a/bundle-size/parcel/src/ts/gen/connectrpc/eliza/v1/eliza_connect.d.ts b/bundle-size/parcel/src/ts/gen/connectrpc/eliza/v1/eliza_connect.d.ts new file mode 100644 index 000000000..1e5282a6c --- /dev/null +++ b/bundle-size/parcel/src/ts/gen/connectrpc/eliza/v1/eliza_connect.d.ts @@ -0,0 +1,75 @@ +// Copyright 2022-2023 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-connect-es v1.3.0 with parameter "target=ts+dts" +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { ConverseRequest, ConverseResponse, IntroduceRequest, IntroduceResponse, SayRequest, SayResponse } from "./eliza_pb.js"; +import { MethodIdempotency, MethodKind } from "@bufbuild/protobuf"; + +/** + * ElizaService provides a way to talk to Eliza, a port of the DOCTOR script + * for Joseph Weizenbaum's original ELIZA program. Created in the mid-1960s at + * the MIT Artificial Intelligence Laboratory, ELIZA demonstrates the + * superficiality of human-computer communication. DOCTOR simulates a + * psychotherapist, and is commonly found as an Easter egg in emacs + * distributions. + * + * @generated from service connectrpc.eliza.v1.ElizaService + */ +export declare const ElizaService: { + readonly typeName: "connectrpc.eliza.v1.ElizaService", + readonly methods: { + /** + * Say is a unary RPC. Eliza responds to the prompt with a single sentence. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Say + */ + readonly say: { + readonly name: "Say", + readonly I: typeof SayRequest, + readonly O: typeof SayResponse, + readonly kind: MethodKind.Unary, + readonly idempotency: MethodIdempotency.NoSideEffects, + }, + /** + * Converse is a bidirectional RPC. The caller may exchange multiple + * back-and-forth messages with Eliza over a long-lived connection. Eliza + * responds to each ConverseRequest with a ConverseResponse. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Converse + */ + readonly converse: { + readonly name: "Converse", + readonly I: typeof ConverseRequest, + readonly O: typeof ConverseResponse, + readonly kind: MethodKind.BiDiStreaming, + }, + /** + * Introduce is a server streaming RPC. Given the caller's name, Eliza + * returns a stream of sentences to introduce itself. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Introduce + */ + readonly introduce: { + readonly name: "Introduce", + readonly I: typeof IntroduceRequest, + readonly O: typeof IntroduceResponse, + readonly kind: MethodKind.ServerStreaming, + }, + } +}; + diff --git a/bundle-size/parcel/src/ts/gen/connectrpc/eliza/v1/eliza_connect.ts b/bundle-size/parcel/src/ts/gen/connectrpc/eliza/v1/eliza_connect.ts new file mode 100644 index 000000000..193f2f45a --- /dev/null +++ b/bundle-size/parcel/src/ts/gen/connectrpc/eliza/v1/eliza_connect.ts @@ -0,0 +1,75 @@ +// Copyright 2022-2023 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-connect-es v1.3.0 with parameter "target=ts+dts" +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { ConverseRequest, ConverseResponse, IntroduceRequest, IntroduceResponse, SayRequest, SayResponse } from "./eliza_pb.js"; +import { MethodIdempotency, MethodKind } from "@bufbuild/protobuf"; + +/** + * ElizaService provides a way to talk to Eliza, a port of the DOCTOR script + * for Joseph Weizenbaum's original ELIZA program. Created in the mid-1960s at + * the MIT Artificial Intelligence Laboratory, ELIZA demonstrates the + * superficiality of human-computer communication. DOCTOR simulates a + * psychotherapist, and is commonly found as an Easter egg in emacs + * distributions. + * + * @generated from service connectrpc.eliza.v1.ElizaService + */ +export const ElizaService = { + typeName: "connectrpc.eliza.v1.ElizaService", + methods: { + /** + * Say is a unary RPC. Eliza responds to the prompt with a single sentence. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Say + */ + say: { + name: "Say", + I: SayRequest, + O: SayResponse, + kind: MethodKind.Unary, + idempotency: MethodIdempotency.NoSideEffects, + }, + /** + * Converse is a bidirectional RPC. The caller may exchange multiple + * back-and-forth messages with Eliza over a long-lived connection. Eliza + * responds to each ConverseRequest with a ConverseResponse. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Converse + */ + converse: { + name: "Converse", + I: ConverseRequest, + O: ConverseResponse, + kind: MethodKind.BiDiStreaming, + }, + /** + * Introduce is a server streaming RPC. Given the caller's name, Eliza + * returns a stream of sentences to introduce itself. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Introduce + */ + introduce: { + name: "Introduce", + I: IntroduceRequest, + O: IntroduceResponse, + kind: MethodKind.ServerStreaming, + }, + } +} as const; + diff --git a/bundle-size/parcel/src/ts/gen/connectrpc/eliza/v1/eliza_pb.d.ts b/bundle-size/parcel/src/ts/gen/connectrpc/eliza/v1/eliza_pb.d.ts new file mode 100644 index 000000000..b50630de8 --- /dev/null +++ b/bundle-size/parcel/src/ts/gen/connectrpc/eliza/v1/eliza_pb.d.ts @@ -0,0 +1,230 @@ +// Copyright 2022-2023 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-es v1.7.2 with parameter "target=ts+dts" +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from enum connectrpc.eliza.v1.SayVolume + */ +export declare enum SayVolume { + /** + * @generated from enum value: SAY_VOLUME_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: SAY_VOLUME_LOUD = 1; + */ + LOUD = 1, + + /** + * @generated from enum value: SAY_VOLUME_SOFT = 2; + */ + SOFT = 2, +} + +/** + * @generated from enum connectrpc.eliza.v1.ConverseVolume + */ +export declare enum ConverseVolume { + /** + * @generated from enum value: CONVERSE_VOLUME_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: CONVERSE_VOLUME_LOUD = 1; + */ + LOUD = 1, + + /** + * @generated from enum value: CONVERSE_VOLUME_SOFT = 2; + */ + SOFT = 2, +} + +/** + * SayRequest is a single-sentence request. + * + * @generated from message connectrpc.eliza.v1.SayRequest + */ +export declare class SayRequest extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + /** + * @generated from field: connectrpc.eliza.v1.SayVolume volume = 2; + */ + volume: SayVolume; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.SayRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): SayRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): SayRequest; + + static fromJsonString(jsonString: string, options?: Partial): SayRequest; + + static equals(a: SayRequest | PlainMessage | undefined, b: SayRequest | PlainMessage | undefined): boolean; +} + +/** + * SayResponse is a single-sentence response. + * + * @generated from message connectrpc.eliza.v1.SayResponse + */ +export declare class SayResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.SayResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): SayResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): SayResponse; + + static fromJsonString(jsonString: string, options?: Partial): SayResponse; + + static equals(a: SayResponse | PlainMessage | undefined, b: SayResponse | PlainMessage | undefined): boolean; +} + +/** + * ConverseRequest is a single sentence request sent as part of a + * back-and-forth conversation. + * + * @generated from message connectrpc.eliza.v1.ConverseRequest + */ +export declare class ConverseRequest extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + /** + * @generated from field: connectrpc.eliza.v1.ConverseVolume volume = 2; + */ + volume: ConverseVolume; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.ConverseRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): ConverseRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): ConverseRequest; + + static fromJsonString(jsonString: string, options?: Partial): ConverseRequest; + + static equals(a: ConverseRequest | PlainMessage | undefined, b: ConverseRequest | PlainMessage | undefined): boolean; +} + +/** + * ConverseResponse is a single sentence response sent in answer to a + * ConverseRequest. + * + * @generated from message connectrpc.eliza.v1.ConverseResponse + */ +export declare class ConverseResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.ConverseResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): ConverseResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): ConverseResponse; + + static fromJsonString(jsonString: string, options?: Partial): ConverseResponse; + + static equals(a: ConverseResponse | PlainMessage | undefined, b: ConverseResponse | PlainMessage | undefined): boolean; +} + +/** + * IntroduceRequest asks Eliza to introduce itself to the named user. + * + * @generated from message connectrpc.eliza.v1.IntroduceRequest + */ +export declare class IntroduceRequest extends Message { + /** + * @generated from field: string name = 1; + */ + name: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.IntroduceRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): IntroduceRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): IntroduceRequest; + + static fromJsonString(jsonString: string, options?: Partial): IntroduceRequest; + + static equals(a: IntroduceRequest | PlainMessage | undefined, b: IntroduceRequest | PlainMessage | undefined): boolean; +} + +/** + * IntroduceResponse is one sentence of Eliza's introductory monologue. + * + * @generated from message connectrpc.eliza.v1.IntroduceResponse + */ +export declare class IntroduceResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.IntroduceResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): IntroduceResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): IntroduceResponse; + + static fromJsonString(jsonString: string, options?: Partial): IntroduceResponse; + + static equals(a: IntroduceResponse | PlainMessage | undefined, b: IntroduceResponse | PlainMessage | undefined): boolean; +} + diff --git a/bundle-size/parcel/src/ts/gen/connectrpc/eliza/v1/eliza_pb.ts b/bundle-size/parcel/src/ts/gen/connectrpc/eliza/v1/eliza_pb.ts new file mode 100644 index 000000000..78d081ae0 --- /dev/null +++ b/bundle-size/parcel/src/ts/gen/connectrpc/eliza/v1/eliza_pb.ts @@ -0,0 +1,322 @@ +// Copyright 2022-2023 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-es v1.7.2 with parameter "target=ts+dts" +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from enum connectrpc.eliza.v1.SayVolume + */ +export enum SayVolume { + /** + * @generated from enum value: SAY_VOLUME_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: SAY_VOLUME_LOUD = 1; + */ + LOUD = 1, + + /** + * @generated from enum value: SAY_VOLUME_SOFT = 2; + */ + SOFT = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(SayVolume) +proto3.util.setEnumType(SayVolume, "connectrpc.eliza.v1.SayVolume", [ + { no: 0, name: "SAY_VOLUME_UNSPECIFIED" }, + { no: 1, name: "SAY_VOLUME_LOUD" }, + { no: 2, name: "SAY_VOLUME_SOFT" }, +]); + +/** + * @generated from enum connectrpc.eliza.v1.ConverseVolume + */ +export enum ConverseVolume { + /** + * @generated from enum value: CONVERSE_VOLUME_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: CONVERSE_VOLUME_LOUD = 1; + */ + LOUD = 1, + + /** + * @generated from enum value: CONVERSE_VOLUME_SOFT = 2; + */ + SOFT = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(ConverseVolume) +proto3.util.setEnumType(ConverseVolume, "connectrpc.eliza.v1.ConverseVolume", [ + { no: 0, name: "CONVERSE_VOLUME_UNSPECIFIED" }, + { no: 1, name: "CONVERSE_VOLUME_LOUD" }, + { no: 2, name: "CONVERSE_VOLUME_SOFT" }, +]); + +/** + * SayRequest is a single-sentence request. + * + * @generated from message connectrpc.eliza.v1.SayRequest + */ +export class SayRequest extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + /** + * @generated from field: connectrpc.eliza.v1.SayVolume volume = 2; + */ + volume = SayVolume.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.SayRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "volume", kind: "enum", T: proto3.getEnumType(SayVolume) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SayRequest { + return new SayRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SayRequest { + return new SayRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SayRequest { + return new SayRequest().fromJsonString(jsonString, options); + } + + static equals(a: SayRequest | PlainMessage | undefined, b: SayRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(SayRequest, a, b); + } +} + +/** + * SayResponse is a single-sentence response. + * + * @generated from message connectrpc.eliza.v1.SayResponse + */ +export class SayResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.SayResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SayResponse { + return new SayResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SayResponse { + return new SayResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SayResponse { + return new SayResponse().fromJsonString(jsonString, options); + } + + static equals(a: SayResponse | PlainMessage | undefined, b: SayResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(SayResponse, a, b); + } +} + +/** + * ConverseRequest is a single sentence request sent as part of a + * back-and-forth conversation. + * + * @generated from message connectrpc.eliza.v1.ConverseRequest + */ +export class ConverseRequest extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + /** + * @generated from field: connectrpc.eliza.v1.ConverseVolume volume = 2; + */ + volume = ConverseVolume.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.ConverseRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "volume", kind: "enum", T: proto3.getEnumType(ConverseVolume) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ConverseRequest { + return new ConverseRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ConverseRequest { + return new ConverseRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ConverseRequest { + return new ConverseRequest().fromJsonString(jsonString, options); + } + + static equals(a: ConverseRequest | PlainMessage | undefined, b: ConverseRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ConverseRequest, a, b); + } +} + +/** + * ConverseResponse is a single sentence response sent in answer to a + * ConverseRequest. + * + * @generated from message connectrpc.eliza.v1.ConverseResponse + */ +export class ConverseResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.ConverseResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ConverseResponse { + return new ConverseResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ConverseResponse { + return new ConverseResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ConverseResponse { + return new ConverseResponse().fromJsonString(jsonString, options); + } + + static equals(a: ConverseResponse | PlainMessage | undefined, b: ConverseResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ConverseResponse, a, b); + } +} + +/** + * IntroduceRequest asks Eliza to introduce itself to the named user. + * + * @generated from message connectrpc.eliza.v1.IntroduceRequest + */ +export class IntroduceRequest extends Message { + /** + * @generated from field: string name = 1; + */ + name = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.IntroduceRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): IntroduceRequest { + return new IntroduceRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): IntroduceRequest { + return new IntroduceRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): IntroduceRequest { + return new IntroduceRequest().fromJsonString(jsonString, options); + } + + static equals(a: IntroduceRequest | PlainMessage | undefined, b: IntroduceRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(IntroduceRequest, a, b); + } +} + +/** + * IntroduceResponse is one sentence of Eliza's introductory monologue. + * + * @generated from message connectrpc.eliza.v1.IntroduceResponse + */ +export class IntroduceResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.IntroduceResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): IntroduceResponse { + return new IntroduceResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): IntroduceResponse { + return new IntroduceResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): IntroduceResponse { + return new IntroduceResponse().fromJsonString(jsonString, options); + } + + static equals(a: IntroduceResponse | PlainMessage | undefined, b: IntroduceResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(IntroduceResponse, a, b); + } +} + diff --git a/bundle-size/parcel/src/ts/index.html b/bundle-size/parcel/src/ts/index.html new file mode 100644 index 000000000..ffe5753db --- /dev/null +++ b/bundle-size/parcel/src/ts/index.html @@ -0,0 +1,11 @@ + + + + + My First Parcel App + + + +

Hello, World!

+ + diff --git a/bundle-size/parcel/src/ts/index.ts b/bundle-size/parcel/src/ts/index.ts new file mode 100644 index 000000000..f604283f3 --- /dev/null +++ b/bundle-size/parcel/src/ts/index.ts @@ -0,0 +1,13 @@ +import { compressedFlag } from "@connectrpc/connect/protocol"; +import { SayRequest, SayVolume } from "./gen/connectrpc/eliza/v1/eliza_pb.js"; +import { proto3 } from "@bufbuild/protobuf"; + +const testEnum = proto3.getEnumType(SayVolume); + +if ( + compressedFlag === 1 && + SayRequest.typeName === "connectrpc.eliza.v1.SayRequest" && + testEnum.typeName === "connectrpc.eliza.v1.SayVolume" +) { + console.log("parcel (ts) OK"); +} diff --git a/bundle-size/parcel/src/ts/tsconfig.json b/bundle-size/parcel/src/ts/tsconfig.json new file mode 100644 index 000000000..8ddee87e8 --- /dev/null +++ b/bundle-size/parcel/src/ts/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "target": "ES2019", + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], + "allowJs": true, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "noFallthroughCasesInSwitch": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx" + } +} diff --git a/bundle-size/proto/connectrpc/eliza/v1/eliza.proto b/bundle-size/proto/connectrpc/eliza/v1/eliza.proto new file mode 100644 index 000000000..b800bfdb1 --- /dev/null +++ b/bundle-size/proto/connectrpc/eliza/v1/eliza.proto @@ -0,0 +1,83 @@ +// Copyright 2022-2023 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package connectrpc.eliza.v1; + +enum SayVolume { + SAY_VOLUME_UNSPECIFIED = 0; + SAY_VOLUME_LOUD = 1; + SAY_VOLUME_SOFT = 2; +} + +enum ConverseVolume { + CONVERSE_VOLUME_UNSPECIFIED = 0; + CONVERSE_VOLUME_LOUD = 1; + CONVERSE_VOLUME_SOFT = 2; +} + +// ElizaService provides a way to talk to Eliza, a port of the DOCTOR script +// for Joseph Weizenbaum's original ELIZA program. Created in the mid-1960s at +// the MIT Artificial Intelligence Laboratory, ELIZA demonstrates the +// superficiality of human-computer communication. DOCTOR simulates a +// psychotherapist, and is commonly found as an Easter egg in emacs +// distributions. +service ElizaService { + // Say is a unary RPC. Eliza responds to the prompt with a single sentence. + rpc Say(SayRequest) returns (SayResponse) { + option idempotency_level = NO_SIDE_EFFECTS; + } + // Converse is a bidirectional RPC. The caller may exchange multiple + // back-and-forth messages with Eliza over a long-lived connection. Eliza + // responds to each ConverseRequest with a ConverseResponse. + rpc Converse(stream ConverseRequest) returns (stream ConverseResponse) {} + // Introduce is a server streaming RPC. Given the caller's name, Eliza + // returns a stream of sentences to introduce itself. + rpc Introduce(IntroduceRequest) returns (stream IntroduceResponse) {} +} + +// SayRequest is a single-sentence request. +message SayRequest { + string sentence = 1; + SayVolume volume = 2; +} + +// SayResponse is a single-sentence response. +message SayResponse { + string sentence = 1; +} + +// ConverseRequest is a single sentence request sent as part of a +// back-and-forth conversation. +message ConverseRequest { + string sentence = 1; + ConverseVolume volume = 2; +} + +// ConverseResponse is a single sentence response sent in answer to a +// ConverseRequest. +message ConverseResponse { + string sentence = 1; +} + +// IntroduceRequest asks Eliza to introduce itself to the named user. +message IntroduceRequest { + string name = 1; +} + +// IntroduceResponse is one sentence of Eliza's introductory monologue. +message IntroduceResponse { + string sentence = 1; +} diff --git a/bundle-size/rollup/buf.gen.yaml b/bundle-size/rollup/buf.gen.yaml deleted file mode 100644 index 21e57da6d..000000000 --- a/bundle-size/rollup/buf.gen.yaml +++ /dev/null @@ -1,8 +0,0 @@ -version: v1 -plugins: - - name: es - out: src/gen - opt: target=js - - name: connect-es - out: src/gen - opt: target=js diff --git a/bundle-size/rollup/package.json b/bundle-size/rollup/package.json index d2e87e5cf..f113dc308 100644 --- a/bundle-size/rollup/package.json +++ b/bundle-size/rollup/package.json @@ -2,14 +2,24 @@ "name": "consumer-rollup", "scripts": { "pregenerate": "rm -rf dist", - "generate": "npx buf generate buf.build/connectrpc/eliza", - "build": "rollup --silent -c rollup.config.js" + "generate": "npx buf generate ../proto --template ../buf.gen.yaml", + "build": "npm run build:js && npm run build:ts", + "build:js": "rollup --silent -c rollup.config.js --input src/js/index.js -o dist/js/index.js", + "build:ts": "rollup --silent -c rollup.config.js --input src/ts/index.ts -o dist/ts/index.js", + "test": "npm run test:js && npm run test:ts", + "test:js": "node dist/js/index.js", + "test:ts": "node dist/ts/index.js" + }, + "testOutputPaths": { + "js": "dist/js/index.js", + "ts": "dist/ts/index.js" }, - "testOutputPath": "dist/index.js", "type": "module", "dependencies": { "@bufbuild/protobuf": "^1.7.2", - "@connectrpc/connect": "^1.3.0" + "@connectrpc/connect": "^1.3.0", + "@rollup/plugin-typescript": "^11.1.6", + "typescript": "^5.4.2" }, "devDependencies": { "@bufbuild/buf": "^1.29.0", diff --git a/bundle-size/rollup/rollup.config.js b/bundle-size/rollup/rollup.config.js index 751c67031..6c9cc9631 100644 --- a/bundle-size/rollup/rollup.config.js +++ b/bundle-size/rollup/rollup.config.js @@ -1,14 +1,18 @@ import { nodeResolve } from '@rollup/plugin-node-resolve'; +import typescript from '@rollup/plugin-typescript'; export default { - input: "src/index.js", plugins: [ nodeResolve({ extensions: [".js"], }), + typescript({ + noEmitOnError: true + }), ], output: { - file: "dist/index.js", format: "iife", }, }; + + diff --git a/bundle-size/rollup/src/index.js b/bundle-size/rollup/src/index.js deleted file mode 100644 index edc7a135e..000000000 --- a/bundle-size/rollup/src/index.js +++ /dev/null @@ -1,5 +0,0 @@ -import {compressedFlag} from "@connectrpc/connect/protocol" -import {SayRequest} from "./gen/connectrpc/eliza/v1/eliza_pb.js"; - -console.log(compressedFlag); -console.log(SayRequest); diff --git a/bundle-size/rollup/src/gen/connectrpc/eliza/v1/eliza_connect.js b/bundle-size/rollup/src/js/gen/connectrpc/eliza/v1/eliza_connect.js similarity index 100% rename from bundle-size/rollup/src/gen/connectrpc/eliza/v1/eliza_connect.js rename to bundle-size/rollup/src/js/gen/connectrpc/eliza/v1/eliza_connect.js diff --git a/bundle-size/rollup/src/gen/connectrpc/eliza/v1/eliza_pb.js b/bundle-size/rollup/src/js/gen/connectrpc/eliza/v1/eliza_pb.js similarity index 76% rename from bundle-size/rollup/src/gen/connectrpc/eliza/v1/eliza_pb.js rename to bundle-size/rollup/src/js/gen/connectrpc/eliza/v1/eliza_pb.js index edf8ada35..8afe1053a 100644 --- a/bundle-size/rollup/src/gen/connectrpc/eliza/v1/eliza_pb.js +++ b/bundle-size/rollup/src/js/gen/connectrpc/eliza/v1/eliza_pb.js @@ -19,6 +19,30 @@ import { proto3 } from "@bufbuild/protobuf"; +/** + * @generated from enum connectrpc.eliza.v1.SayVolume + */ +export const SayVolume = proto3.makeEnum( + "connectrpc.eliza.v1.SayVolume", + [ + {no: 0, name: "SAY_VOLUME_UNSPECIFIED", localName: "UNSPECIFIED"}, + {no: 1, name: "SAY_VOLUME_LOUD", localName: "LOUD"}, + {no: 2, name: "SAY_VOLUME_SOFT", localName: "SOFT"}, + ], +); + +/** + * @generated from enum connectrpc.eliza.v1.ConverseVolume + */ +export const ConverseVolume = proto3.makeEnum( + "connectrpc.eliza.v1.ConverseVolume", + [ + {no: 0, name: "CONVERSE_VOLUME_UNSPECIFIED", localName: "UNSPECIFIED"}, + {no: 1, name: "CONVERSE_VOLUME_LOUD", localName: "LOUD"}, + {no: 2, name: "CONVERSE_VOLUME_SOFT", localName: "SOFT"}, + ], +); + /** * SayRequest is a single-sentence request. * @@ -28,6 +52,7 @@ export const SayRequest = proto3.makeMessageType( "connectrpc.eliza.v1.SayRequest", () => [ { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "volume", kind: "enum", T: proto3.getEnumType(SayVolume) }, ], ); @@ -53,6 +78,7 @@ export const ConverseRequest = proto3.makeMessageType( "connectrpc.eliza.v1.ConverseRequest", () => [ { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "volume", kind: "enum", T: proto3.getEnumType(ConverseVolume) }, ], ); diff --git a/bundle-size/rollup/src/js/index.js b/bundle-size/rollup/src/js/index.js new file mode 100644 index 000000000..ce49d0a86 --- /dev/null +++ b/bundle-size/rollup/src/js/index.js @@ -0,0 +1,13 @@ +import { compressedFlag } from "@connectrpc/connect/protocol"; +import { SayRequest, SayVolume } from "./gen/connectrpc/eliza/v1/eliza_pb.js"; +import { proto3 } from "@bufbuild/protobuf"; + +const testEnum = proto3.getEnumType(SayVolume); + +if ( + compressedFlag === 1 && + SayRequest.typeName === "connectrpc.eliza.v1.SayRequest" && + testEnum.typeName === "connectrpc.eliza.v1.SayVolume" +) { + console.log("rollup (js) OK"); +} diff --git a/bundle-size/rollup/src/ts/gen/connectrpc/eliza/v1/eliza_connect.d.ts b/bundle-size/rollup/src/ts/gen/connectrpc/eliza/v1/eliza_connect.d.ts new file mode 100644 index 000000000..1e5282a6c --- /dev/null +++ b/bundle-size/rollup/src/ts/gen/connectrpc/eliza/v1/eliza_connect.d.ts @@ -0,0 +1,75 @@ +// Copyright 2022-2023 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-connect-es v1.3.0 with parameter "target=ts+dts" +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { ConverseRequest, ConverseResponse, IntroduceRequest, IntroduceResponse, SayRequest, SayResponse } from "./eliza_pb.js"; +import { MethodIdempotency, MethodKind } from "@bufbuild/protobuf"; + +/** + * ElizaService provides a way to talk to Eliza, a port of the DOCTOR script + * for Joseph Weizenbaum's original ELIZA program. Created in the mid-1960s at + * the MIT Artificial Intelligence Laboratory, ELIZA demonstrates the + * superficiality of human-computer communication. DOCTOR simulates a + * psychotherapist, and is commonly found as an Easter egg in emacs + * distributions. + * + * @generated from service connectrpc.eliza.v1.ElizaService + */ +export declare const ElizaService: { + readonly typeName: "connectrpc.eliza.v1.ElizaService", + readonly methods: { + /** + * Say is a unary RPC. Eliza responds to the prompt with a single sentence. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Say + */ + readonly say: { + readonly name: "Say", + readonly I: typeof SayRequest, + readonly O: typeof SayResponse, + readonly kind: MethodKind.Unary, + readonly idempotency: MethodIdempotency.NoSideEffects, + }, + /** + * Converse is a bidirectional RPC. The caller may exchange multiple + * back-and-forth messages with Eliza over a long-lived connection. Eliza + * responds to each ConverseRequest with a ConverseResponse. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Converse + */ + readonly converse: { + readonly name: "Converse", + readonly I: typeof ConverseRequest, + readonly O: typeof ConverseResponse, + readonly kind: MethodKind.BiDiStreaming, + }, + /** + * Introduce is a server streaming RPC. Given the caller's name, Eliza + * returns a stream of sentences to introduce itself. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Introduce + */ + readonly introduce: { + readonly name: "Introduce", + readonly I: typeof IntroduceRequest, + readonly O: typeof IntroduceResponse, + readonly kind: MethodKind.ServerStreaming, + }, + } +}; + diff --git a/bundle-size/rollup/src/ts/gen/connectrpc/eliza/v1/eliza_connect.ts b/bundle-size/rollup/src/ts/gen/connectrpc/eliza/v1/eliza_connect.ts new file mode 100644 index 000000000..193f2f45a --- /dev/null +++ b/bundle-size/rollup/src/ts/gen/connectrpc/eliza/v1/eliza_connect.ts @@ -0,0 +1,75 @@ +// Copyright 2022-2023 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-connect-es v1.3.0 with parameter "target=ts+dts" +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { ConverseRequest, ConverseResponse, IntroduceRequest, IntroduceResponse, SayRequest, SayResponse } from "./eliza_pb.js"; +import { MethodIdempotency, MethodKind } from "@bufbuild/protobuf"; + +/** + * ElizaService provides a way to talk to Eliza, a port of the DOCTOR script + * for Joseph Weizenbaum's original ELIZA program. Created in the mid-1960s at + * the MIT Artificial Intelligence Laboratory, ELIZA demonstrates the + * superficiality of human-computer communication. DOCTOR simulates a + * psychotherapist, and is commonly found as an Easter egg in emacs + * distributions. + * + * @generated from service connectrpc.eliza.v1.ElizaService + */ +export const ElizaService = { + typeName: "connectrpc.eliza.v1.ElizaService", + methods: { + /** + * Say is a unary RPC. Eliza responds to the prompt with a single sentence. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Say + */ + say: { + name: "Say", + I: SayRequest, + O: SayResponse, + kind: MethodKind.Unary, + idempotency: MethodIdempotency.NoSideEffects, + }, + /** + * Converse is a bidirectional RPC. The caller may exchange multiple + * back-and-forth messages with Eliza over a long-lived connection. Eliza + * responds to each ConverseRequest with a ConverseResponse. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Converse + */ + converse: { + name: "Converse", + I: ConverseRequest, + O: ConverseResponse, + kind: MethodKind.BiDiStreaming, + }, + /** + * Introduce is a server streaming RPC. Given the caller's name, Eliza + * returns a stream of sentences to introduce itself. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Introduce + */ + introduce: { + name: "Introduce", + I: IntroduceRequest, + O: IntroduceResponse, + kind: MethodKind.ServerStreaming, + }, + } +} as const; + diff --git a/bundle-size/rollup/src/ts/gen/connectrpc/eliza/v1/eliza_pb.d.ts b/bundle-size/rollup/src/ts/gen/connectrpc/eliza/v1/eliza_pb.d.ts new file mode 100644 index 000000000..b50630de8 --- /dev/null +++ b/bundle-size/rollup/src/ts/gen/connectrpc/eliza/v1/eliza_pb.d.ts @@ -0,0 +1,230 @@ +// Copyright 2022-2023 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-es v1.7.2 with parameter "target=ts+dts" +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from enum connectrpc.eliza.v1.SayVolume + */ +export declare enum SayVolume { + /** + * @generated from enum value: SAY_VOLUME_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: SAY_VOLUME_LOUD = 1; + */ + LOUD = 1, + + /** + * @generated from enum value: SAY_VOLUME_SOFT = 2; + */ + SOFT = 2, +} + +/** + * @generated from enum connectrpc.eliza.v1.ConverseVolume + */ +export declare enum ConverseVolume { + /** + * @generated from enum value: CONVERSE_VOLUME_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: CONVERSE_VOLUME_LOUD = 1; + */ + LOUD = 1, + + /** + * @generated from enum value: CONVERSE_VOLUME_SOFT = 2; + */ + SOFT = 2, +} + +/** + * SayRequest is a single-sentence request. + * + * @generated from message connectrpc.eliza.v1.SayRequest + */ +export declare class SayRequest extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + /** + * @generated from field: connectrpc.eliza.v1.SayVolume volume = 2; + */ + volume: SayVolume; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.SayRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): SayRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): SayRequest; + + static fromJsonString(jsonString: string, options?: Partial): SayRequest; + + static equals(a: SayRequest | PlainMessage | undefined, b: SayRequest | PlainMessage | undefined): boolean; +} + +/** + * SayResponse is a single-sentence response. + * + * @generated from message connectrpc.eliza.v1.SayResponse + */ +export declare class SayResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.SayResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): SayResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): SayResponse; + + static fromJsonString(jsonString: string, options?: Partial): SayResponse; + + static equals(a: SayResponse | PlainMessage | undefined, b: SayResponse | PlainMessage | undefined): boolean; +} + +/** + * ConverseRequest is a single sentence request sent as part of a + * back-and-forth conversation. + * + * @generated from message connectrpc.eliza.v1.ConverseRequest + */ +export declare class ConverseRequest extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + /** + * @generated from field: connectrpc.eliza.v1.ConverseVolume volume = 2; + */ + volume: ConverseVolume; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.ConverseRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): ConverseRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): ConverseRequest; + + static fromJsonString(jsonString: string, options?: Partial): ConverseRequest; + + static equals(a: ConverseRequest | PlainMessage | undefined, b: ConverseRequest | PlainMessage | undefined): boolean; +} + +/** + * ConverseResponse is a single sentence response sent in answer to a + * ConverseRequest. + * + * @generated from message connectrpc.eliza.v1.ConverseResponse + */ +export declare class ConverseResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.ConverseResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): ConverseResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): ConverseResponse; + + static fromJsonString(jsonString: string, options?: Partial): ConverseResponse; + + static equals(a: ConverseResponse | PlainMessage | undefined, b: ConverseResponse | PlainMessage | undefined): boolean; +} + +/** + * IntroduceRequest asks Eliza to introduce itself to the named user. + * + * @generated from message connectrpc.eliza.v1.IntroduceRequest + */ +export declare class IntroduceRequest extends Message { + /** + * @generated from field: string name = 1; + */ + name: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.IntroduceRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): IntroduceRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): IntroduceRequest; + + static fromJsonString(jsonString: string, options?: Partial): IntroduceRequest; + + static equals(a: IntroduceRequest | PlainMessage | undefined, b: IntroduceRequest | PlainMessage | undefined): boolean; +} + +/** + * IntroduceResponse is one sentence of Eliza's introductory monologue. + * + * @generated from message connectrpc.eliza.v1.IntroduceResponse + */ +export declare class IntroduceResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.IntroduceResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): IntroduceResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): IntroduceResponse; + + static fromJsonString(jsonString: string, options?: Partial): IntroduceResponse; + + static equals(a: IntroduceResponse | PlainMessage | undefined, b: IntroduceResponse | PlainMessage | undefined): boolean; +} + diff --git a/bundle-size/rollup/src/ts/gen/connectrpc/eliza/v1/eliza_pb.ts b/bundle-size/rollup/src/ts/gen/connectrpc/eliza/v1/eliza_pb.ts new file mode 100644 index 000000000..78d081ae0 --- /dev/null +++ b/bundle-size/rollup/src/ts/gen/connectrpc/eliza/v1/eliza_pb.ts @@ -0,0 +1,322 @@ +// Copyright 2022-2023 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-es v1.7.2 with parameter "target=ts+dts" +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from enum connectrpc.eliza.v1.SayVolume + */ +export enum SayVolume { + /** + * @generated from enum value: SAY_VOLUME_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: SAY_VOLUME_LOUD = 1; + */ + LOUD = 1, + + /** + * @generated from enum value: SAY_VOLUME_SOFT = 2; + */ + SOFT = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(SayVolume) +proto3.util.setEnumType(SayVolume, "connectrpc.eliza.v1.SayVolume", [ + { no: 0, name: "SAY_VOLUME_UNSPECIFIED" }, + { no: 1, name: "SAY_VOLUME_LOUD" }, + { no: 2, name: "SAY_VOLUME_SOFT" }, +]); + +/** + * @generated from enum connectrpc.eliza.v1.ConverseVolume + */ +export enum ConverseVolume { + /** + * @generated from enum value: CONVERSE_VOLUME_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: CONVERSE_VOLUME_LOUD = 1; + */ + LOUD = 1, + + /** + * @generated from enum value: CONVERSE_VOLUME_SOFT = 2; + */ + SOFT = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(ConverseVolume) +proto3.util.setEnumType(ConverseVolume, "connectrpc.eliza.v1.ConverseVolume", [ + { no: 0, name: "CONVERSE_VOLUME_UNSPECIFIED" }, + { no: 1, name: "CONVERSE_VOLUME_LOUD" }, + { no: 2, name: "CONVERSE_VOLUME_SOFT" }, +]); + +/** + * SayRequest is a single-sentence request. + * + * @generated from message connectrpc.eliza.v1.SayRequest + */ +export class SayRequest extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + /** + * @generated from field: connectrpc.eliza.v1.SayVolume volume = 2; + */ + volume = SayVolume.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.SayRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "volume", kind: "enum", T: proto3.getEnumType(SayVolume) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SayRequest { + return new SayRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SayRequest { + return new SayRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SayRequest { + return new SayRequest().fromJsonString(jsonString, options); + } + + static equals(a: SayRequest | PlainMessage | undefined, b: SayRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(SayRequest, a, b); + } +} + +/** + * SayResponse is a single-sentence response. + * + * @generated from message connectrpc.eliza.v1.SayResponse + */ +export class SayResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.SayResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SayResponse { + return new SayResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SayResponse { + return new SayResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SayResponse { + return new SayResponse().fromJsonString(jsonString, options); + } + + static equals(a: SayResponse | PlainMessage | undefined, b: SayResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(SayResponse, a, b); + } +} + +/** + * ConverseRequest is a single sentence request sent as part of a + * back-and-forth conversation. + * + * @generated from message connectrpc.eliza.v1.ConverseRequest + */ +export class ConverseRequest extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + /** + * @generated from field: connectrpc.eliza.v1.ConverseVolume volume = 2; + */ + volume = ConverseVolume.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.ConverseRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "volume", kind: "enum", T: proto3.getEnumType(ConverseVolume) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ConverseRequest { + return new ConverseRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ConverseRequest { + return new ConverseRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ConverseRequest { + return new ConverseRequest().fromJsonString(jsonString, options); + } + + static equals(a: ConverseRequest | PlainMessage | undefined, b: ConverseRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ConverseRequest, a, b); + } +} + +/** + * ConverseResponse is a single sentence response sent in answer to a + * ConverseRequest. + * + * @generated from message connectrpc.eliza.v1.ConverseResponse + */ +export class ConverseResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.ConverseResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ConverseResponse { + return new ConverseResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ConverseResponse { + return new ConverseResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ConverseResponse { + return new ConverseResponse().fromJsonString(jsonString, options); + } + + static equals(a: ConverseResponse | PlainMessage | undefined, b: ConverseResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ConverseResponse, a, b); + } +} + +/** + * IntroduceRequest asks Eliza to introduce itself to the named user. + * + * @generated from message connectrpc.eliza.v1.IntroduceRequest + */ +export class IntroduceRequest extends Message { + /** + * @generated from field: string name = 1; + */ + name = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.IntroduceRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): IntroduceRequest { + return new IntroduceRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): IntroduceRequest { + return new IntroduceRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): IntroduceRequest { + return new IntroduceRequest().fromJsonString(jsonString, options); + } + + static equals(a: IntroduceRequest | PlainMessage | undefined, b: IntroduceRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(IntroduceRequest, a, b); + } +} + +/** + * IntroduceResponse is one sentence of Eliza's introductory monologue. + * + * @generated from message connectrpc.eliza.v1.IntroduceResponse + */ +export class IntroduceResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.IntroduceResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): IntroduceResponse { + return new IntroduceResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): IntroduceResponse { + return new IntroduceResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): IntroduceResponse { + return new IntroduceResponse().fromJsonString(jsonString, options); + } + + static equals(a: IntroduceResponse | PlainMessage | undefined, b: IntroduceResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(IntroduceResponse, a, b); + } +} + diff --git a/bundle-size/rollup/src/ts/index.ts b/bundle-size/rollup/src/ts/index.ts new file mode 100644 index 000000000..dbd4859c5 --- /dev/null +++ b/bundle-size/rollup/src/ts/index.ts @@ -0,0 +1,13 @@ +import { compressedFlag } from "@connectrpc/connect/protocol"; +import { SayRequest, SayVolume } from "./gen/connectrpc/eliza/v1/eliza_pb.js"; +import { proto3 } from "@bufbuild/protobuf"; + +const testEnum = proto3.getEnumType(SayVolume); + +if ( + compressedFlag === 1 && + SayRequest.typeName === "connectrpc.eliza.v1.SayRequest" && + testEnum.typeName === "connectrpc.eliza.v1.SayVolume" +) { + console.log("rollup (ts) OK"); +} diff --git a/bundle-size/vite/buf.gen.yaml b/bundle-size/vite/buf.gen.yaml deleted file mode 100644 index 21e57da6d..000000000 --- a/bundle-size/vite/buf.gen.yaml +++ /dev/null @@ -1,8 +0,0 @@ -version: v1 -plugins: - - name: es - out: src/gen - opt: target=js - - name: connect-es - out: src/gen - opt: target=js diff --git a/bundle-size/vite/package.json b/bundle-size/vite/package.json index 7c3d8ef78..943cf1e1d 100644 --- a/bundle-size/vite/package.json +++ b/bundle-size/vite/package.json @@ -2,10 +2,18 @@ "name": "consumer-vite", "scripts": { "pregenerate": "rm -rf dist", - "generate": "npx buf generate buf.build/connectrpc/eliza", - "build": "vite build" + "generate": "npx buf generate ../proto --template ../buf.gen.yaml", + "build": "npm run build:js && npm run build:ts", + "build:js": "vite build -c vite.config.js -l error", + "build:ts": "vite build -c vite.tsconfig.js -l error", + "test": "npm run test:js && npm run test:ts", + "test:js": "node dist/js/consumer-vite.js", + "test:ts": "node dist/ts/consumer-vite.js" + }, + "testOutputPaths": { + "js": "dist/js/consumer-vite.js", + "ts": "dist/ts/consumer-vite.js" }, - "testOutputPath": "dist/consumer-vite.js", "type": "module", "dependencies": { "@connectrpc/connect": "^1.3.0", diff --git a/bundle-size/vite/src/index.js b/bundle-size/vite/src/index.js deleted file mode 100644 index edc7a135e..000000000 --- a/bundle-size/vite/src/index.js +++ /dev/null @@ -1,5 +0,0 @@ -import {compressedFlag} from "@connectrpc/connect/protocol" -import {SayRequest} from "./gen/connectrpc/eliza/v1/eliza_pb.js"; - -console.log(compressedFlag); -console.log(SayRequest); diff --git a/bundle-size/vite/src/gen/connectrpc/eliza/v1/eliza_connect.js b/bundle-size/vite/src/js/gen/connectrpc/eliza/v1/eliza_connect.js similarity index 100% rename from bundle-size/vite/src/gen/connectrpc/eliza/v1/eliza_connect.js rename to bundle-size/vite/src/js/gen/connectrpc/eliza/v1/eliza_connect.js diff --git a/bundle-size/vite/src/gen/connectrpc/eliza/v1/eliza_pb.js b/bundle-size/vite/src/js/gen/connectrpc/eliza/v1/eliza_pb.js similarity index 76% rename from bundle-size/vite/src/gen/connectrpc/eliza/v1/eliza_pb.js rename to bundle-size/vite/src/js/gen/connectrpc/eliza/v1/eliza_pb.js index edf8ada35..8afe1053a 100644 --- a/bundle-size/vite/src/gen/connectrpc/eliza/v1/eliza_pb.js +++ b/bundle-size/vite/src/js/gen/connectrpc/eliza/v1/eliza_pb.js @@ -19,6 +19,30 @@ import { proto3 } from "@bufbuild/protobuf"; +/** + * @generated from enum connectrpc.eliza.v1.SayVolume + */ +export const SayVolume = proto3.makeEnum( + "connectrpc.eliza.v1.SayVolume", + [ + {no: 0, name: "SAY_VOLUME_UNSPECIFIED", localName: "UNSPECIFIED"}, + {no: 1, name: "SAY_VOLUME_LOUD", localName: "LOUD"}, + {no: 2, name: "SAY_VOLUME_SOFT", localName: "SOFT"}, + ], +); + +/** + * @generated from enum connectrpc.eliza.v1.ConverseVolume + */ +export const ConverseVolume = proto3.makeEnum( + "connectrpc.eliza.v1.ConverseVolume", + [ + {no: 0, name: "CONVERSE_VOLUME_UNSPECIFIED", localName: "UNSPECIFIED"}, + {no: 1, name: "CONVERSE_VOLUME_LOUD", localName: "LOUD"}, + {no: 2, name: "CONVERSE_VOLUME_SOFT", localName: "SOFT"}, + ], +); + /** * SayRequest is a single-sentence request. * @@ -28,6 +52,7 @@ export const SayRequest = proto3.makeMessageType( "connectrpc.eliza.v1.SayRequest", () => [ { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "volume", kind: "enum", T: proto3.getEnumType(SayVolume) }, ], ); @@ -53,6 +78,7 @@ export const ConverseRequest = proto3.makeMessageType( "connectrpc.eliza.v1.ConverseRequest", () => [ { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "volume", kind: "enum", T: proto3.getEnumType(ConverseVolume) }, ], ); diff --git a/bundle-size/vite/src/js/index.js b/bundle-size/vite/src/js/index.js new file mode 100644 index 000000000..bbffe66a1 --- /dev/null +++ b/bundle-size/vite/src/js/index.js @@ -0,0 +1,13 @@ +import { compressedFlag } from "@connectrpc/connect/protocol"; +import { SayRequest, SayVolume } from "./gen/connectrpc/eliza/v1/eliza_pb.js"; +import { proto3 } from "@bufbuild/protobuf"; + +const testEnum = proto3.getEnumType(SayVolume); + +if ( + compressedFlag === 1 && + SayRequest.typeName === "connectrpc.eliza.v1.SayRequest" && + testEnum.typeName === "connectrpc.eliza.v1.SayVolume" +) { + console.log("vite (js) OK"); +} diff --git a/bundle-size/vite/src/ts/gen/connectrpc/eliza/v1/eliza_connect.d.ts b/bundle-size/vite/src/ts/gen/connectrpc/eliza/v1/eliza_connect.d.ts new file mode 100644 index 000000000..1e5282a6c --- /dev/null +++ b/bundle-size/vite/src/ts/gen/connectrpc/eliza/v1/eliza_connect.d.ts @@ -0,0 +1,75 @@ +// Copyright 2022-2023 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-connect-es v1.3.0 with parameter "target=ts+dts" +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { ConverseRequest, ConverseResponse, IntroduceRequest, IntroduceResponse, SayRequest, SayResponse } from "./eliza_pb.js"; +import { MethodIdempotency, MethodKind } from "@bufbuild/protobuf"; + +/** + * ElizaService provides a way to talk to Eliza, a port of the DOCTOR script + * for Joseph Weizenbaum's original ELIZA program. Created in the mid-1960s at + * the MIT Artificial Intelligence Laboratory, ELIZA demonstrates the + * superficiality of human-computer communication. DOCTOR simulates a + * psychotherapist, and is commonly found as an Easter egg in emacs + * distributions. + * + * @generated from service connectrpc.eliza.v1.ElizaService + */ +export declare const ElizaService: { + readonly typeName: "connectrpc.eliza.v1.ElizaService", + readonly methods: { + /** + * Say is a unary RPC. Eliza responds to the prompt with a single sentence. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Say + */ + readonly say: { + readonly name: "Say", + readonly I: typeof SayRequest, + readonly O: typeof SayResponse, + readonly kind: MethodKind.Unary, + readonly idempotency: MethodIdempotency.NoSideEffects, + }, + /** + * Converse is a bidirectional RPC. The caller may exchange multiple + * back-and-forth messages with Eliza over a long-lived connection. Eliza + * responds to each ConverseRequest with a ConverseResponse. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Converse + */ + readonly converse: { + readonly name: "Converse", + readonly I: typeof ConverseRequest, + readonly O: typeof ConverseResponse, + readonly kind: MethodKind.BiDiStreaming, + }, + /** + * Introduce is a server streaming RPC. Given the caller's name, Eliza + * returns a stream of sentences to introduce itself. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Introduce + */ + readonly introduce: { + readonly name: "Introduce", + readonly I: typeof IntroduceRequest, + readonly O: typeof IntroduceResponse, + readonly kind: MethodKind.ServerStreaming, + }, + } +}; + diff --git a/bundle-size/vite/src/ts/gen/connectrpc/eliza/v1/eliza_connect.ts b/bundle-size/vite/src/ts/gen/connectrpc/eliza/v1/eliza_connect.ts new file mode 100644 index 000000000..193f2f45a --- /dev/null +++ b/bundle-size/vite/src/ts/gen/connectrpc/eliza/v1/eliza_connect.ts @@ -0,0 +1,75 @@ +// Copyright 2022-2023 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-connect-es v1.3.0 with parameter "target=ts+dts" +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { ConverseRequest, ConverseResponse, IntroduceRequest, IntroduceResponse, SayRequest, SayResponse } from "./eliza_pb.js"; +import { MethodIdempotency, MethodKind } from "@bufbuild/protobuf"; + +/** + * ElizaService provides a way to talk to Eliza, a port of the DOCTOR script + * for Joseph Weizenbaum's original ELIZA program. Created in the mid-1960s at + * the MIT Artificial Intelligence Laboratory, ELIZA demonstrates the + * superficiality of human-computer communication. DOCTOR simulates a + * psychotherapist, and is commonly found as an Easter egg in emacs + * distributions. + * + * @generated from service connectrpc.eliza.v1.ElizaService + */ +export const ElizaService = { + typeName: "connectrpc.eliza.v1.ElizaService", + methods: { + /** + * Say is a unary RPC. Eliza responds to the prompt with a single sentence. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Say + */ + say: { + name: "Say", + I: SayRequest, + O: SayResponse, + kind: MethodKind.Unary, + idempotency: MethodIdempotency.NoSideEffects, + }, + /** + * Converse is a bidirectional RPC. The caller may exchange multiple + * back-and-forth messages with Eliza over a long-lived connection. Eliza + * responds to each ConverseRequest with a ConverseResponse. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Converse + */ + converse: { + name: "Converse", + I: ConverseRequest, + O: ConverseResponse, + kind: MethodKind.BiDiStreaming, + }, + /** + * Introduce is a server streaming RPC. Given the caller's name, Eliza + * returns a stream of sentences to introduce itself. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Introduce + */ + introduce: { + name: "Introduce", + I: IntroduceRequest, + O: IntroduceResponse, + kind: MethodKind.ServerStreaming, + }, + } +} as const; + diff --git a/bundle-size/vite/src/ts/gen/connectrpc/eliza/v1/eliza_pb.d.ts b/bundle-size/vite/src/ts/gen/connectrpc/eliza/v1/eliza_pb.d.ts new file mode 100644 index 000000000..b50630de8 --- /dev/null +++ b/bundle-size/vite/src/ts/gen/connectrpc/eliza/v1/eliza_pb.d.ts @@ -0,0 +1,230 @@ +// Copyright 2022-2023 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-es v1.7.2 with parameter "target=ts+dts" +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from enum connectrpc.eliza.v1.SayVolume + */ +export declare enum SayVolume { + /** + * @generated from enum value: SAY_VOLUME_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: SAY_VOLUME_LOUD = 1; + */ + LOUD = 1, + + /** + * @generated from enum value: SAY_VOLUME_SOFT = 2; + */ + SOFT = 2, +} + +/** + * @generated from enum connectrpc.eliza.v1.ConverseVolume + */ +export declare enum ConverseVolume { + /** + * @generated from enum value: CONVERSE_VOLUME_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: CONVERSE_VOLUME_LOUD = 1; + */ + LOUD = 1, + + /** + * @generated from enum value: CONVERSE_VOLUME_SOFT = 2; + */ + SOFT = 2, +} + +/** + * SayRequest is a single-sentence request. + * + * @generated from message connectrpc.eliza.v1.SayRequest + */ +export declare class SayRequest extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + /** + * @generated from field: connectrpc.eliza.v1.SayVolume volume = 2; + */ + volume: SayVolume; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.SayRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): SayRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): SayRequest; + + static fromJsonString(jsonString: string, options?: Partial): SayRequest; + + static equals(a: SayRequest | PlainMessage | undefined, b: SayRequest | PlainMessage | undefined): boolean; +} + +/** + * SayResponse is a single-sentence response. + * + * @generated from message connectrpc.eliza.v1.SayResponse + */ +export declare class SayResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.SayResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): SayResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): SayResponse; + + static fromJsonString(jsonString: string, options?: Partial): SayResponse; + + static equals(a: SayResponse | PlainMessage | undefined, b: SayResponse | PlainMessage | undefined): boolean; +} + +/** + * ConverseRequest is a single sentence request sent as part of a + * back-and-forth conversation. + * + * @generated from message connectrpc.eliza.v1.ConverseRequest + */ +export declare class ConverseRequest extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + /** + * @generated from field: connectrpc.eliza.v1.ConverseVolume volume = 2; + */ + volume: ConverseVolume; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.ConverseRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): ConverseRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): ConverseRequest; + + static fromJsonString(jsonString: string, options?: Partial): ConverseRequest; + + static equals(a: ConverseRequest | PlainMessage | undefined, b: ConverseRequest | PlainMessage | undefined): boolean; +} + +/** + * ConverseResponse is a single sentence response sent in answer to a + * ConverseRequest. + * + * @generated from message connectrpc.eliza.v1.ConverseResponse + */ +export declare class ConverseResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.ConverseResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): ConverseResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): ConverseResponse; + + static fromJsonString(jsonString: string, options?: Partial): ConverseResponse; + + static equals(a: ConverseResponse | PlainMessage | undefined, b: ConverseResponse | PlainMessage | undefined): boolean; +} + +/** + * IntroduceRequest asks Eliza to introduce itself to the named user. + * + * @generated from message connectrpc.eliza.v1.IntroduceRequest + */ +export declare class IntroduceRequest extends Message { + /** + * @generated from field: string name = 1; + */ + name: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.IntroduceRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): IntroduceRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): IntroduceRequest; + + static fromJsonString(jsonString: string, options?: Partial): IntroduceRequest; + + static equals(a: IntroduceRequest | PlainMessage | undefined, b: IntroduceRequest | PlainMessage | undefined): boolean; +} + +/** + * IntroduceResponse is one sentence of Eliza's introductory monologue. + * + * @generated from message connectrpc.eliza.v1.IntroduceResponse + */ +export declare class IntroduceResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.IntroduceResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): IntroduceResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): IntroduceResponse; + + static fromJsonString(jsonString: string, options?: Partial): IntroduceResponse; + + static equals(a: IntroduceResponse | PlainMessage | undefined, b: IntroduceResponse | PlainMessage | undefined): boolean; +} + diff --git a/bundle-size/vite/src/ts/gen/connectrpc/eliza/v1/eliza_pb.ts b/bundle-size/vite/src/ts/gen/connectrpc/eliza/v1/eliza_pb.ts new file mode 100644 index 000000000..78d081ae0 --- /dev/null +++ b/bundle-size/vite/src/ts/gen/connectrpc/eliza/v1/eliza_pb.ts @@ -0,0 +1,322 @@ +// Copyright 2022-2023 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-es v1.7.2 with parameter "target=ts+dts" +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from enum connectrpc.eliza.v1.SayVolume + */ +export enum SayVolume { + /** + * @generated from enum value: SAY_VOLUME_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: SAY_VOLUME_LOUD = 1; + */ + LOUD = 1, + + /** + * @generated from enum value: SAY_VOLUME_SOFT = 2; + */ + SOFT = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(SayVolume) +proto3.util.setEnumType(SayVolume, "connectrpc.eliza.v1.SayVolume", [ + { no: 0, name: "SAY_VOLUME_UNSPECIFIED" }, + { no: 1, name: "SAY_VOLUME_LOUD" }, + { no: 2, name: "SAY_VOLUME_SOFT" }, +]); + +/** + * @generated from enum connectrpc.eliza.v1.ConverseVolume + */ +export enum ConverseVolume { + /** + * @generated from enum value: CONVERSE_VOLUME_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: CONVERSE_VOLUME_LOUD = 1; + */ + LOUD = 1, + + /** + * @generated from enum value: CONVERSE_VOLUME_SOFT = 2; + */ + SOFT = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(ConverseVolume) +proto3.util.setEnumType(ConverseVolume, "connectrpc.eliza.v1.ConverseVolume", [ + { no: 0, name: "CONVERSE_VOLUME_UNSPECIFIED" }, + { no: 1, name: "CONVERSE_VOLUME_LOUD" }, + { no: 2, name: "CONVERSE_VOLUME_SOFT" }, +]); + +/** + * SayRequest is a single-sentence request. + * + * @generated from message connectrpc.eliza.v1.SayRequest + */ +export class SayRequest extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + /** + * @generated from field: connectrpc.eliza.v1.SayVolume volume = 2; + */ + volume = SayVolume.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.SayRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "volume", kind: "enum", T: proto3.getEnumType(SayVolume) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SayRequest { + return new SayRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SayRequest { + return new SayRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SayRequest { + return new SayRequest().fromJsonString(jsonString, options); + } + + static equals(a: SayRequest | PlainMessage | undefined, b: SayRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(SayRequest, a, b); + } +} + +/** + * SayResponse is a single-sentence response. + * + * @generated from message connectrpc.eliza.v1.SayResponse + */ +export class SayResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.SayResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SayResponse { + return new SayResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SayResponse { + return new SayResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SayResponse { + return new SayResponse().fromJsonString(jsonString, options); + } + + static equals(a: SayResponse | PlainMessage | undefined, b: SayResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(SayResponse, a, b); + } +} + +/** + * ConverseRequest is a single sentence request sent as part of a + * back-and-forth conversation. + * + * @generated from message connectrpc.eliza.v1.ConverseRequest + */ +export class ConverseRequest extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + /** + * @generated from field: connectrpc.eliza.v1.ConverseVolume volume = 2; + */ + volume = ConverseVolume.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.ConverseRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "volume", kind: "enum", T: proto3.getEnumType(ConverseVolume) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ConverseRequest { + return new ConverseRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ConverseRequest { + return new ConverseRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ConverseRequest { + return new ConverseRequest().fromJsonString(jsonString, options); + } + + static equals(a: ConverseRequest | PlainMessage | undefined, b: ConverseRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ConverseRequest, a, b); + } +} + +/** + * ConverseResponse is a single sentence response sent in answer to a + * ConverseRequest. + * + * @generated from message connectrpc.eliza.v1.ConverseResponse + */ +export class ConverseResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.ConverseResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ConverseResponse { + return new ConverseResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ConverseResponse { + return new ConverseResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ConverseResponse { + return new ConverseResponse().fromJsonString(jsonString, options); + } + + static equals(a: ConverseResponse | PlainMessage | undefined, b: ConverseResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ConverseResponse, a, b); + } +} + +/** + * IntroduceRequest asks Eliza to introduce itself to the named user. + * + * @generated from message connectrpc.eliza.v1.IntroduceRequest + */ +export class IntroduceRequest extends Message { + /** + * @generated from field: string name = 1; + */ + name = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.IntroduceRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): IntroduceRequest { + return new IntroduceRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): IntroduceRequest { + return new IntroduceRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): IntroduceRequest { + return new IntroduceRequest().fromJsonString(jsonString, options); + } + + static equals(a: IntroduceRequest | PlainMessage | undefined, b: IntroduceRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(IntroduceRequest, a, b); + } +} + +/** + * IntroduceResponse is one sentence of Eliza's introductory monologue. + * + * @generated from message connectrpc.eliza.v1.IntroduceResponse + */ +export class IntroduceResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.IntroduceResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): IntroduceResponse { + return new IntroduceResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): IntroduceResponse { + return new IntroduceResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): IntroduceResponse { + return new IntroduceResponse().fromJsonString(jsonString, options); + } + + static equals(a: IntroduceResponse | PlainMessage | undefined, b: IntroduceResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(IntroduceResponse, a, b); + } +} + diff --git a/bundle-size/vite/src/ts/index.ts b/bundle-size/vite/src/ts/index.ts new file mode 100644 index 000000000..a2ab55c77 --- /dev/null +++ b/bundle-size/vite/src/ts/index.ts @@ -0,0 +1,13 @@ +import { compressedFlag } from "@connectrpc/connect/protocol"; +import { SayRequest, SayVolume } from "./gen/connectrpc/eliza/v1/eliza_pb.js"; +import { proto3 } from "@bufbuild/protobuf"; + +const testEnum = proto3.getEnumType(SayVolume); + +if ( + compressedFlag === 1 && + SayRequest.typeName === "connectrpc.eliza.v1.SayRequest" && + testEnum.typeName === "connectrpc.eliza.v1.SayVolume" +) { + console.log("vite (ts) OK"); +} diff --git a/bundle-size/vite/vite.config.js b/bundle-size/vite/vite.config.js index 2f9fb4460..5ff0107ca 100644 --- a/bundle-size/vite/vite.config.js +++ b/bundle-size/vite/vite.config.js @@ -2,10 +2,11 @@ import { defineConfig } from 'vite' export default defineConfig({ - build: { - lib: { - entry: "src/index.js", - name: "index" - } - }, + build: { + outDir: "dist/js", + lib: { + entry: "src/js/index.js", + name: "index" + } + }, }) diff --git a/bundle-size/vite/vite.tsconfig.js b/bundle-size/vite/vite.tsconfig.js new file mode 100644 index 000000000..b3d52b4a5 --- /dev/null +++ b/bundle-size/vite/vite.tsconfig.js @@ -0,0 +1,12 @@ +// vite.config.js +import { defineConfig } from 'vite' + +export default defineConfig({ + build: { + outDir: "dist/ts", + lib: { + entry: "src/ts/index.ts", + name: "index" + } + }, +}) diff --git a/bundle-size/webpack-ts/buf.gen.yaml b/bundle-size/webpack-ts/buf.gen.yaml deleted file mode 100644 index 21e57da6d..000000000 --- a/bundle-size/webpack-ts/buf.gen.yaml +++ /dev/null @@ -1,8 +0,0 @@ -version: v1 -plugins: - - name: es - out: src/gen - opt: target=js - - name: connect-es - out: src/gen - opt: target=js diff --git a/bundle-size/webpack-ts/package.json b/bundle-size/webpack-ts/package.json deleted file mode 100644 index 9190264a6..000000000 --- a/bundle-size/webpack-ts/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "consumer-webpack-ts", - "type": "module", - "dependencies": { - "@connectrpc/connect": "^1.3.0", - "@bufbuild/protobuf": "^1.7.2" - }, - "devDependencies": { - "ts-loader": "^9.4.4", - "typescript": "^5.2.2", - "webpack": "5.88.2", - "webpack-cli": "^5.1.4", - "@bufbuild/buf": "^1.29.0", - "@bufbuild/protoc-gen-es": "^1.7.2", - "@connectrpc/protoc-gen-connect-es": "^1.3.0" - }, - "scripts": { - "pregenerate": "rm -rf dist", - "generate": "npx buf generate buf.build/connectrpc/eliza", - "build": "webpack --no-stats -o dist" - }, - "testOutputPath": "dist/bundle.js" -} diff --git a/bundle-size/webpack-ts/src/gen/connectrpc/eliza/v1/eliza_pb.js b/bundle-size/webpack-ts/src/gen/connectrpc/eliza/v1/eliza_pb.js deleted file mode 100644 index edf8ada35..000000000 --- a/bundle-size/webpack-ts/src/gen/connectrpc/eliza/v1/eliza_pb.js +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2022-2023 The Connect Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// @generated by protoc-gen-es v1.7.2 with parameter "target=js" -// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import { proto3 } from "@bufbuild/protobuf"; - -/** - * SayRequest is a single-sentence request. - * - * @generated from message connectrpc.eliza.v1.SayRequest - */ -export const SayRequest = proto3.makeMessageType( - "connectrpc.eliza.v1.SayRequest", - () => [ - { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - -/** - * SayResponse is a single-sentence response. - * - * @generated from message connectrpc.eliza.v1.SayResponse - */ -export const SayResponse = proto3.makeMessageType( - "connectrpc.eliza.v1.SayResponse", - () => [ - { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - -/** - * ConverseRequest is a single sentence request sent as part of a - * back-and-forth conversation. - * - * @generated from message connectrpc.eliza.v1.ConverseRequest - */ -export const ConverseRequest = proto3.makeMessageType( - "connectrpc.eliza.v1.ConverseRequest", - () => [ - { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - -/** - * ConverseResponse is a single sentence response sent in answer to a - * ConverseRequest. - * - * @generated from message connectrpc.eliza.v1.ConverseResponse - */ -export const ConverseResponse = proto3.makeMessageType( - "connectrpc.eliza.v1.ConverseResponse", - () => [ - { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - -/** - * IntroduceRequest asks Eliza to introduce itself to the named user. - * - * @generated from message connectrpc.eliza.v1.IntroduceRequest - */ -export const IntroduceRequest = proto3.makeMessageType( - "connectrpc.eliza.v1.IntroduceRequest", - () => [ - { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - -/** - * IntroduceResponse is one sentence of Eliza's introductory monologue. - * - * @generated from message connectrpc.eliza.v1.IntroduceResponse - */ -export const IntroduceResponse = proto3.makeMessageType( - "connectrpc.eliza.v1.IntroduceResponse", - () => [ - { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - diff --git a/bundle-size/webpack-ts/src/index.ts b/bundle-size/webpack-ts/src/index.ts deleted file mode 100644 index edc7a135e..000000000 --- a/bundle-size/webpack-ts/src/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {compressedFlag} from "@connectrpc/connect/protocol" -import {SayRequest} from "./gen/connectrpc/eliza/v1/eliza_pb.js"; - -console.log(compressedFlag); -console.log(SayRequest); diff --git a/bundle-size/webpack/buf.gen.yaml b/bundle-size/webpack/buf.gen.yaml deleted file mode 100644 index 21e57da6d..000000000 --- a/bundle-size/webpack/buf.gen.yaml +++ /dev/null @@ -1,8 +0,0 @@ -version: v1 -plugins: - - name: es - out: src/gen - opt: target=js - - name: connect-es - out: src/gen - opt: target=js diff --git a/bundle-size/webpack/package.json b/bundle-size/webpack/package.json index 967cff204..9627a7c58 100644 --- a/bundle-size/webpack/package.json +++ b/bundle-size/webpack/package.json @@ -2,20 +2,30 @@ "name": "consumer-webpack", "scripts": { "pregenerate": "rm -rf dist", - "generate": "npx buf generate buf.build/connectrpc/eliza", - "build": "webpack --no-stats --entry ./src/index.js -o dist" + "generate": "npx buf generate ../proto --template ../buf.gen.yaml", + "build": "npm run build:js && npm run build:ts", + "build:js": "webpack --no-stats --entry ./src/js/index.js -o dist/js", + "build:ts": "webpack --no-stats --entry ./src/ts/index.ts -o dist/ts --config src/webpack.config.cjs", + "test": "npm run test:js && npm run test:ts", + "test:js": "node dist/js/main.js", + "test:ts": "node dist/ts/main.js" + }, + "testOutputPaths": { + "js": "dist/js/main.js", + "ts": "dist/ts/main.js" }, - "testOutputPath": "dist/main.js", "type": "module", "dependencies": { + "@bufbuild/protobuf": "^1.7.2", "@connectrpc/connect": "^1.3.0", - "@bufbuild/protobuf": "^1.7.2" + "ts-loader": "^9.5.1", + "typescript": "^5.4.2" }, "devDependencies": { - "webpack": "5.88.2", - "webpack-cli": "^5.1.4", "@bufbuild/buf": "^1.29.0", "@bufbuild/protoc-gen-es": "^1.7.2", - "@connectrpc/protoc-gen-connect-es": "^1.3.0" + "@connectrpc/protoc-gen-connect-es": "^1.3.0", + "webpack": "5.88.2", + "webpack-cli": "^5.1.4" } } diff --git a/bundle-size/webpack/src/gen/connectrpc/eliza/v1/eliza_pb.js b/bundle-size/webpack/src/gen/connectrpc/eliza/v1/eliza_pb.js deleted file mode 100644 index edf8ada35..000000000 --- a/bundle-size/webpack/src/gen/connectrpc/eliza/v1/eliza_pb.js +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2022-2023 The Connect Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// @generated by protoc-gen-es v1.7.2 with parameter "target=js" -// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import { proto3 } from "@bufbuild/protobuf"; - -/** - * SayRequest is a single-sentence request. - * - * @generated from message connectrpc.eliza.v1.SayRequest - */ -export const SayRequest = proto3.makeMessageType( - "connectrpc.eliza.v1.SayRequest", - () => [ - { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - -/** - * SayResponse is a single-sentence response. - * - * @generated from message connectrpc.eliza.v1.SayResponse - */ -export const SayResponse = proto3.makeMessageType( - "connectrpc.eliza.v1.SayResponse", - () => [ - { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - -/** - * ConverseRequest is a single sentence request sent as part of a - * back-and-forth conversation. - * - * @generated from message connectrpc.eliza.v1.ConverseRequest - */ -export const ConverseRequest = proto3.makeMessageType( - "connectrpc.eliza.v1.ConverseRequest", - () => [ - { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - -/** - * ConverseResponse is a single sentence response sent in answer to a - * ConverseRequest. - * - * @generated from message connectrpc.eliza.v1.ConverseResponse - */ -export const ConverseResponse = proto3.makeMessageType( - "connectrpc.eliza.v1.ConverseResponse", - () => [ - { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - -/** - * IntroduceRequest asks Eliza to introduce itself to the named user. - * - * @generated from message connectrpc.eliza.v1.IntroduceRequest - */ -export const IntroduceRequest = proto3.makeMessageType( - "connectrpc.eliza.v1.IntroduceRequest", - () => [ - { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - -/** - * IntroduceResponse is one sentence of Eliza's introductory monologue. - * - * @generated from message connectrpc.eliza.v1.IntroduceResponse - */ -export const IntroduceResponse = proto3.makeMessageType( - "connectrpc.eliza.v1.IntroduceResponse", - () => [ - { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - diff --git a/bundle-size/webpack/src/index.js b/bundle-size/webpack/src/index.js deleted file mode 100644 index edc7a135e..000000000 --- a/bundle-size/webpack/src/index.js +++ /dev/null @@ -1,5 +0,0 @@ -import {compressedFlag} from "@connectrpc/connect/protocol" -import {SayRequest} from "./gen/connectrpc/eliza/v1/eliza_pb.js"; - -console.log(compressedFlag); -console.log(SayRequest); diff --git a/bundle-size/webpack-ts/src/gen/connectrpc/eliza/v1/eliza_connect.js b/bundle-size/webpack/src/js/gen/connectrpc/eliza/v1/eliza_connect.js similarity index 100% rename from bundle-size/webpack-ts/src/gen/connectrpc/eliza/v1/eliza_connect.js rename to bundle-size/webpack/src/js/gen/connectrpc/eliza/v1/eliza_connect.js diff --git a/bundle-size/webpack/src/js/gen/connectrpc/eliza/v1/eliza_pb.js b/bundle-size/webpack/src/js/gen/connectrpc/eliza/v1/eliza_pb.js new file mode 100644 index 000000000..8afe1053a --- /dev/null +++ b/bundle-size/webpack/src/js/gen/connectrpc/eliza/v1/eliza_pb.js @@ -0,0 +1,121 @@ +// Copyright 2022-2023 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-es v1.7.2 with parameter "target=js" +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from enum connectrpc.eliza.v1.SayVolume + */ +export const SayVolume = proto3.makeEnum( + "connectrpc.eliza.v1.SayVolume", + [ + {no: 0, name: "SAY_VOLUME_UNSPECIFIED", localName: "UNSPECIFIED"}, + {no: 1, name: "SAY_VOLUME_LOUD", localName: "LOUD"}, + {no: 2, name: "SAY_VOLUME_SOFT", localName: "SOFT"}, + ], +); + +/** + * @generated from enum connectrpc.eliza.v1.ConverseVolume + */ +export const ConverseVolume = proto3.makeEnum( + "connectrpc.eliza.v1.ConverseVolume", + [ + {no: 0, name: "CONVERSE_VOLUME_UNSPECIFIED", localName: "UNSPECIFIED"}, + {no: 1, name: "CONVERSE_VOLUME_LOUD", localName: "LOUD"}, + {no: 2, name: "CONVERSE_VOLUME_SOFT", localName: "SOFT"}, + ], +); + +/** + * SayRequest is a single-sentence request. + * + * @generated from message connectrpc.eliza.v1.SayRequest + */ +export const SayRequest = proto3.makeMessageType( + "connectrpc.eliza.v1.SayRequest", + () => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "volume", kind: "enum", T: proto3.getEnumType(SayVolume) }, + ], +); + +/** + * SayResponse is a single-sentence response. + * + * @generated from message connectrpc.eliza.v1.SayResponse + */ +export const SayResponse = proto3.makeMessageType( + "connectrpc.eliza.v1.SayResponse", + () => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ], +); + +/** + * ConverseRequest is a single sentence request sent as part of a + * back-and-forth conversation. + * + * @generated from message connectrpc.eliza.v1.ConverseRequest + */ +export const ConverseRequest = proto3.makeMessageType( + "connectrpc.eliza.v1.ConverseRequest", + () => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "volume", kind: "enum", T: proto3.getEnumType(ConverseVolume) }, + ], +); + +/** + * ConverseResponse is a single sentence response sent in answer to a + * ConverseRequest. + * + * @generated from message connectrpc.eliza.v1.ConverseResponse + */ +export const ConverseResponse = proto3.makeMessageType( + "connectrpc.eliza.v1.ConverseResponse", + () => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ], +); + +/** + * IntroduceRequest asks Eliza to introduce itself to the named user. + * + * @generated from message connectrpc.eliza.v1.IntroduceRequest + */ +export const IntroduceRequest = proto3.makeMessageType( + "connectrpc.eliza.v1.IntroduceRequest", + () => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ], +); + +/** + * IntroduceResponse is one sentence of Eliza's introductory monologue. + * + * @generated from message connectrpc.eliza.v1.IntroduceResponse + */ +export const IntroduceResponse = proto3.makeMessageType( + "connectrpc.eliza.v1.IntroduceResponse", + () => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ], +); + diff --git a/bundle-size/webpack/src/js/index.js b/bundle-size/webpack/src/js/index.js new file mode 100644 index 000000000..da95ef277 --- /dev/null +++ b/bundle-size/webpack/src/js/index.js @@ -0,0 +1,13 @@ +import { compressedFlag } from "@connectrpc/connect/protocol"; +import { SayRequest, SayVolume } from "./gen/connectrpc/eliza/v1/eliza_pb.js"; +import { proto3 } from "@bufbuild/protobuf"; + +const testEnum = proto3.getEnumType(SayVolume); + +if ( + compressedFlag === 1 && + SayRequest.typeName === "connectrpc.eliza.v1.SayRequest" && + testEnum.typeName === "connectrpc.eliza.v1.SayVolume" +) { + console.log("webpack (js) OK"); +} diff --git a/bundle-size/webpack/src/ts/gen/connectrpc/eliza/v1/eliza_connect.d.ts b/bundle-size/webpack/src/ts/gen/connectrpc/eliza/v1/eliza_connect.d.ts new file mode 100644 index 000000000..1e5282a6c --- /dev/null +++ b/bundle-size/webpack/src/ts/gen/connectrpc/eliza/v1/eliza_connect.d.ts @@ -0,0 +1,75 @@ +// Copyright 2022-2023 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-connect-es v1.3.0 with parameter "target=ts+dts" +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { ConverseRequest, ConverseResponse, IntroduceRequest, IntroduceResponse, SayRequest, SayResponse } from "./eliza_pb.js"; +import { MethodIdempotency, MethodKind } from "@bufbuild/protobuf"; + +/** + * ElizaService provides a way to talk to Eliza, a port of the DOCTOR script + * for Joseph Weizenbaum's original ELIZA program. Created in the mid-1960s at + * the MIT Artificial Intelligence Laboratory, ELIZA demonstrates the + * superficiality of human-computer communication. DOCTOR simulates a + * psychotherapist, and is commonly found as an Easter egg in emacs + * distributions. + * + * @generated from service connectrpc.eliza.v1.ElizaService + */ +export declare const ElizaService: { + readonly typeName: "connectrpc.eliza.v1.ElizaService", + readonly methods: { + /** + * Say is a unary RPC. Eliza responds to the prompt with a single sentence. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Say + */ + readonly say: { + readonly name: "Say", + readonly I: typeof SayRequest, + readonly O: typeof SayResponse, + readonly kind: MethodKind.Unary, + readonly idempotency: MethodIdempotency.NoSideEffects, + }, + /** + * Converse is a bidirectional RPC. The caller may exchange multiple + * back-and-forth messages with Eliza over a long-lived connection. Eliza + * responds to each ConverseRequest with a ConverseResponse. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Converse + */ + readonly converse: { + readonly name: "Converse", + readonly I: typeof ConverseRequest, + readonly O: typeof ConverseResponse, + readonly kind: MethodKind.BiDiStreaming, + }, + /** + * Introduce is a server streaming RPC. Given the caller's name, Eliza + * returns a stream of sentences to introduce itself. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Introduce + */ + readonly introduce: { + readonly name: "Introduce", + readonly I: typeof IntroduceRequest, + readonly O: typeof IntroduceResponse, + readonly kind: MethodKind.ServerStreaming, + }, + } +}; + diff --git a/bundle-size/webpack/src/ts/gen/connectrpc/eliza/v1/eliza_connect.ts b/bundle-size/webpack/src/ts/gen/connectrpc/eliza/v1/eliza_connect.ts new file mode 100644 index 000000000..193f2f45a --- /dev/null +++ b/bundle-size/webpack/src/ts/gen/connectrpc/eliza/v1/eliza_connect.ts @@ -0,0 +1,75 @@ +// Copyright 2022-2023 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-connect-es v1.3.0 with parameter "target=ts+dts" +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { ConverseRequest, ConverseResponse, IntroduceRequest, IntroduceResponse, SayRequest, SayResponse } from "./eliza_pb.js"; +import { MethodIdempotency, MethodKind } from "@bufbuild/protobuf"; + +/** + * ElizaService provides a way to talk to Eliza, a port of the DOCTOR script + * for Joseph Weizenbaum's original ELIZA program. Created in the mid-1960s at + * the MIT Artificial Intelligence Laboratory, ELIZA demonstrates the + * superficiality of human-computer communication. DOCTOR simulates a + * psychotherapist, and is commonly found as an Easter egg in emacs + * distributions. + * + * @generated from service connectrpc.eliza.v1.ElizaService + */ +export const ElizaService = { + typeName: "connectrpc.eliza.v1.ElizaService", + methods: { + /** + * Say is a unary RPC. Eliza responds to the prompt with a single sentence. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Say + */ + say: { + name: "Say", + I: SayRequest, + O: SayResponse, + kind: MethodKind.Unary, + idempotency: MethodIdempotency.NoSideEffects, + }, + /** + * Converse is a bidirectional RPC. The caller may exchange multiple + * back-and-forth messages with Eliza over a long-lived connection. Eliza + * responds to each ConverseRequest with a ConverseResponse. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Converse + */ + converse: { + name: "Converse", + I: ConverseRequest, + O: ConverseResponse, + kind: MethodKind.BiDiStreaming, + }, + /** + * Introduce is a server streaming RPC. Given the caller's name, Eliza + * returns a stream of sentences to introduce itself. + * + * @generated from rpc connectrpc.eliza.v1.ElizaService.Introduce + */ + introduce: { + name: "Introduce", + I: IntroduceRequest, + O: IntroduceResponse, + kind: MethodKind.ServerStreaming, + }, + } +} as const; + diff --git a/bundle-size/webpack/src/ts/gen/connectrpc/eliza/v1/eliza_pb.d.ts b/bundle-size/webpack/src/ts/gen/connectrpc/eliza/v1/eliza_pb.d.ts new file mode 100644 index 000000000..b50630de8 --- /dev/null +++ b/bundle-size/webpack/src/ts/gen/connectrpc/eliza/v1/eliza_pb.d.ts @@ -0,0 +1,230 @@ +// Copyright 2022-2023 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-es v1.7.2 with parameter "target=ts+dts" +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from enum connectrpc.eliza.v1.SayVolume + */ +export declare enum SayVolume { + /** + * @generated from enum value: SAY_VOLUME_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: SAY_VOLUME_LOUD = 1; + */ + LOUD = 1, + + /** + * @generated from enum value: SAY_VOLUME_SOFT = 2; + */ + SOFT = 2, +} + +/** + * @generated from enum connectrpc.eliza.v1.ConverseVolume + */ +export declare enum ConverseVolume { + /** + * @generated from enum value: CONVERSE_VOLUME_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: CONVERSE_VOLUME_LOUD = 1; + */ + LOUD = 1, + + /** + * @generated from enum value: CONVERSE_VOLUME_SOFT = 2; + */ + SOFT = 2, +} + +/** + * SayRequest is a single-sentence request. + * + * @generated from message connectrpc.eliza.v1.SayRequest + */ +export declare class SayRequest extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + /** + * @generated from field: connectrpc.eliza.v1.SayVolume volume = 2; + */ + volume: SayVolume; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.SayRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): SayRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): SayRequest; + + static fromJsonString(jsonString: string, options?: Partial): SayRequest; + + static equals(a: SayRequest | PlainMessage | undefined, b: SayRequest | PlainMessage | undefined): boolean; +} + +/** + * SayResponse is a single-sentence response. + * + * @generated from message connectrpc.eliza.v1.SayResponse + */ +export declare class SayResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.SayResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): SayResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): SayResponse; + + static fromJsonString(jsonString: string, options?: Partial): SayResponse; + + static equals(a: SayResponse | PlainMessage | undefined, b: SayResponse | PlainMessage | undefined): boolean; +} + +/** + * ConverseRequest is a single sentence request sent as part of a + * back-and-forth conversation. + * + * @generated from message connectrpc.eliza.v1.ConverseRequest + */ +export declare class ConverseRequest extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + /** + * @generated from field: connectrpc.eliza.v1.ConverseVolume volume = 2; + */ + volume: ConverseVolume; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.ConverseRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): ConverseRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): ConverseRequest; + + static fromJsonString(jsonString: string, options?: Partial): ConverseRequest; + + static equals(a: ConverseRequest | PlainMessage | undefined, b: ConverseRequest | PlainMessage | undefined): boolean; +} + +/** + * ConverseResponse is a single sentence response sent in answer to a + * ConverseRequest. + * + * @generated from message connectrpc.eliza.v1.ConverseResponse + */ +export declare class ConverseResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.ConverseResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): ConverseResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): ConverseResponse; + + static fromJsonString(jsonString: string, options?: Partial): ConverseResponse; + + static equals(a: ConverseResponse | PlainMessage | undefined, b: ConverseResponse | PlainMessage | undefined): boolean; +} + +/** + * IntroduceRequest asks Eliza to introduce itself to the named user. + * + * @generated from message connectrpc.eliza.v1.IntroduceRequest + */ +export declare class IntroduceRequest extends Message { + /** + * @generated from field: string name = 1; + */ + name: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.IntroduceRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): IntroduceRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): IntroduceRequest; + + static fromJsonString(jsonString: string, options?: Partial): IntroduceRequest; + + static equals(a: IntroduceRequest | PlainMessage | undefined, b: IntroduceRequest | PlainMessage | undefined): boolean; +} + +/** + * IntroduceResponse is one sentence of Eliza's introductory monologue. + * + * @generated from message connectrpc.eliza.v1.IntroduceResponse + */ +export declare class IntroduceResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "connectrpc.eliza.v1.IntroduceResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): IntroduceResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): IntroduceResponse; + + static fromJsonString(jsonString: string, options?: Partial): IntroduceResponse; + + static equals(a: IntroduceResponse | PlainMessage | undefined, b: IntroduceResponse | PlainMessage | undefined): boolean; +} + diff --git a/bundle-size/webpack/src/ts/gen/connectrpc/eliza/v1/eliza_pb.ts b/bundle-size/webpack/src/ts/gen/connectrpc/eliza/v1/eliza_pb.ts new file mode 100644 index 000000000..78d081ae0 --- /dev/null +++ b/bundle-size/webpack/src/ts/gen/connectrpc/eliza/v1/eliza_pb.ts @@ -0,0 +1,322 @@ +// Copyright 2022-2023 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-es v1.7.2 with parameter "target=ts+dts" +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from enum connectrpc.eliza.v1.SayVolume + */ +export enum SayVolume { + /** + * @generated from enum value: SAY_VOLUME_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: SAY_VOLUME_LOUD = 1; + */ + LOUD = 1, + + /** + * @generated from enum value: SAY_VOLUME_SOFT = 2; + */ + SOFT = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(SayVolume) +proto3.util.setEnumType(SayVolume, "connectrpc.eliza.v1.SayVolume", [ + { no: 0, name: "SAY_VOLUME_UNSPECIFIED" }, + { no: 1, name: "SAY_VOLUME_LOUD" }, + { no: 2, name: "SAY_VOLUME_SOFT" }, +]); + +/** + * @generated from enum connectrpc.eliza.v1.ConverseVolume + */ +export enum ConverseVolume { + /** + * @generated from enum value: CONVERSE_VOLUME_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: CONVERSE_VOLUME_LOUD = 1; + */ + LOUD = 1, + + /** + * @generated from enum value: CONVERSE_VOLUME_SOFT = 2; + */ + SOFT = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(ConverseVolume) +proto3.util.setEnumType(ConverseVolume, "connectrpc.eliza.v1.ConverseVolume", [ + { no: 0, name: "CONVERSE_VOLUME_UNSPECIFIED" }, + { no: 1, name: "CONVERSE_VOLUME_LOUD" }, + { no: 2, name: "CONVERSE_VOLUME_SOFT" }, +]); + +/** + * SayRequest is a single-sentence request. + * + * @generated from message connectrpc.eliza.v1.SayRequest + */ +export class SayRequest extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + /** + * @generated from field: connectrpc.eliza.v1.SayVolume volume = 2; + */ + volume = SayVolume.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.SayRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "volume", kind: "enum", T: proto3.getEnumType(SayVolume) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SayRequest { + return new SayRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SayRequest { + return new SayRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SayRequest { + return new SayRequest().fromJsonString(jsonString, options); + } + + static equals(a: SayRequest | PlainMessage | undefined, b: SayRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(SayRequest, a, b); + } +} + +/** + * SayResponse is a single-sentence response. + * + * @generated from message connectrpc.eliza.v1.SayResponse + */ +export class SayResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.SayResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SayResponse { + return new SayResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SayResponse { + return new SayResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SayResponse { + return new SayResponse().fromJsonString(jsonString, options); + } + + static equals(a: SayResponse | PlainMessage | undefined, b: SayResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(SayResponse, a, b); + } +} + +/** + * ConverseRequest is a single sentence request sent as part of a + * back-and-forth conversation. + * + * @generated from message connectrpc.eliza.v1.ConverseRequest + */ +export class ConverseRequest extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + /** + * @generated from field: connectrpc.eliza.v1.ConverseVolume volume = 2; + */ + volume = ConverseVolume.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.ConverseRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "volume", kind: "enum", T: proto3.getEnumType(ConverseVolume) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ConverseRequest { + return new ConverseRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ConverseRequest { + return new ConverseRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ConverseRequest { + return new ConverseRequest().fromJsonString(jsonString, options); + } + + static equals(a: ConverseRequest | PlainMessage | undefined, b: ConverseRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ConverseRequest, a, b); + } +} + +/** + * ConverseResponse is a single sentence response sent in answer to a + * ConverseRequest. + * + * @generated from message connectrpc.eliza.v1.ConverseResponse + */ +export class ConverseResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.ConverseResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ConverseResponse { + return new ConverseResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ConverseResponse { + return new ConverseResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ConverseResponse { + return new ConverseResponse().fromJsonString(jsonString, options); + } + + static equals(a: ConverseResponse | PlainMessage | undefined, b: ConverseResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ConverseResponse, a, b); + } +} + +/** + * IntroduceRequest asks Eliza to introduce itself to the named user. + * + * @generated from message connectrpc.eliza.v1.IntroduceRequest + */ +export class IntroduceRequest extends Message { + /** + * @generated from field: string name = 1; + */ + name = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.IntroduceRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): IntroduceRequest { + return new IntroduceRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): IntroduceRequest { + return new IntroduceRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): IntroduceRequest { + return new IntroduceRequest().fromJsonString(jsonString, options); + } + + static equals(a: IntroduceRequest | PlainMessage | undefined, b: IntroduceRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(IntroduceRequest, a, b); + } +} + +/** + * IntroduceResponse is one sentence of Eliza's introductory monologue. + * + * @generated from message connectrpc.eliza.v1.IntroduceResponse + */ +export class IntroduceResponse extends Message { + /** + * @generated from field: string sentence = 1; + */ + sentence = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "connectrpc.eliza.v1.IntroduceResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): IntroduceResponse { + return new IntroduceResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): IntroduceResponse { + return new IntroduceResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): IntroduceResponse { + return new IntroduceResponse().fromJsonString(jsonString, options); + } + + static equals(a: IntroduceResponse | PlainMessage | undefined, b: IntroduceResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(IntroduceResponse, a, b); + } +} + diff --git a/bundle-size/webpack/src/ts/index.ts b/bundle-size/webpack/src/ts/index.ts new file mode 100644 index 000000000..7f633e5fa --- /dev/null +++ b/bundle-size/webpack/src/ts/index.ts @@ -0,0 +1,13 @@ +import { compressedFlag } from "@connectrpc/connect/protocol"; +import { SayRequest, SayVolume } from "./gen/connectrpc/eliza/v1/eliza_pb.js"; +import { proto3 } from "@bufbuild/protobuf"; + +const testEnum = proto3.getEnumType(SayVolume); + +if ( + compressedFlag === 1 && + SayRequest.typeName === "connectrpc.eliza.v1.SayRequest" && + testEnum.typeName === "connectrpc.eliza.v1.SayVolume" +) { + console.log("webpack (ts) OK"); +} diff --git a/bundle-size/webpack-ts/tsconfig.json b/bundle-size/webpack/src/ts/tsconfig.json similarity index 100% rename from bundle-size/webpack-ts/tsconfig.json rename to bundle-size/webpack/src/ts/tsconfig.json diff --git a/bundle-size/webpack-ts/webpack.config.cjs b/bundle-size/webpack/src/webpack.config.cjs similarity index 68% rename from bundle-size/webpack-ts/webpack.config.cjs rename to bundle-size/webpack/src/webpack.config.cjs index fd96ef4a3..0ca77aafc 100644 --- a/bundle-size/webpack-ts/webpack.config.cjs +++ b/bundle-size/webpack/src/webpack.config.cjs @@ -3,7 +3,7 @@ const path = require('path'); module.exports = { - entry: './src/index.ts', + mode: 'production', module: { rules: [ { @@ -15,9 +15,12 @@ module.exports = { }, resolve: { extensions: ['.tsx', '.ts', '.js'], + extensionAlias: { + '.js': ['.ts', '.js'], + }, }, output: { - filename: 'bundle.js', - path: path.resolve(__dirname, 'dist'), + filename: 'main.js', + path: path.resolve(__dirname, 'dist/ts'), }, };