question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NPM package bundles Parchment and quill-delta but also depends on them in package.json

See original GitHub issue

When 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:open
  • Created 6 years ago
  • Reactions:1
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jhchencommented, Feb 5, 2018

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.

1reaction
jhchencommented, Feb 4, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

package.json
This document is all you need to know about what's required in your package.json file. It must be actual JSON, not just a...
Read more >
react-quill-fixed - npm Package Health Analysis
The Quill rich-text editor as a React component. For more information about how to use this package see README.
Read more >
react-quill | Yarn - Package Manager
npm downloads. A Quill component for React. See a live demo or Codepen. Quick Start. With webpack or create-react-app; With the browser bundle....
Read more >
Delta
Delta. Deltas are a simple, yet expressive format that can be used to describe Quill's contents and changes. The format is a strict...
Read more >
Quill editor demo
This module depends on MathQuill, Quill and KaTeX, so you'll need to add ... makes packages from npm not only available on a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found