the-road-to-1-0.mdx 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. ---
  2. title: The Road to 1.0
  3. date: 2015-09-15
  4. ---
  5. Quill launched with the ambitious goal of becoming _the_ rich text editor for the web, being both easy to use for drop in use cases, and powerful enough for complex ones. Its current [API](/docs/api) is core to those goals.
  6. In the past months, much effort has been placed into providing even greater means for customization, particularly the editor's contents. With this nearing completion, Quill is approaching its 1.0 coming of age.
  7. ### Parchment
  8. A full introduction and guide to Parchment is still forthcoming, but in short it is a new document model for Quill. An editor's document model is an important abstraction over the DOM that allows the editor and API users to reason about its contents through a much simpler yet more expressive interface than directly interacting with the browser. For Quill, this enables an elegant solution to the longstanding problem of format customization.
  9. {/* more */}
  10. Prior to Parchment, Quill required near complete control over its editor container and descendant DOM nodes in order to provide its precise retrieval and manipulation API. Even simple modifications such as changing the default link open behavior required hacks and defining new content types, such as syntax highlighted code, was impossible.
  11. Parchment hands control of entire subtrees back to the user, allowing the definition of new nodes or overwriting existing ones. The requirement is that certain methods such as `getValue` and `getFormat` be defined in order to happily exist within a Parchment document. Those familiar will find this very similar to `render` and Components in [React](https://facebook.github.io/react/), a significant influencer of Parchment's design.
  12. While the Parchment interface is still being stabilized, a preview of a definition for a [KaTeX](https://github.com/Khan/KaTeX) equation looks like this (with ES6 syntax):
  13. ```javascript
  14. class Equation extends Parchment.Embed {
  15. constructor(value) {
  16. super(value);
  17. this.value = value;
  18. this.domNode.setAttribute('contenteditable', false);
  19. katex.render(value, this.domNode);
  20. }
  21. getValue() {
  22. return this.value;
  23. }
  24. }
  25. Quill.registerFormat(Equation);
  26. ```
  27. The current priority is to integrate Parchment into Quill as its new document model. However, Parchment is and will remain organized as its own [repository](https://github.com/quilljs/parchment), as it was designed as a general purpose tool. Hopefully one day it may serve as the document model for other editors as well.
  28. ### Formats
  29. Parchment opens the doors to scalably support many more formats, many of which will be included in the 1.0 release. The complete list is not ready for announcement but they will at least include semantic headers and nested lists. Equations and syntax highlighted code will also be added as separate repositories because of their likely dependency on external libraries.
  30. ### Modules
  31. Quill organizes most of its source code as modules to make it easy to overwrite their default behavior. Unfortunately a documentation gap currently exists for these modules--this will have to be filled for their extensibility to be realized.
  32. Some non-essential modules will also be moved out into their own repositories. Custom builds are planned to conveniently include or exclude these modules, along with other permutations, though this may land post 1.0 depending on timing.
  33. ### Beyond 1.0
  34. With Quill 1.0, the main foundations will be complete and much more emphasis will be placed into building examples and enhancing support, with internationalization, accessibility, and cross application interactions (copy/paste) as main focus points.
  35. In addition, Quill's UI is due for an upgrade. While the aesthetics of Quill is already completely customizable, more numerous defaults could be available for those wanting a drop in solution. Here's a sneak peak at a couple of upcoming themes in the works:
  36. <p>
  37. <img
  38. className="road-1-theme-preview"
  39. src="/assets/images/blog/theme-1.png"
  40. alt="Quill Theme 1"
  41. />
  42. <img
  43. className="road-1-theme-preview"
  44. src="/assets/images/blog/theme-2.png"
  45. alt="Quill Theme 2"
  46. />
  47. </p>
  48. Finally, the community deserves a great thank you for all of your contributions and support! All the [bug reports](https://github.com/quilljs/quill/labels/bug), [features suggestions](https://github.com/quilljs/quill/labels/feature) and [pull requests](https://github.com/quilljs/quill/pulls?q=is%3Apr) make Quill what it is today. Keep these coming! Exciting times are ahead for web editing and for Quill.