creditkarma / thrift-typescript

Generate TypeScript from Thrift IDL files
Apache License 2.0
155 stars 32 forks source link

Version 4 in development #156

Open kevin-greene-ck opened 5 years ago

kevin-greene-ck commented 5 years ago

We've begun work on the next major release of the code generator, focusing on the thrift-server target. Some of the new features that will be arriving in some form in the next release are:

  1. BigInt support (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt). This will become the default render target of i64. It's unclear if we will keep the Int64 option. This will require a lot of changes to the core thrift-server library and not sure if we will want to maintain both code paths. This update would require consumers to be on Node >= 10.4.
  2. Increased visibility into service payload processing. The first step here is expanding the metadata available on service objects as represented by #154, which gives service objects access to annotations defined on all method argument types. Service processors will also be expanded to have methods for introspecting payloads without running the payload through user-defined service handlers.
  3. All Codec objects will be renamed to Toolkit and be expanded with more utilities, including the ability to read/write from Buffer instead of just TProtocol. Another possibility being explored is removing generated class representations of struct, union and exception and moving generated metadata, including annotations, to these Toolkit objects.
  4. strictUnions will likely become the default behavior, though the option for generating unions as structs with optional fields will probably remain.
  5. The thrift-server core library is being simplified and more of the default behavior is being moved to generated code. This will make the generated code less dependent on the core library allowing more features and fixes to happen in a more seamless fashion.
  6. The generated code may be updated to use Uint8Array instead of Buffer to allow developing of clients for web browsers and other non-Node JavaScript environments.
  7. The Context object is going to become more opinionated. The Context is going to be populated with a sub-set of the incoming request properties and users will be given an opportunity to decorate this object with more properties/methods beyond the defaults.
  8. The __name field will be added to all strict interfaces by default, can be optionally removed.

We are looking at a release window of June-July for these features. There will be prereleases along the way with corresponding prereleases of thrift-server.