-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat: support TypeScript 5.8 #10903
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
feat: support TypeScript 5.8 #10903
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated change, is there a reason to include it here?
This showed up in other places -at least #10887, cc @kirkwaiblinger- so maybe we need to do this in
main
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, see #10903 (comment)
My theory is - but I haven't checked it yet - that TypeScript 5.8 behaves slightly different with deep imports in CommonJS modules that don't have specific secondary entry points.
On TS 5.7 this is not an issue, so I think it belongs to this PR. Although we could also add this to
main
first of course.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had a poke around, and the change is due to microsoft/TypeScript#61057. TL;DR you can't omit the
/index.js
whenimport
ing from ESM in node. Seemingly executing with tsx rather than node has been preventing this from being a runtime error for us so far, but the TS 5.8 error is correct, and, accordingly, so is this change. 👍 Also @JamesHenry is aware and might tweak things on thenx
side (whether just the docs or adding a subpathexports
field)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for plan of action - both #10887 and this PR genuinely need this change for different reasons (TS type-checking error here, and runtime error when using node 23.6, which #10887 resolves), so I'd say let's just keep the change in both PRs and whichever is merged first is merged first 🤷♂️