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: compatibility with Typescript V4 #837

Closed
wants to merge 1 commit into from

Conversation

bobvandevijver
Copy link

With #833 the type export was added, but the export type * syntax is only available since Typescript V5. Using direct imports should resolve the issue.

See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#support-for-export-type- for the documentation on this.

With uuidjs#833 the type export was added, but the `export type *` syntax is only available since Typescript V5. Using direct imports should resolve the issue.
@broofa
Copy link
Member

broofa commented Nov 11, 2024

Thanks for the contribution.

FWIW, I specifically requested the wildcard export to make this code more future-proof. I am admittedly reluctant to go back on that.

This prompted me to do a bit of digging to figure out what our TS support policy should be since that hasn't really been discussed yet. Based on this comment, it sounds like there's good precedent for adopting a policy of supporting TS versions less than two years old, only. This also aligns roughly with our long-standing node support policy (LTS versions + one prior).

As it turns out, TS 4.9 - the last 4.X version released - will fall below that bar at the end of this week. I promise, I did not plan this. 😄

Given the above, I don't see a need for this change.

@broofa broofa closed this Nov 11, 2024
@bobvandevijver
Copy link
Author

bobvandevijver commented Nov 12, 2024

@broofa First of all, thanks for doing the research on this!

While I understand the reasoning behind your decision, I do find it a bit harsh to just drop a major typescript version in a patch release only because of a type export that has just a little bit of overhead and which also isn't very common to change (its not like we have new UUID versions dropping every month).

As it turns out, TS 4.9 - the last 4.X version released - will fall below that bar at the end of this week.

4.9.5 has been released on Jan 31, 2023.

In the very least some documentation about this support choice should be provided, but I do hope that we can get Typescript V4 support back in v11 and to drop it with good documentation in v12.

@broofa
Copy link
Member

broofa commented Nov 12, 2024

TS4.9.5 appears to work just fine with uuid@11.0.3, both on the command line and VSCode. Here's the test I used....

uuid-ts-types-test.zip

Given that and that uuid@11 has only been out for three weeks, and TS@4 falling off the support matrix for other similar projects (Definitely typed, typescript-eslint)... I'm okay leaving things as they stand.

@bobvandevijver
Copy link
Author

@broofa That would be because you have explicitly disabled the check in your test with skipLibCheck: true. If you remove that line you will see the error directly.

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

Successfully merging this pull request may close these issues.

2 participants