Skip to content

Releases: tatethurston/ProtoScript

v0.0.20

25 Oct 04:49
f02cb79
Compare
Choose a tag to compare

What's Changed

  • Preserve protoscript import when well known types are imported by @tatethurston in #47

Full Changelog: https://github.com/tatethurston/ProtoScript/blob/main/CHANGELOG.md#v0020

v0.0.19

25 Oct 03:42
b7276f1
Compare
Choose a tag to compare

What's Changed

Full Changelog: https://github.com/tatethurston/ProtoScript/blob/main/CHANGELOG.md#v0019

v0.0.18

27 Jul 17:47
383d9c5
Compare
Choose a tag to compare

v0.0.18

  • Fix JSON deserialization of recursive (self referencing) messages.
  • Fix generated TypeScript types for repeated recursive (self referencing) messages.

Full Changelog: v0.0.17...v0.0.18

v0.0.17

24 Jul 01:01
Compare
Choose a tag to compare

v0.0.17

  • Omit Uint8Array from PartialDeep type. This fixes a type error for TypeScript users that use bytes.

Full Changelog: v0.0.16...v0.0.17

v0.0.16

23 Jul 19:18
ed8eaa3
Compare
Choose a tag to compare

v0.0.16

  • encode methods now accept partials for nested messages as well (PartialDeep instead of Partial). Previously, the types required that full messages were provided for any nested messages.

Buf users will need to update their buf.gen.yaml path:

buf.gen.yaml

version: v1
plugins:
  - name: protoc-gen-protoscript
-    path: ./node_modules/protoscript/compiler.js
+    path: ./node_modules/protoscript/dist/compiler.js
    out: .
    opt:
      - language=typescript
    strategy: all

Full Changelog: v0.0.15...v0.0.16

v0.0.15

21 Jun 16:23
8956d0b
Compare
Choose a tag to compare

v0.0.15

This release includes the following bug fixes:

  • Fix treeshaking for nested messages. Previously, there were cases where protobuf did not tree shake out of JSON only client usage. Thanks @noahseger!
  • Fix camelcasing for fieldnames with multiple sequential underscores. Thanks @noahseger!
  • Fix generated toInt helper when using aliased enums. Thanks @noahseger!
  • Fix recursive message initialization. Previously, recursive messages, messages with fields that referenced themselves, would cause an infinite loop when initializing because protoscript eagerly instantiates message objects. Now the compiler detects cycles and will instead generate up until the cycle, and mark the recursive field as optional.

New Contributors

Full Changelog: v0.0.14...v0.0.15

v0.0.14

18 Nov 23:52
d0992c6
Compare
Choose a tag to compare

v0.0.14

  • Fix intermittent EAGAIN issue encountered when compiling protos

  • Use glob imports for generated messages instead of destructuring. This preserves tree shaking, but preserves module namespacing to disambiguate name collisions between protos. Previously, identically named messages in different modules could causes a name collision, eg:

    // foo.proto
    message Foo {}
    // bar.proto
    import "foo.proto";
    message Foo {}

    Would result in errors in the generated code. Now, this is namespaced and works correctly.

Full Changelog: v0.0.13...v0.0.14

v0.0.13

06 Oct 00:17
d69843e
Compare
Choose a tag to compare

v0.0.13

Update package Protocol Buffers Well-Known Types to enable strict ESM.

Full Changelog: v0.0.12...v0.0.13

v0.0.12

05 Oct 22:51
89ee926
Compare
Choose a tag to compare

v0.0.12

Protocol Buffers Well-Known Types are now exported from protoscript. References to well-known types are now imported from protoscript rather than being generated. This is a non breaking change. If you have well-known types in your project, you can remove the google/protobuf directory that was generated in previous versions alongside your other .pb.js/ts files.

The output location of google/protobuf was a common reason for using dest in proto.config.mjs so this change should facilitate zero configuration for a greater number of projects.

Full Changelog: v0.0.11...v0.0.12

v0.0.11

23 Sep 20:55
Compare
Choose a tag to compare

v0.0.11

  • Revert Include file extensions in generated file imports introduced in v0.0.7 for TypeScript users. Generated TypeScript imports will revert to the following:
- import { Foo } from './foo.pb.js';
+ import { Foo } from './foo.pb';

When targeting ESM, the TypeScript compiler expects .js extensions and not .ts extensions for imports because the compiler does not manipulate import paths: https://www.typescriptlang.org/docs/handbook/esm-node.html.

Including a full extension results in the following TypeScript error:

[tsserver 2691] [E] An import path cannot end with a '.ts' extension.

The TypeScript team's recommendation to use .js extensions for .ts file imports when targeting ESM causes a number of issues with the broader JavaScript ecosystem. Until this situation is rectified, ProtoScript will not emit ESM compliant extensions for TypeScript. This only impacts TypeScript users who wish to target ESM in Node.JS using the TypeScript compiler, as bundlers are not pedantic about file extensions. If you're impacted by this, please join the discussion in #202

Full Changelog: v0.0.10...v0.0.11