Skip to content

Releases: tatethurston/TwirpScript

v0.0.69

25 Oct 04:57
d8f0467
Compare
Choose a tag to compare

What's Changed

Full Changelog: https://github.com/tatethurston/TwirpScript/blob/main/CHANGELOG.md#v0069

v0.0.68

04 Aug 20:00
a7feb08
Compare
Choose a tag to compare

v0.0.68

All header names are now lowercased. This was already true for users using createTwirpServer in conjunction with Node.js' createServer, but previously users of createTwirpServerless did not receive this standardization.

Full Changelog: v0.0.67...v0.0.68

v0.0.67

28 Jul 05:45
2550b1e
Compare
Choose a tag to compare

v0.0.67

  • Updates TwirpScript to v0.0.18 of ProtoScript, which includes fixes for referencing (recursive) 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.66...v0.0.67

v0.0.66

19 Nov 00:00
094a4e7
Compare
Choose a tag to compare

v0.0.66

  • 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.65...v0.0.66

v0.0.65

06 Oct 00:26
eb301c7
Compare
Choose a tag to compare

v0.0.65

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.64...v0.0.65

v0.0.64

23 Sep 21:05
c11ed63
Compare
Choose a tag to compare

v0.0.64

  • Revert Include file extensions in generated file imports introduced in v0.0.61 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, TwirpScript 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.63...v0.0.64

v0.0.63

22 Sep 01:00
cf9eab8
Compare
Choose a tag to compare

v0.0.63

  • Change configuration file format. Now, the configuration file is JS instead of JSON. This provides better discoverability and type checking for TypeScript users.

The following .twirp.json:

{
  "root": "src"
}

Would be renamed to proto.config.mjs and changed to the following:

/** @type {import('twirpscript').Config} */
export default {
  root: "src",
};
  • Use relative file path for determining path to compiler instead of hard coding from project root. This should interop better with more exotic package tooling and repo setup.

  • Fix: Improved map detection. Previously field types suffixed with Entry were incorrectly flagged as maps. This has been fixed.

Full Changelog: v0.0.62...v0.0.63

v0.0.62

26 Aug 21:14
9b0e9ee
Compare
Choose a tag to compare

What's Changed

  • Remove process.stdin.fd usage to see if it resolves intermittent Error: EAGAIN: resource temporarily unavailable, read. See #191 for more context.

New Contributors

Full Changelog: v0.0.61...v0.0.62

v0.0.61

24 Jul 00:46
6ebe962
Compare
Choose a tag to compare

What's Changed

  • Fix JSON deserialization. #181 introduced a regression that caused TwirpScript servers' JSON serialization to fail.
  • Distribute strict ESM. A CommonJS is runtime is included for legacy node clients. Code generation uses ESM and requires Node.js v14 or later. If you're using a compiler other than TypeScript such as webpack, please see [these instructions].(https://github.com/tatethurston/TwirpScript#webpack-setup)
  • Use ProtoScript code generation. This will result in some generated imports coming from protoscript instead of twirpscript, but this is a non breaking change. These imports were previously delegated to ProtoScript via reexports inside TwirpScript, and that indirection has now been removed.

Full Changelog: v0.0.60...v0.0.61

v0.0.60

20 Jul 21:08
dbb504f
Compare
Choose a tag to compare

What's Changed

  • Removes @types/node dependency. @types/node is no longer necessary when using a TwirpScript generated client.

Full Changelog: v0.0.59...v0.0.60