v0.17.3: Scaladocs, easier ADTs, Scala 3 wildcards, easier AWS SDK usage
0.17.3
This release is backward binary-compatible with the previous releases from the 0.17.x lineage.
General announcements
- We are opening a public Discord server for users to ask questions about Smithy4s and the Smithy ecosystem in general
- We are lowering the barrier of entry to use Smithy4s as an AWS SDK. Go check out the docs π
User-facing features
Addition of an new @adt
trait to streamline the inlining of structures as sealed-trait members
Under certain conditions, it is now possible to annotate union shapes with @adt
, which has the effect of inlining
all the structure shapes under it directly in the companion object of the union, as opposed to create Case
-suffixed
wrappers. Additionally, when a union is annotated with @adt
, the intersection of mixin shapes that are applied to every member of the union is now used as Scala-level mixin traits. This facilitates object-oriented usage of Smithy4s.
Read the new docs for more info.
See #787
Scaladoc now gets generated
Smithy @documentation
traits (which has syntactic sugar in the form of triple-slashes-prefixed comments) is now used to generate Scaladoc above the relevant data-types, interfaces and methods that get generated in Smithy4s.
Thank you @zetashift for this awesome contribution and @msosnicki for this valuable contribution !
Scala 3 wildcards now get generated when relevant.
Under conditions which should automatically be propagated from the build-tool to the code-generation,
Scala 3 wildcards now get generated instead of Scala 2 wildcards. This makes user experience better on
Scala 3, as syntax deprecation warnings will no longer be issued.
Thank you @albertpchen for this awesome contribution !
See #736
Simpler AWS clients
It is now possible to directly instantiate AWS clients against a Monadic context, which makes for a better
UX when calling unary request/response operations. When using that mode, stream operations being called
such clients will fail with a raised exception.
See #744
AWS config file credentials providers
It is now possible to load credentials from an AWS-compliant configuration file (typically found under ~/.aws/credentials).
This is wired by default in the clients, and has lower precedence than the other providers.
Improve docs
We've improved and added new sections to the documentation, in particular around AWS SDK usage and model pre-processing.
Bug fixes
Null default value traits are now correctly handled
The default trait allows for not setting a value. Now, the absence of value (ie null) in the
default trait at the smithy level translates to the correct "zero" value of the target type.
See #782
Decoding Document.DNull to Optional fields now works correctly
Null documents were not being decoded as None
, but rather were leading to decoding failures
when decoding data types from smithy4s.Document
See #725
Fix the JS source-map URI
The URI was previously using the wrong relative path
See #740
Traits applied on collection members now leads to hints being correctly generated
See #769
Defaults are not ignored in refinements
Loading a smithy 1.0 model with smithy 2.0 tooling (which Smithy4s uses) leads to the automatic
addition of "default" traits on some shapes and members. When combined with refinements, this had
the side effect of treating the refined type as required when it should be in fact optional.
It's all the more confusing that there is no mechanism in place to reconcile refinement logic,
with default values, as refinement logic is expressed in run-time code whereas default value validation
is expressed in build-time code.
See #795
Other notable changes
Performance improvements of the json parsing logic
Yet another awesome contribution from @plokhotnyuk to shave allocations off the Json parsing logic, leading
to performance improvements.
See #764
Compliance tests
Our implementation of our alloy#simpleRestJson
protocol is now derived automatically from test specifications
written in Smithy itself
See:
This also paves the road for testing our implementation of the AWS protocols using official tests, which are located
[there]
Generic logic against smithy4s-generated enumerations is now easier to write
Some tweaks were made to the smithy4s.Enumeration.Value
interface to allow for more generic logic using enumerations.
See #794
PR List
- Update fs2-core to 3.4.0 by @scala-steward in #625
- Update jsoniter-scala-core to 2.20.3 by @scala-steward in #724
- Fix decoding an optional
Document.DNull
field by @zetashift in #725 - Tweak background highlight color by @daddykotex in #733
- Split out "default rendering" page by @kubukoz in #734
- Help scala-steward and manually bump alloy-core by @daddykotex in #735
- Update cats-effect to 3.4.5 by @scala-steward in #738
- Actually fix sourcemaps by @zetashift in #740
- add yourkit credit by @lewisjkl in #741
- Add documentation post about protocols by @lewisjkl in #719
- Add yourkit acknowledgments by @Baccata in #742
- Adds protocol compliance tests to the Http4s module by @yisraelU in #715
- [AWS] Awscall to F[_] Transformation #730 by @yisraelU in #744
- Smithy resources for dynamic module by @msosnicki in #743
- Add renderer option to change wildcard type arg by @albertpchen in #736
- Update alloy-core, alloy-openapi to 0.1.9 by @scala-steward in #753
- Update http4s-circe, http4s-client, ... to 0.23.18 by @scala-steward in #754
- Document smithy4sWildcardArgument by @daddykotex in #749
- testing smithy4s apis - docs by @lewisjkl in #748
- Update mill-main, mill-main-api, ... to 0.10.11 by @scala-steward in #758
- Fixes a bug that prevent the inclusion of upstream libraries by @Baccata in #757
- Load file from credentials file (~/.aws/credentials) by @daddykotex in #756
- Update sbt-sonatype to 3.9.16 by @scala-steward in #763
- Update sbt-sonatype to 3.9.17 by @scala-steward in #768
- Update nscplugin, sbt-scala-native, ... to 0.4.10 by @scala-steward in #767
- known issues documentation by @lewisjkl in #765
- Generate scaladoc for
@documentation
trait by @zetashift in #731 - Generate hints for collection members by @albertpchen in #769
- Update sbt-scalajs, scalajs-compiler, ... to 1.13.0 by @scala-steward in #762
- Update smithy-build, smithy-model to 1.27.1 by @scala-steward in #739
- More efficient parsing of json objects and arrays by @plokhotnyuk in #764
- Fix collection hint generation by @kubukoz in #775
- Fix missing struct member docs bug by @msosnicki in #776
- Fix typo in 01-smithy-idl by @zetashift in #777
- Adding operation @param documentation by @msosnicki in #781
- Update sbt-jmh to 0.4.4 by @scala-steward in #784
- Update smithy-build, smithy-model to 1.27.2 by @scala-steward in #785
- Add more docs on assembly by @etspaceman in #786
- Update cats-effect to 3.4.6 by @scala-steward in #788
- Upgrade to latest coursier by @cb372 in #790
- Dynamic compliance tests by @yisraelU in #747
- Fixes Scala code being copied in resources folder by @Baccata in #789
- Bump @docusaurus/preset-classic from 2.2.0 to 2.3.0 in /modules/website by @dependabot in #780
- Update alloy-core, alloy-openapi to 0.1.11 by @scala-steward in #793
- Tweak refinements by @daddykotex in #778
- Revise default value implementation by @Baccata in #792
- handle null values in default trait by @lewisjkl in #782
- adt trait for sealed hierarchies with common members by @lewisjkl in #787
- Ignore default on refinements by @daddykotex in #795
- Add an enumeration member to Enumeration.Value by @daddykotex in #794
- Fix tests after problematic concurrent merges by @Baccata in #796
- fix adt docs by @lewisjkl in #798
- add smithy model transformation docs by @lewisjkl in #800
- Emit warning on default trait on refined types by @daddykotex in #799
- Tweak AWS docs to show list of supported services by @Baccata in #801
- [ci skip] Changelog for the upcoming 0.17.3 version by @Baccata in #797
New Contributors
- @albertpchen made their first contribution in #736
- @etspaceman made their first contribution in #786
- @cb372 made their first contribution in #790
Full Changelog: v0.17.2...v0.17.3