Support different builds of Quill #834
Open
+23
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello!
This is a POC for supporting different builds of Quill with ReactQuill.
My idea is to make a separate module called
core. This module doesn't depend onquillmodule at the runtime. It only requiresquillfor type checking.coreexpects that the user will setReactQuill.Quillvalue to aQuillcompatible class, i.e. something that is able to construct an object compatible with Quill interface. Instead of building instance of Quill withnew Quilldirectlycoremodule builds whatever is set toReactQuill.Quillwithnew ReactQuill.Quill(...).To make my changes backwards compatible I implement
indexmodule which is based oncoreand is settingReactQuill.Quillto the regularQuillinstance at the runtime.Now, if someone wants to use a different Quill version they can just use
coremodule instead ofindexand setReactQuill.Quillfor whatever they want to.My use-case for these changes is that I want to avoid using the regular Quill build, the one from
quill/dist/quill.js. I want to use the Quill core version fromquill/coreorquill/dist/core. In general anything that is compatible withQuillinterface can be used withReactQuill, for example custom builds of Quill.