Skip to content

Implement several feature requests and cleanup code

Compare
Choose a tag to compare
@wravery wravery released this 05 May 22:09
· 189 commits to main since this release
c0d6bf1

Possible Breaking Changes

Most users should not notice the difference, but there are a few things that might require changes to your code or build settings:

  • Almost every struct and method/function that returns anything is now decorated with [[nodiscard]], so you may get compiler warnings where you did not before. If you treat warnings as errors, this could also break your build.
  • The [[nodiscard]] annotations led me to notice that I was not checking the result of the ResolverContext::NotifySubscribe/ResolverContext::NotifyUnsubscribe resolvers in subscribe/unsubscribe. I decided in 63ef2ce that subscribe/unsubscribe ought to propagate the errors by throwing an exception. If you have a default subscription object and it does not handle every field gracefully in the ResolverContext::NotifySubscribe/ResolverContext::NotifyUnsubscribe case (for instance you are using the NYI generated stubs which throw exceptions), you may need to work around that. The changes in #240 allow a couple of ways to do that:
    • If you do not handle the ResolverContext::NotifySubscribe/ResolverContext::NotifyUnsubscribe resolver calls, you can leave the default subscription object on Operations empty and it will skip that call. You need to override the default (empty) subscription object in each call to deliver if you were not already doing that, since the default subscription object is also used by deliver in the absence of an override.
    • You can override the subscription object used for ResolverContext::NotifySubscribe/ResolverContext::NotifyUnsubscribe now in subscribe/unsubscribe, as an additional member in RequestSubscribeParams/RequestUnsubscribeParams.
  • PR #241 added support for generating multiple operation objects in a single request document from clientgen. Part of that involved moving the enum and input type declarations to a shared namespace (already specified with the --namespace parameter). They are re-exposed with using statements in the per-operation namespace, but since the input types used to be declared inline as part of the Variables struct, you may need to remove the Variables:: scope from code which references them. You can now reference them from either the --namespace shared namespace or the per-operation namespace which still contains the Variables struct.

What's Changed

  • Add a migration guide from v3.x to v4.x by @wravery in #236
  • Add constexpr support to internal::sorted_map and internal::sorted_set by @wravery in #237
  • Make the default subscription object optional and allow an override for subscribe/unsubscribe by @wravery in #240
  • Output all operations from clientgen if the --operation flag is not specified by @wravery in #241
  • Code cleanup by @wravery in #242
  • Update docs for next release by @wravery in #243

Full Changelog: v4.2.0...v4.3.0