Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

v10.0.0

Compare
Choose a tag to compare
@tommoor tommoor released this 19 May 15:54
· 48 commits to master since this release

v10.0.0 is a complete rewrite of the editor. It is incompatible with v9.0.0 and moves from using Slate to Prosemirror as the framework. Some reasoning behind this change is available in the the issue, but notably the release includes fixes for more than 20 issues, an order of magnitude increase in rendering performance, and support for soft keyboards (non-latin/mobile character input).

BREAKING CHANGES

Input / output

The output of the editor is slightly different than before. Empty paragraphs are now encoded with a backslash and checklists require a leading "-" character. Loading a document created in v9 in v10 will not render 1-1 without first migrating the data. You can do so with the following code:

import MarkdownSerializer from "slate-md-serializer";
const serializer = new MarkdownSerializer();
const nodes = serializer.deserialize(v9text);
const v10text = serializer.serialize(nodes, { version: 2 });

It is highly recommended you backup the original data.

Removed props

  • toc prop was removed. You can utilize the new getHeadings() method to build your own table of contents that matches the style of the host app, if required.
  • getLinkComponent prop was removed. It was replaced with a new structure for defining embeds.
  • plugins prop was removed. It's no longer possible to use Slate plugins, this was replaced with the extensions prop where Prosemirror plugins can be used to extend the editor instead.
  • hiddenToolbarButtons prop was removed, there is no replacement.
  • serializer prop was removed, there is no replacement.
  • theme prop keys changed to support new design.

Enhancements

  • We now export Typescript types.
  • New menu for inserting blocks is much more intuitive than before
  • "Highlight" now appears in floating formatting menu
  • Typing markdown shortcuts no longer requires space character to activate
  • It's now possible to type a markdown url #5
  • The markdown output is much cleaner #49
  • Quotes are converted to smart quotes as you type #81
  • It's now possible to change the editor value from outside by changing the value prop. #120
  • Toolbar adjusts to not display off-screen #117
  • It is now possible for custom embeds to be displayed in the block menu
  • onShowToast callback now includes an id as the second parameter that can be used to identify the message and provide your own text copy.
  • Support for paragraph breaks in lists.
  • Support for links in headings.

Fixes

  • Mobile input #141
  • Support for alternative input methods #126
  • Rendering performance increased by leaps and bounds #29
  • Issues with markdown shortcuts surrounded in whitespace not applying #110
  • Key handling in link editor #100
  • Adding a new row to a table now respects alignment #91
  • Many other errors throwing from the editor that were not captured in the issue tracker.