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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TypeScript in SDK #22065

Closed
wants to merge 6 commits into from
Closed

Update TypeScript in SDK #22065

wants to merge 6 commits into from

Conversation

paescuj
Copy link
Member

@paescuj paescuj commented Apr 3, 2024

Scope

Update TypeScript version to 5.4 for the SDK

Had to hold back the TypeScript update to 5.4 for the SDK (and therefore also in docs) in #22063 because the newer version introduced a compilation error:

src/types/fields.ts:33:13 - error TS2322: Type 'Relations & RelationalFields<Schema, Item>' is not assignable to type 'string | number | symbol'.

33     [Key in RelationalFields<Schema, Item>]?: Extract<Item[Key], ItemType<Schema>> extends infer RelatedCollection
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@br41nslug Would you mind taking a look at this issue? 馃檹 Seems like it cannot be used as a key, maybe we can narrow down, assert or introduce a check for the type 馃

Potential Risks / Drawbacks

Potential type issues

Review Notes / Questions

None

Copy link

changeset-bot bot commented Apr 3, 2024

馃 Changeset detected

Latest commit: ec9b9db

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@directus/sdk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@br41nslug
Copy link
Member

Oh fun 馃槄

@paescuj paescuj marked this pull request as ready for review April 3, 2024 16:57
@paescuj paescuj changed the title [WIP] Update TypeScript in SDK Update TypeScript in SDK Apr 3, 2024
@paescuj
Copy link
Member Author

paescuj commented Apr 3, 2024

It looks like this breaking change was the cause https://devblogs.microsoft.com/typescript/announcing-typescript-5-4-beta/#breaking-changes#more-aggressive-reduction-of-intersections-between-type-variables-and-primitive-types

Wow, thanks for the fast fix 馃殌鉂わ笍 Sounds like that's exactly it 馃憤

Copy link
Member Author

@paescuj paescuj left a comment

Choose a reason for hiding this comment

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

Checked & the fix looks good to me 馃憤

@paescuj
Copy link
Member Author

paescuj commented Apr 17, 2024

Superseded by #22211

@paescuj paescuj closed this Apr 17, 2024
@paescuj paescuj deleted the update-ts-sdk branch April 17, 2024 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants