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

fix(router): Correctly infer generic for <Set> #11768

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

Tobbe
Copy link
Member

@Tobbe Tobbe commented Dec 11, 2024

This PR depends on #11756, so they have to be released together

@Tobbe Tobbe added release:fix This PR is a fix changesets-ok Override the changesets check labels Dec 11, 2024
@Tobbe Tobbe added this to the next-release milestone Dec 11, 2024
@Tobbe Tobbe enabled auto-merge (squash) December 11, 2024 23:57
@Tobbe Tobbe merged commit 8e1644a into redwoodjs:main Dec 12, 2024
51 of 53 checks passed
@Tobbe Tobbe deleted the tobbe-set-ts-infer-p branch December 12, 2024 00:15
@Philzen
Copy link
Contributor

Philzen commented Dec 12, 2024

Actually, this change introduced this bug for me:

grafik

… and also it broke TS hinting for required props of the first component in a wrap-array.

What exactly did it fix though? 😉

@Tobbe
Copy link
Member Author

Tobbe commented Dec 12, 2024

In hindsight, and with the knowledge I've gained since merging this PR I don't think this change makes much sense in isolation.

The problem with wrap?: P | P[] is that you won't be able to get the types of the individual elements in the original array. Because P will be a weird union of all of the element types. (At least that's my current understanding)

@Tobbe Tobbe changed the title fix(set): Correctly infer generic fix(router): Correctly infer generic for <Set> Dec 26, 2024
@Tobbe Tobbe changed the title fix(router): Correctly infer generic for <Set> fix(router): Correctly infer generic for ´<Set>´ Dec 26, 2024
@Tobbe Tobbe changed the title fix(router): Correctly infer generic for ´<Set>´ fix(router): Correctly infer generic for <Set> Dec 26, 2024
Tobbe added a commit to Tobbe/redwood that referenced this pull request Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changesets-ok Override the changesets check release:fix This PR is a fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants