-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Leverage TypeScript 4.7 upgrade for deep type imports #2514
Comments
Having second thoughts if this is really a 1.0 issue in the sense that it blocks a 1.0 release. If we get to releasing 1.0 before TS 4.5 is out the door and VS Code includes it in its latest version, we could do it, but even then not all users might be on the latest version of VS Code immediately, which will result in quite some friction. |
TS 4.5 is out. We need to wait on Vite and ESBuild to update accordingly first and then do this and #2654 in one sweep. |
Removed this from the 1.0 milestone, a backwards-compatible solution should be preferred for now. TS 4.6 at the earliest might contain stable support (which is more than 2 months from now) and even then it's not set in stone that everything will work reliably. |
I sent a PR to upgrade to TypeScript 4.6: #4190. However, it looks like this feature is still only available in nightly (microsoft/TypeScript#33079 (comment)). We can check back in again for TypeScript 4.7 |
TS 4.7 will probably have the new resolution but we will likely not enforce it on the user (yet?). I don't know if export maps and type resolution will work for non-nodenext, too. If not, we won't be changing this. |
We're on TypeScript 4.7 and have added a I don't know if we want to add |
Not sure if we should do this in the near future. TypeScript ignores the package exports map if you don't opt in to the new module/moduleresolution (Node16 or NodeNext) - but if you do opt in to these, you are also required to adhere to the "always add explicit file endings" rules, so you need to write imports like |
Does this work with |
This is obsoleted by the the |
Describe the problem
Right now we have to do ambient module hacks to define a public API through hand-written
d.ts
files for deep imports like@svelte/kit/hooks
.Describe the proposed solution
TypeScript 4.5 will support the
exports
field of apackage.json
along with a special import fortypes
: microsoft/TypeScript#33079 (comment)This means we could do
If we do this we require people to use a compatible version of TypeScript which would be breaking change, so it would need to happen before 1.0 ideally.
Alternatives considered
hooks/index.d.ts
where TS should pick it upImportance
would make my life easier
Additional Information
No response
The text was updated successfully, but these errors were encountered: