Skip to content

Release v22.144.0

Choose a tag to compare

@github-actions github-actions released this 27 Oct 03:56
33916b2

Commands and queries now know which module, feature and slice they belong to, on the backend and in the generated TypeScript proxies, so error handling, diagnostics and support tooling can say where something happened without extra configuration.

Added

  • SliceLocation in Cratis.Arc.Slices, a record of ModuleName, FeatureName and SliceName resolved from the same namespace mapping that places generated proxies (NamespaceRoot items and CratisProxiesSegmentsToSkip). SliceLocation.For(type) resolves any type, and ToString() gives Billing/Invoices/Pay. See Slice location. (#3533)
  • CommandContext.SliceLocation and QueryContext.SliceLocation hold the location of the executing command or query, for model-bound and controller-based commands and queries alike.
  • The Arc build emits [assembly: SliceNamespaceRoot(...)] and [assembly: SliceNamespaceSegmentsToSkip(...)] from the project's proxy configuration, so the runtime reads the same values the proxy generator does. Projects that do not build with the Arc MSBuild targets can declare the attributes themselves.
  • Generated command and query proxies declare a static readonly sliceLocation, importing Arc's type under the ArcSliceLocation alias so an application type named SliceLocation does not clash.
  • SliceLocation in @cratis/arc/reflection, with SliceLocation.of(instance) and SliceLocation.ofType(type) to read the location of a proxy, returning SliceLocation.empty when none is declared.

Changed

  • The slice location strips the Cratis.API namespace prefix exactly like the proxy output folder does, so the folder and the location never differ.
  • Upgrade @cratis/arc to the version matching the Arc NuGet packages before regenerating proxies: regenerated proxies import SliceLocation from @cratis/arc/reflection and do not compile against an older @cratis/arc. Proxies generated by an earlier version report SliceLocation.empty until regenerated.