NPM package bundles Parchment and quill-delta but also depends on them in package.json
See original GitHub issueWhen installing Quill with npm install quill
then parchment
and quill-delta
are installed as separate dependencies but are not used by Quill because Quill contains a bundled copy of the two libraries.
This duplication is confusing because a developer intuitively imports the parchment
module with require
or ES6 imports to write custom attributors for example. But this can’t work and ends in an error like BlotClass.create is not a function
because wrong classes are passed around. So the libraries must be imported through Quill instead (With Quill.import("parchment")
and Quill.import("delta")
). Especially when using TypeScript this is annoying because Parchment itself is perfectly typed but when importing it through Quill then no type information is present.
It would be nice if this could be cleaned up somehow. Maybe you could ignore parchment
and quill-delta
in Webpack so these two libs are referenced as external dependencies? If that’s not possible then it would be nice if you could at least reference the libs as dev-dependencies so they are not installed together with Quill.
I haven’t checked the other dependencies (clone
, deep-equal
, eventemitter3
and extend
). When these libs are also bundled into dist/quill.js
then this could be cleaned up as well by excluding them from the bundle or marking them as dev dependencies.
Version: 1.3.5
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:10 (5 by maintainers)
There is a difference between you have to do and you can do. The example is an example of what you can do, which is one of many options.
I do have a difficult time understanding you because half of the claims made I do not believe is true, for example what I just pointed out, so it makes me not optimistic we can have a discussion that will lead to a solution.
Either way your concern is noted and well documented in this Issue and I will take another look when I have time and come up with my own solution.
You don’t need to spend four paragraphs rehashing what you already said in the original comment…
Solution 2 seems to pretty much breaks Quill for the average user? If a casual user just came along added Quill as a dependency in their app, and did
import Quill from 'quill';
it will no longer just work. They will also have to be aware of Parchment, quill-delta, etc and add those as dependencies too.