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

Upgrade to esm dependency versions #5840

Closed
4 tasks done
Shinigami92 opened this issue Nov 25, 2021 · 8 comments
Closed
4 tasks done

Upgrade to esm dependency versions #5840

Shinigami92 opened this issue Nov 25, 2021 · 8 comments
Labels

Comments

@Shinigami92
Copy link
Member

Clear and concise description of the problem

Currently there are some libraries (Vite is using) that only supports esm.

Namely these are currently:

  • node-fetch
  • periscopic
  • strip-ansi

// ESM Only => https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-move-my-commonjs-project-to-esm
"node-fetch",
"periscopic",
"strip-ansi"

And execa: #5784

Suggested solution

I'm not quite sure what we need to do to support these 🤔

Maybe we need also to use package.json's "type": "module"?

Alternative

No response

Additional context

This also helps to archive #5839

Validations

@github-actions
Copy link

Hello @Shinigami92. We like your proposal/feedback and would appreciate a contribution via a Pull Request by you or another community member. We thank you in advance for your contribution and are looking forward to reviewing it!

@Shinigami92 Shinigami92 changed the title Upgrade Vite to be able to use esm only dependencies Upgrade to esm dependency versions Nov 25, 2021
@benmccann
Copy link
Collaborator

Related: node-fetch/node-fetch#1289

@stygian-desolator
Copy link
Contributor

Maybe we can wait until after TypeScript 4.6 to do this. 🤔
Announcing TypeScript 4.5 Beta - ECMAScript Module Support in Node.js

@Shinigami92
Copy link
Member Author

TS 4.6 will come out before Vite 3.0
See https://github.com/microsoft/TypeScript/issues/46858
So I think this would be okay

@benmccann
Copy link
Collaborator

I'm confused because you said 4.6 but then linked to the 4.5 release notes

@stygian-desolator
Copy link
Contributor

I'm confused because you said 4.6 but then linked to the 4.5 release notes

Sorry, I forgot to explain clearly that TypeScript 4.5 delayed the official release of this feature and replaced it with an experimental feature, so we'd better wait until TypeScript 4.6.

Experimental Nightly-Only ECMAScript Module Support in Node.js

@skimhugo
Copy link

node.js support for TypeScript is in 4.7

@bluwy
Copy link
Member

bluwy commented Jun 26, 2022

Fixed in #8572

@bluwy bluwy closed this as completed Jun 26, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jul 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants