Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core(fr): fix usage of distributed conditional type #12565

Merged
merged 4 commits into from
May 26, 2021

Conversation

adamraine
Copy link
Member

Incorrect behavior when defining multiple dependencies in FRTransitionalContext. This was caused by distributed conditional types.

@adamraine adamraine requested a review from a team as a code owner May 26, 2021 18:46
@adamraine adamraine requested review from connorjclark and removed request for a team May 26, 2021 18:46
@google-cla google-cla bot added the cla: yes label May 26, 2021
Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

nice hunting it down! 🎉

@@ -45,7 +45,7 @@ declare global {
/** The cached results of computed artifacts. */
computedCache: Map<string, ArbitraryEqualityMap>;
/** The set of available dependencies requested by the current gatherer. */
dependencies: TDependencies extends DefaultDependenciesKey ?
dependencies: [TDependencies] extends [DefaultDependenciesKey] ?
Copy link
Collaborator

Choose a reason for hiding this comment

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

DefaultDependenciesKey isn't actually a union, just an alias, so I wouldn't expect to need brackets around that.

Suggested change
dependencies: [TDependencies] extends [DefaultDependenciesKey] ?
dependencies: [TDependencies] extends DefaultDependenciesKey ?

@patrickhulce
Copy link
Collaborator

btw I think this exposes a real type failure in the places where we assumed {} met the requirement for dependencies in context. We might just need to cast those for now, since we can't teach ts to narrow the type yet.

@adamraine
Copy link
Member Author

btw I think this exposes a real type failure

These were the issues that appeared when we removed the condition. I'm gonna try removing the condition to see if that works.

@connorjclark connorjclark changed the title core(fr): distributed conditional type core(fr): fix usage of distributed conditional type May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants