Open vincentdchan opened 2 years 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.
I would strongly recommend using an esm package because Delta is a quite pure package.
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.
@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!
@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
@luin Let's bump up the major version and publish only ESM code then?
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 versionIf you agree with this, I can submit a PR.