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

Consider using ^ on the version of the quill-delta dependency. #1748

Closed
danfuzz opened this issue Oct 9, 2017 · 0 comments
Closed

Consider using ^ on the version of the quill-delta dependency. #1748

danfuzz opened this issue Oct 9, 2017 · 0 comments

Comments

@danfuzz
Copy link

danfuzz commented Oct 9, 2017

Quill's use of an exact version for its quill-delta dependency leads to undesirable behavior when used in code which itself directly uses quill-delta but which specifies it with a ^ or ~ dependency spec.

Steps for Reproduction

  1. Make a package which uses both quill and quill-delta directly. Use ^ on the version numbers of each so as to be reasonably flexible with versions.
  2. Observe the resulting node_modules directory.

Expected behavior:

The build would only end up with one copy of quill-delta.

Actual behavior:

The build ends up with two copies of quill-delta, at different versions.

This happens because quill specifies its own quill-delta dependency as an absolute version instead of being flexible with a ^ or ~ in the version string (for example).

Platforms:

n/a

Version:

Note: This is a simplification. In reality, my project has multiple package.json files, and the one that uses quill directly is semi-independent of the one that uses quill-delta. For example, parts of the built product are server-side only, so they don't actually use quill at all, just quill-delta.

I noticed this problem on v1.3.2, when my package.json specified:

dependencies: {
  "quill": "^1.3.2"
  "quill-delta": "^3.4.3"
}

With this spec, before Quill v1.3.3 was published, this meant that I got quill v1.3.2 and quill-delta v3.6.2. However, Quill v1.3.2 requires exactly quill-delta v3.6.1. So, I ended up with a node_modules that also had v3.6.1. And my code that uses both quill and quill-delta directly would end up running with a mish-mash of instances of Delta, some the v3.6.1 version and others the v3.6.2 version.

In this particular case, the only problem was undesired code bloat. However, it's conceivable that a subtle difference in behavior between two versions of quill-delta might ultimately lead to a more nefarious (and hard to track down) problem.

Because I never want to ship bloated code, I've moved to specifying my project's own quill-delta version as an inflexible spec which I copy from quill, while I still refer to quill flexibly as ^1.3.3 (or similar). However, this means that whenever quill gets updated I have to manually track that change, lest I run into the reverse problem where a quill update specifies a newer quill-delta than I have. So, I now have code which explicitly tests to see if I ended up with two versions of quill-delta, and complains loudly if that happens. It'd be great if I could just go back to using ^ for quill-delta and stop worrying about all this.

Thanks for your consideration!

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

1 participant