There are a couple relevant changes that make this upgrade necessary:
bug fixes with type inference using union literal types (5.1) A good majority of the TS changes that make all the type inference possible revolve around creating large union literal types from component manifests. Prior versions of TS struggled to correctly narrow these union types progressively as a user partially satisfies the interface.
added extends constraints when using infer (4.7) Previous versions of TS required a second infer statement in order to constrain an extends infer X statement. We utilize this pattern extensively which resulted in types that were overly difficult to grok.
There are a couple relevant changes that make this upgrade necessary:
bug fixes with type inference using union literal types (5.1) A good majority of the TS changes that make all the type inference possible revolve around creating large union literal types from component manifests. Prior versions of TS struggled to correctly narrow these union types progressively as a user partially satisfies the interface.
vastly improve performance for conditional and union literal types (5.1) https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-1.html#negative-case-checks-for-union-literals
added
extends
constraints when usinginfer
(4.7) Previous versions of TS required a secondinfer
statement in order to constrain anextends infer X
statement. We utilize this pattern extensively which resulted in types that were overly difficult to grok.