Skip to content

Release v20.52.0

Choose a tag to compare

@github-actions github-actions released this 08 Jul 19:48
dcb9809

Summary

Two independent developer-experience improvements ship together here.

On the frontend, useDialog now infers the dialog component's input type, so dialog components can be used without the as unknown as ComponentType<TInput> cast, and a mismatched component becomes a compile-time error. The generic order is unchanged, so this is non-breaking — existing call sites keep compiling and can simply drop their cast.

On the backend, a set of Arc Roslyn analyzers now catch common command, authorization, and exception-handling mistakes at build time — with code fixes where the rewrite is unambiguous — so these slip-ups surface in the editor instead of at runtime.

Added

  • Analyzer (ARC0010) that flags a [Command] Handle() returning Task/Task<T> without awaiting anything — including the Task.FromResult/Task.CompletedTask wrapper shape the compiler's own CS1998 does not catch — with a code fix that unwraps it to the synchronous return shape the command pipeline already accepts.
  • Analyzer (ARC0011) that flags a [Roles(...)] string-literal argument, with a code fix that rewrites it to nameof(<EnumType>.<Member>) so a role rename becomes a compile error instead of a silent authorization failure.
  • Analyzer (ARC0012) that flags built-in exception types (Exception, InvalidOperationException, ArgumentException, and the like) thrown from Arc artifacts — command Handle() methods, CommandValidator<T>/ConceptValidator<T> validators, and reactor handlers — steering domain failures toward domain-named exception types.

Changed

  • useDialog infers the dialog component's input type directly, so a component typed as (props: TInput) => JSX.Element (reading closeDialog from useDialogContext) is accepted without an as unknown as ComponentType<TInput> cast, and a component whose input type does not match is now a compile error.