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

Convert to ESM only #238

Closed
remcohaszing opened this issue Apr 5, 2021 · 13 comments · Fixed by #348
Closed

Convert to ESM only #238

remcohaszing opened this issue Apr 5, 2021 · 13 comments · Fixed by #348

Comments

@remcohaszing
Copy link
Contributor

On 2021-04-30, 25 days from now, NodeJS 10 will reach end of life. From that point all NodeJS environments will support ESM. Of course module bundlers already support this.

There are two older pull requests to achieve this. Both are trying to keep backwards compatibility

I think it’s time to drop support for alternative module systems and bower, meaning no new devdependencies are needed.

Bower users can depend on specific git tags. It the master branch should keep working for Bower users, perhaps a new main branch should be created for further development, so the master branch can stay untouched indefinitely.

I expect this to get some backlash at first from people who don’t like breaking changes, but this is what major releases are for in semver.

@JedWatson
Copy link
Owner

This is really close to something @dcousens and I were talking about just last week 👍

I am not sure that having master and main both in the project will make it easier for most people but it's definitely an interesting idea!

But really at this point I think a new major version that's future-facing would be great.

@remcohaszing
Copy link
Contributor Author

I am not sure that having master and main both in the project will make it easier for most people but it's definitely an interesting idea!

I wouldn’t reommend it though. This was purely an idea not to break bower users depending on the master branch, which I think is a bad idea anyway.

@jonkoops
Copy link
Collaborator

@remcohaszing I believe that Node 12 (which is an LTS version) does not support this syntax unless you explicitly pass the --experimental-module flag when starting Node. Perhaps this is not so for packages, but I cannot find any documentation that indicates this.

@remcohaszing
Copy link
Contributor Author

From https://nodejs.org/en/blog/release/v12.22.0/

ES Modules

ES Modules are now considered stable.

Contributed by Guy Bedford #35781

@jonkoops
Copy link
Collaborator

Nice, that's great. Glad the Node team decided to flip this one on in a minor release.

@jonkoops
Copy link
Collaborator

I've forked the repo and played around a bit to see what the impact is of switching to ES modules (see #243).

@jonkoops
Copy link
Collaborator

jonkoops commented Sep 4, 2021

I believe this issue can be closed as this has been resolved on the next branch

@dcousens dcousens closed this as completed Sep 5, 2021
@otakustay
Copy link

Do we have an estimate on the release time of next branch? For now tools like vite are getting more and more popular, they heavily rely on ESM packages.

@jonkoops
Copy link
Collaborator

jonkoops commented Dec 6, 2021

I think it might be time to add a tracking issue to see what needs to be resolved before it is released. I don't think there is much to do besides to use more modern ES syntax, which can also be done at a later point.

@ptgamr
Copy link

ptgamr commented Jun 25, 2023

+1 to this issue, currently get this issue bundling with Vite

caught SyntaxError: The requested module '/@fs/...../node_modules/classnames/index.js?v=5eae925e'
does not provide an export named 'default'

@jonkoops
Copy link
Collaborator

@dcousens @JedWatson how would you feel about merging next into main? I can volunteer time if there are issues to be resolved for the next major.

@FrSenpai
Copy link

+1 to this issue, currently get this issue bundling with Vite

caught SyntaxError: The requested module '/@fs/...../node_modules/classnames/index.js?v=5eae925e'
does not provide an export named 'default'

Same problem here, on vite too... Any ideas to fix it ?

@jonkoops
Copy link
Collaborator

Re-opening this for administrative reasons, we have yet to merge this work into main.

@jonkoops jonkoops reopened this Dec 28, 2023
@jonkoops jonkoops added feature and removed question labels Dec 28, 2023
@jonkoops jonkoops mentioned this issue Dec 28, 2023
@jonkoops jonkoops added this to the 3.0.0 milestone Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants