slab / delta

Simple and expressive JSON format for describing rich-text content and their changes
https://quilljs.com/docs/delta
BSD 3-Clause "New" or "Revised" License
914 stars 130 forks source link

Any plans for the ES version? #82

Open vincentdchan opened 2 years ago

vincentdchan commented 2 years ago

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.

luin commented 1 year ago

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 commented 1 year ago

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

luin commented 1 year ago

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 commented 11 months ago

@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 commented 11 months ago

@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 commented 2 weeks ago

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