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

Improve TypeScript 4.7 NodeNext compatibility #1721

Merged
merged 3 commits into from
Jul 27, 2022
Merged

Conversation

RobinMalfait
Copy link
Member

This PR improves the compatibility of the NodeNext module resolution in TypeScript 4.7.

We already rewrote the imports to include the .js file, but we only did this for generated .js
files and not for generated .d.ts files.

Ideally we don't have to do this rewrite on build files at all, and that is possible if we add the
.js files to the actual source files. However this has some (annoying) issues:

  • We then have to make sure that all tooling (Next.js, Jest, ...) works with .js files.
  • We will introduce a lot of changes, and this will cause annoying merge conflicts.
  • We will have to make sure that we always think about adding the .js file extension in the imports.

Instead, for now, rewriting imports on .d.ts files as we already do with .js file should do the trick,
because then the .js extensiosn will be there in import/export statements.

Fixes: #1699

@vercel
Copy link

vercel bot commented Jul 27, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
headlessui-react ✅ Ready (Inspect) Visit Preview Jul 27, 2022 at 11:16AM (UTC)
headlessui-vue ✅ Ready (Inspect) Visit Preview Jul 27, 2022 at 11:16AM (UTC)

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.

@headlessui/react is not compatible with TypeScript 4.7 NodeNext module resolution.
1 participant