Skip to content

Releases: modiimedia/arri

v0.76.0

23 Feb 15:11
Compare
Choose a tag to compare

Full Changelog: v0.75.0...v0.76.0

Typescript

Breaking Change

When using compiled validators the .compiledCode property is now undefined by default. From my tests this reduces unnecessary memory usage by 65% for small schemas and by 73% for larger schemas. Results will vary from schema to schema but overall there should be a large reduction in memory allocations. Basically now the large function body strings are no longer being stored by default so we save in memory usage.

const User = a.object("User", {
  id: a.string(),
  name: a.string(),
  email: a.nullable(a.string()),
});
const $$User = a.compile(User);
$$User.compiledCode // this is `undefined`

Since the majority of people do not use the properties available in .compiledCode this will not be a breaking change for most. If you need to access the generated function bodies for use in something like code-generation, you now need to explicitly enable the feature like so:

const User = a.object("User", {
  id: a.string(),
  name: a.string(),
  email: a.nullable(a.string()),
});
const $$User = a.compile(User, true) // passing true as the second parameter makes `.compiledCode` available

$$User.compiledCode // this is no longer undefined

// so we can access the generated function bodies
console.log($$User.compiledCode.validate)
console.log($$User.compiledCode.parse)
console.log($$User.compiledCode.serialize)

v0.75.0

13 Feb 23:15
Compare
Choose a tag to compare

What's Changed

Commits

Dart

  • [dart-codegen]: empty object type definitions now output valid dart code

Go

  • [go-server]: go server no longer panics when creating type definitions for empty structs

Kotlin

  • [kotlin-codegen]: empty object type definitions now output valid kotlin code

Rust

  • [rust-codegen]: empty object type definitions now output valid rust code

Swift

  • [swift-client]: update async-http-client to v1.25.1
  • [swift-codegen]: empty object type definitions now output valid swift code

Typescript

  • [ts-codegen]: empty object type definitions now output valid typescript code
  • [ts-server]: update esbuild to v0.25.0

Full Changelog: v0.74.1...v0.75.0

v0.74.1

05 Feb 15:34
Compare
Choose a tag to compare

What's Changed

Dart

  • dart-codegen - bugfix - prefix enums that use reserved keywords such as default by @joshmossas in #147

Full Changelog: v0.74.0...v0.74.1

v0.74.0

30 Jan 11:26
Compare
Choose a tag to compare

What's Changed

  • bugfix: fix failing kotlin integration tests against go server by @joshmossas in #142
  • [ts-schema] refactor: no longer throws by default by @joshmossas in #143
  • [ts-schema] feature: ability to compile coerce fn by @joshmossas in #145

Full Changelog: v0.73.0...v0.74.0

Typescript

Since we are pre-1.0 I thought now was a good time to do a major refactor to change the default behavior of the TS schema validation library. Now all parsing and serialization functions will never not throw errors by default. Instead they return a Result<T>.

@arrirpc/schema

  • [BREAKING] parse, coerce, and serialize no longer throw a ValidationError they instead return a Result<T>
  • [BREAKING] parseSafe and coerceSafe have been removed as not throwing is now the default behavior
  • parseUnsafe, coerceUnsafe, and serializeUnsafe have been added.
  • [BREAKING] ValidationError has been renamed to ValidationException
  • a.compile() now also compiles a highly optimized coerce function. When running on my Macbook the compile version of coerce is 25x faster than the non-compiled versions.
image

@arrirpc/server

  • RPCs registered using the GET HTTP method now use the compiled version of coerce() when parsing URL query params.

Swift

  • update async-http-client to version 1.24.2

v0.73.0

26 Jan 08:33
Compare
Choose a tag to compare

What's Changed

  • bugfix: fix codgen bugs when using typePrefix option in dart, kotlin, swift, and rust by @joshmossas in #137
  • chore: update libs by @joshmossas in #139
  • Bugfix: fix type prefix codegen issues with rust and kotlin by @joshmossas in #140

Full Changelog: v0.72.0...v0.73.0

Dart

  • [BREAKING] dart-codegen - modelPrefix option has been renamed to typePrefix for consistency with other client generators
  • dart-codegen - fix issues where typePrefix option sometimes results in invalid Dart code

Rust

  • rust-codegen - fix issue where typePrefix option sometimes results in invalid Rust code

Swift

  • swift-codegen - fix issue where typePrefix options results in invalid Swift code

Typescript

  • @arrirpc/server - remove reliance on pathe dependency when running arri build

Miscellaneous

  • update dev dependencies

v0.72.0

19 Jan 04:59
Compare
Choose a tag to compare

Upgrade with arri use latest

What's Changed

CLI

  • make arri use command stricter on versions for package.json and pubspec.yaml. by @leccles1 in #133

Typescript

  • bugfix: @arrirpc/typebox-adapter fix type inference issues by @joshmossas in #131

Dart

  • bugfix: make dart enum codegen respect the modelPrefix option by @joshmossas in #134

New Contributors

Full Changelog: v0.71.1...v0.72.0

v0.71.1

12 Jan 01:31
Compare
Choose a tag to compare

What's Changed

Typescript

  • Fix bug where compiled validators don't properly pass errors to standard-schema

Full Changelog: v0.71.0...v0.71.1

v0.71.0

11 Jan 19:58
Compare
Choose a tag to compare

What's Changed

Typescript

Dart

  • Remove unnecessary logs of response body

Misc

  • Update dev dependencies

Full Changelog: v0.70.1...v0.71.0

v0.70.1

28 Dec 02:12
Compare
Choose a tag to compare

What's Changed

If a particular language isn't mentioned then no change occurred.

Go

Breaking Changes

  • EncodeJSON now accept EncodingOptions as one of it's parameters
  • DecodeJSON now accepts EncodingOptions as one of it's parameters
  • FromUrlQuery has been renamed to DecodeQueryParams
  • FromUrlQuery now accepts EncodingOptions as one of it's parameters
  • Context interface has been renamed to Event to prevent confusion with context from the STD
  • EncodeJSON in the ArriModel interface now accepts EncodingOptions as its parameter
  • When encoding enums the first specified enum value will be used as a fallback during serialization
  • When encoding discriminated unions the first specified subtype will be used as a fallback during serialization

Non-Breaking Changes

  • Initial support for RPC middleware has been added
  • Len() method has been added to OrderedMap
  • Entries() method has been added to OrderedMap
  • Keys() method has been added to OrderedMap
  • Add documentation for helper types

Tooling

Breaking Changes

  • json-schema-to-jtd package has been deprecated and replaced with json-schema-to-atd
  • @arrirpc/jtd-utils package has been deprecated and replaced with @arrirpc/type-defs

Non-Breaking Changes

  • json-schema-to-atd now supports converting "string" with "date-time" format to timestamp type

Other

  • Update dev dependencies
  • Move all ts server and client libraries to languages/ts for consistency

Full Changelog: v0.69.2...v0.70.1

v0.69.2

07 Dec 16:51
Compare
Choose a tag to compare

What's Changed

  • feature: add support for dictionary types when converting from JSON schema to ATD by @joshmossas in #120

Full Changelog: v0.69.1...v0.69.2