Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Fix Signature integration for external consumers #392

Merged
merged 3 commits into from
Apr 8, 2022

Conversation

dfreeman
Copy link
Contributor

@dfreeman dfreeman commented Apr 8, 2022

There are two hazards currently facing consumers of the mostly-private ExpandSignature type that landed in #385.

  • The Signature RFC called for a Params wrapper around the fully-expanded form of a block definition, which is missing here when the user provides the shorthand
  • v1 and v2 of @glimmer/component publish their types in different locations (alone in dist/types/... in v1, but alongside the implementation indist/{modules,commonjs}/... in v2)

This PR adds the missing { Params: ... } wrapper and a typesVersions entry that will allow for a standardized import path between v1 and v2 for privileged consumers of the ExpandSignature type.

I'll also plan to open an equivalent PR to this one against the v1.x branch, assuming everything looks ok here.

/cc @chriskrycho

@@ -68,7 +68,7 @@ type _ExpandSignature<T> = {
Blocks: 'Blocks' extends keyof T
? {
[Block in keyof T['Blocks']]: T['Blocks'][Block] extends unknown[]
? { Positional: T['Blocks'][Block] }
? { Params: { Positional: T['Blocks'][Block] } }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this (and my bad for missing it)!

Copy link
Contributor

@chriskrycho chriskrycho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💙 thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants