upgrading-to-2-0.mdx 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. ---
  2. title: Upgrading to 2.0
  3. ---
  4. Quill has been significantly modernized. Leveraging the latest browser-supported APIs, Quill now delivers a more efficient and reliable editing experience.
  5. ## Quill
  6. The Quill repository has been rewritten in TypeScript, providing an official TypeScript definition file.
  7. - If you have `@types/quill` installed, uninstall it, as it is no longer needed
  8. - SVG icons are now inlined in the source code, eliminating the need to set up loaders for .svg files in your bundler.
  9. ### Options
  10. - `strict` *removed*
  11. Previously some changes that were small in practice (renames) but would warrant a semver major bump would be hidden under this configuration.
  12. This ended up being more confusing than helpful as we will no longer make use of this.
  13. - `registry` - added to allow multiple editors with different formats to coexist on the same page. [Learn more](/docs/registries).
  14. - `scrollingContainer` *removed*
  15. Quill will now automatically detect the scrollable ancestor, eliminating the need to provide this option. This new behavior is more robust and works seamlessly with nested scrollable elements.
  16. ## Clipboard
  17. - `convert` - API changed to include both HTML and text and previous functionality is broken into multiple method calls (`convert`, `onCapturePaste`) to allow more surface to hook into.
  18. - `onCapturePaste` - Added
  19. ### Configuration
  20. - `matchVisual` *removed* - Previously there was a choice between using visual or semantic interpretation of pasted whitespace; now just the semantic interpretation is used. Visual matching was expensive, requiring the DOM renderer which is no longer available in the new clipboard rewrite.
  21. - `pasteHTML` *removed* - Deprecated alias to `dangerouslyPasteHTML`.
  22. ## Keyboard
  23. - Binding `key` is no longer case insensitive. To support bindings like `key: '@'`, modifiers are taken into account so the shift modifier will affect case sensitivity.
  24. - Binding `key` now supports an array of keys to easily bind to multiple shortcuts.
  25. - Native keyboard event object is now also passed into handlers.
  26. ## Parchment
  27. - All lists use `<ol>` instead of both `<ul>` and `<ol>` allowing better nesting between the two. Copied content will generate the correct semantic markup for paste into other applications.
  28. - Code block markup now uses `<div>` to better support syntax highlighting.
  29. - Static `register` method added to allow dependent chains of registration.
  30. - Static `formats` method now passes in `scroll`.
  31. - Blot constructor now requires `scroll` to be passed in.
  32. - Attributors are exported as top-level classes.
  33. Instead of accessing class attributor via `Parchment.Attributor.Class`, you now use it at `Parchment.ClassAttributor`.
  34. Similarly, `Parchment.Attributor.Style` is now `Parchment.StyleAttributor`, and `Parchment.Attributor.Attribute` is now `Parchment.Attributor`.
  35. - Exports are using full names.
  36. Instead of `Parchment.Scroll`, you now use `Parchment.ScrollBlot`. The similar change applies to `Parchment.Embed`, `Parchment.Text`, `Parchment.Block`, `Parchment.Inline`, and more.
  37. ## Delta
  38. - Support for the deprecated delta format, where embeds had integer values and list attributes had different keys, is now removed
  39. ## Browser
  40. - Internet Explorer support is dropped.