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

Any plans for the ES version? #82

Open
vincentdchan opened this issue Jul 22, 2022 · 6 comments
Open

Any plans for the ES version? #82

vincentdchan opened this issue Jul 22, 2022 · 6 comments

Comments

@vincentdchan
Copy link

Hello quill team:

I am developing an editor with the delta library. It seems that the version on NPM is a common.js version. (The code are under dist/ folder)

I need a ESModule version. So I forked the repo.

I want es version published with the common.js version:
/dist for common.js version
/es for es version

If you agree with this, I can submit a PR.

@vincentdchan vincentdchan changed the title Any plays for the ES version? Any plans for the ES version? Jul 26, 2022
@luin
Copy link
Member

luin commented May 19, 2023

As long as the dual package hazard is still an issue, I don't think we would publish delta as a dual package. We have to stick with CJS or publish it as a pure ESM package.

@vincentdchan
Copy link
Author

I would strongly recommend using an esm package because Delta is a quite pure package.

@luin
Copy link
Member

luin commented May 19, 2023

Yeah I agree that ESM is the future. However, since this package runs on Node.js, I am not certain that it is currently mature enough to publish as a pure ESM package. Some people still hate dynamic imports for consuming ESM packages from CJS env.

@lensbart
Copy link

lensbart commented Dec 3, 2023

@luin I think the dual package hazard can be avoided by allowing importing the ES modules version from 'quill-delta/es'. That way, both versions of the package aren’t loaded at the same time and there seems to be no downside.

I am not certain that it is currently mature enough

Could you clarify what is missing? From experience, ESM on Node works more than well enough.

Thanks!

@vincentdchan
Copy link
Author

@lensbart I forked a version quill-delta-es and it works for my project.

It supports both esm an cjs version by the exports field in package.json. You can try it.

https://github.com/vincentdchan/delta-es/blob/main/package.json

@Exac
Copy link

Exac commented Oct 14, 2024

@luin Let's bump up the major version and publish only ESM code then?

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

No branches or pull requests

4 participants