Releases: disneystreaming/smithy4s
v0.16.7
What's changed
Use a concurrent map on JVM for the compilation cache by @Baccata in #539
Fixes a potential issue in concurrently compiling the same schema.
Client httpResponseTest for output by @daddykotex in #527
Adds support for testing response handling of a client in the compliance-tests
module.
Build http4s routers lazily by @kubukoz in #568
Fixes an issue in which an exception would be thrown instead of an Either's Left being returned in http4s clients.
Other changes
- add logo to microsite by @lewisjkl in #532
- update workflow to split out microsite publishing by @lewisjkl in #536
- Update sbt-header to 5.8.0 by @scala-steward in #543
- Update scala-library, scala-reflect to 2.12.17 by @scala-steward in #544
- Export a SMITHY_VERSION so that publish can use it by @daddykotex in #540
- Update swagger-ui-dist to 4.14.3 by @scala-steward in #548
- Update smithy-aws-traits, smithy-build, ... to 1.25.2 by @scala-steward in #549
- Update jsoniter-scala-core to 2.17.6 by @scala-steward in #552
- Update swagger-ui-dist to 4.15.0 by @scala-steward in #553
- Update sbt, sbt-dependency-tree to 1.7.2 by @scala-steward in #546
- Update scala-library, scala-reflect to 2.13.10 by @scala-steward in #545
Full Changelog: v0.16.6...v0.16.7
v0.16.6 : fix document encoder for maps with newtype keys
Fixes a bug that would have Document encoders believe that string-newtypes should be treated as complex types when encoding maps.
See 0690bdf
I accidentally pushed a commit to main, but I'm rolling with it (I obviously went and changed the branch protection to protect against that in the future)
v0.16.5 : critical bug fixes
This release contains fixes of critical bugs that could lead to memory leaks in the user applications (depending on usage patterns).
The memory leak was introduced when we applied memoization in #455, which was an effort to reduce the memory footprint of Smithy4s on large APIs reusing the same datatypes all over the place. Unfortunately, we later realised that global memoization was unsafe, due to the instability of smithy4s.schema.Schema
(a GADT that contains thunks and lambda, and therefore is unstable wrt hashCode/equality and only responds to referential equality). The memory leak would happen every time the Smithy4s-routing would be stored in a def
that would re-execute on a per-request basis (which, really, was a user-side mistake, but it wouldn't be professional for us to leave a potential memory leak when the language doesn't give us the means to guarantee the user won't shoot themselves in the foot).
We didn't want to rollback the memoization, because a few applications we have internally at DisneyStreaming massively benefited from it, on the account of having large APIs with hundreds (if not thousand) datatypes. The memoization we had put in place has greatly helped the startup time of these applications, and their memory consumption, so just rolling back was not an option.
Instead, we've decided to take the time to apply a proper fix, and scope the memoization to the lifecycle of interpreters. This means that interpreters are responsible for instantiating their own Schema compilation cache, which gets GC'd when the interpreter is discarded.
Bug fixes
- Changes the memoization mechanism that could lead to memory leaks. Now memoization requires the injection of a cache instance, which is locally instantiated by http4s interpreters.
- Addresses a few bugs in the hint transformation function on schemas
- Discourages the inspection of the alternative contained by
Alt.WithValue
, in favour of using theAlt.Dispatcher
instance, which takes care of memoization for the implementor and offers a type-safe API.Alt.WithValue
is only ever-used on the encoding side of codecs, andAlt.Dispatcher
solves that exact problem in an arguably more elegant fashion. - Improve performance of erroring paths by memoizing the compilation of error schemas in the Http4s interpreter
- Applies the hint mask transitively in JsonCodecs (instead of locally).
What's Changed
- Fix hint transformations and adds a test suite by @Baccata in #524
- Move to coursier/setup-action by @daddykotex in #528
- Removing hint transformation in union's "total" function ... by @Baccata in #526
- Apply hint mask transitively in json codecs by @kubukoz in #521
- Amends the caching mechanism to avoid relying on global variables by @Baccata in #514
Full Changelog: v0.16.4...v0.16.5
v0.16.4
Bug fixes, user-facing changes
Add missing config scopes in codegen by @kubukoz in #502
Fixes a bug where generating code in additional sbt configurations (e.g. Test
) would break caching and result in redundant code generation.
Adding stuff that's generated under T.sources
is problematic by @daddykotex in #507
Fixes an infinite loop caused by a bug in the Mill plugin.
protocol: support given import in refinements by @ahjohannessen in #508
Adds support for given
(Scala 3 import syntax for givens) in Smithy4s refinements.
Add Server test for @httpRequestTests by @daddykotex in #510
Adds support for running server tests as part of the "compliance tests" feature initially started in 0.16.3.
Internal changes, library updates
- Update jsoniter-scala-core to 2.17.4 by @scala-steward in #469
- Update sbt-mima-plugin to 1.1.1 by @scala-steward in #518
- Update circe-generic to 0.14.3 by @scala-steward in #519
- Update jsoniter-scala-core to 2.17.5 by @scala-steward in #517
- Update sbt-scalafix to 0.10.4 by @scala-steward in #516
New Contributors
- @ahjohannessen made their first contribution in #508
Full Changelog: v0.16.3...v0.16.4
v0.16.3 - bug fixes, improvements
Bug fixes, user-facing changes
Generate tests from test traits by @daddykotex in #424
This is a huge improvement for Smithy4s and its participation in the Smithy ecosystem in general - now it is possible to test your implementation of a HTTP client against tests provided by the protocol implementation. It will be hugely helpful when we get to the implementation of @restJson1
support. If you're implementing support for a protocol, check out the docs for this feature.
Server-side support is in the plans - keep an eye out for future releases.
Add smithy4s models to upstream model validation by @Baccata in #462
This resolves an issue in sharing specifications where smithy4s's own Smithy models wouldn't be seen by the code generation process in some cases.
Decline: add native support by @kubukoz in #475
The Decline module now supports Scala Native.
Added ModelTransformer to flatten and merge all mixins in the model by @yisraelU in #463
This fixes an issue in the dynamic
module, so that it correctly handles mixins and apply
in the model .
Fix codegen resource outputs for Smithy files in subdirectories by @kubukoz in #485
Fixes an issue with generating sources from Smithy files located in sub-directories of the main Smithy input directory (regression from earlier 0.16.x releases). The PR introduced a regression but it's been since fixed in #495 by @kubukoz.
Remove stale generated resource directories by @kubukoz in #487
Fixes an issue where a module's codegen might break after changes in its dependencies.
Adds Service as class member to Client builder by @yisraelU in #477
Mostly useful for extending the client builder - the service
member of the builder is now exposed as a field.
Opt out of local dependencies by @kubukoz in #491
Adds the ability to opt out of the feature introduced in #432 (smithy4s v0.16.1) If you don't want your module's dependencies to be compiled before you can generate code, you can make that so - check out the docs.
Fix unicode escapes in generated strings by @kubukoz in #499
Fixes an issue where some generated code wouldn't be runnable on Scala Native (namely, DynamoDB's AutoScalingRoleArn).
Bump up smithy version from 1.24.0 to 1.25.1 by @valydia in #478
Internal changes
- Fix potential typo by @kubukoz in #490
- Change formatter to align margins in multiline strings by @Baccata in #494
- Bump mdoc and use check-link-hygiene by @daddykotex in #476
- Pin docusaurus-lunr-search by @daddykotex in #480
- Extract primitive string encoding/decoding logic by @Baccata in #486
Library updates
- Update fs2-core to 3.3.0 by @scala-steward in #467
- Update weaver-cats, weaver-scalacheck to 0.8.0 by @scala-steward in #468
New Contributors
Full Changelog: v0.16.2...v0.16.3
v0.16.2 - more Scala Native support, fix AWS timestamp issue
In this release, we've added support for Scala Native in the http4s integration module, as well as the (still experimental) AWS modules. This is thanks to the work of @armanbilge et al. on bringing the Typelevel world closer to the Native world.
Additionally, a regression in timestamp formatting for AWS has been fixed (#471), so your JVM/JS/Native apps should be able to talk to (a subset of) AWS services again. Give it a try!
What's Changed
- Update sbt-scalafix to 0.10.2 by @scala-steward in #466
- Native Http4s by @kubukoz in #470
- Fix AWS timestamp formats by @kubukoz in #471
Full Changelog: v0.16.1...v0.16.2
v0.16.1: Sharing specs, Mill support & more
NOTE: Use 0.16.1 not 0.16.0, the latter is a botched release that only contains a subset of the changes.
This release is huge! Thanks to all the contributors.
The 0.16.1 release breaks both source and binary compatibility.
At a high level, here are the changes you can look forward to in the release:
Support for the @httpResponseCode trait - #377
You can mark a member of your output
structure with @httpResponseCode
and expect smithy to use that value when rendering a http response, on the server, or to fill that value from the response status code, on the client.
Support for sharing specifications across modules (sbt or mill) (similar to how you depend on another module Scala code in sbt
with the dependsOn
setting) - #432
Multiple people came naturally to this kind of project setup where you have multiple module and you may want to have common code and specification live a given module that your other modules depends on. With this release, it's totally doable. See this page for more information
Mill support - #450
Now your mill modules can also use Smithy4s code generation. See this page for more information.
Decline integration is effect-agnostic - #429
Previous version use CommandIOApp
which requires cats.effect
. 0.16.1
version will allow you to use the effect system of your choice.
Builder pattern to create your clients - #447
New API looks like:
SimpleRestJsonBuilder(HelloWorldService)
.client(client)
.uri(Uri.unsafeFromString("http://localhost:9000"))
.resource
More details below.
What's Changed
- Change mima target (0.16) by @daddykotex in #417
- httpResponseCode handling (server side) by @daddykotex in #377
- Update jsoniter-scala-core to 2.17.2 by @scala-steward in #445
- support root imports in refinements by @lewisjkl in #442
- Use a document relative url for specs by @daddykotex in #444
- Fix collision by @yisraelU in #451
- Update flake.lock by @kubukoz in #454
- 0.16.0 merge by @daddykotex in #460
Full Changelog: v0.15.3...v0.16.1
v0.15.3 - bug fixes, customization for default rendering
This release brings several fixes to bugs we've found in the previous ones. Notable changes:
Allow customizing the rendering of default values (#414)
This adds the ability to change how default values appear in the generated sources. Take a look at the documentation for more!
Fixes to defaults in mixins - #423, #425
Fixes some issues that you could encounter in situations where you're generating code for a structure with default values inherited from a mixin.
Collision detection #412
Fixes some issues with code generation where a name conflicts with the Scala standard library.
Exhaustively capture the codegen input for cache invalidation #438
Helps avoid the issues where codegen wouldn't be triggered after the inputs are changed.
Other changes
- Fix mima command to run more quickly by @lewisjkl in #415
- Bump prism-react-renderer from 1.3.1 to 1.3.5 in /modules/website by @dependabot in #401
- Bump clsx from 1.1.1 to 1.2.1 in /modules/website by @dependabot in #407
- Update jsoniter-scala-core to 2.16.0 by @scala-steward in #416
- Update nscplugin, sbt-scala-native, ... to 0.4.6 by @scala-steward in #427
- Update jsoniter-scala-core to 2.17.0 by @scala-steward in #418
- Update nscplugin, sbt-scala-native, ... to 0.4.7 by @scala-steward in #436
- Bump Scala 3 to 3.2.0 by @Baccata in #437
- Update smithy-aws-traits, smithy-build, ... to 1.24.0 by @scala-steward in #428
- Bump docusaurus-lunr-search from 2.1.16 to 2.2.0 in /modules/website by @dependabot in #426
- Update fs2-core to 3.2.14 by @scala-steward in #440
Full Changelog: v0.15.2...v0.15.3
v0.15.2 - CLI module, bugfixes, dynamic module improvements
This release adds a new module - decline
- providing integration with the Decline library. It provides the ability to easily get a command line interface for any service implementation or client.
Additionally, the release fixes a couple bugs like #389, as well as adding support for Smithy 2.0 enum
and intEnum
shapes in the Dynamic module.
This release enables a previously disabled feature of the http4s clients&servers (as well as other code using the json
module's codec support) - encoding intEnum
as a JSON number.
Finally, MiMa checks have been enabled, so we'll track binary compatibility more seriously in future releases.
Full changelog
- Update smithy-aws-traits, smithy-build, ... to 1.23.1 by @scala-steward in #388
- Small typo in
01-overview.md
by @zetashift in #390 - Collision Avoidance additions by @yisraelU in #393
- Range collision avoidance by @yisraelU in #394
- Auto-update GitHub Action dependencies by @IdiosApps in #395
- Revert "Range collision avoidance" by @yisraelU in #396
- Bump actions/upload-artifact from 2 to 3 by @dependabot in #397
- Bump actions/checkout from 2 to 3 by @dependabot in #398
- Bump actions/download-artifact from 2 to 3 by @dependabot in #399
- Add support for decline interpreters by @yisraelU in #376
- Bump @docusaurus/core from 2.0.0-beta.14 to 2.0.1 in /modules/website by @dependabot in #403
- Enable Mima Checks by @lewisjkl in #408
- Bump @docusaurus/preset-classic from 2.0.0-beta.14 to 2.0.1 in /modules/website by @dependabot in #400
- Dynamic smithy4s enums + allow IntEnum hint in JSON codecs by @daddykotex & @kubukoz in #406
- Update http4s-circe, http4s-client, ... to 0.23.15 by @scala-steward in #409
- Update 04-deriving-cli.md by @yisraelU in #410
- Bump docusaurus-lunr-search from 2.1.15 to 2.1.16 in /modules/website by @dependabot in #404
- Update 04-deriving-cli.md by @yisraelU in #411
New Contributors
- @zetashift made their first contribution in #390
- @IdiosApps made their first contribution in #395
- @dependabot made their first contribution in #397
Full Changelog: v0.15.1...v0.15.2
v0.15.1 - Initialization bug fix
Following the introduction of refinements a bug slipped in. It's a tricky one that only shows up at runtime, under some conditions. See #383 and related PR for more info.
What's Changed
- Refer to the job name, not the steps by @daddykotex in #381
- Update swagger-ui-dist to 4.14.0 by @scala-steward in #380
- fix init ordering bug by @lewisjkl in #385
Full Changelog: v0.15.0...v0.15.1