Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
This work is ongoing and not ready yet.
There are lots of changes in this branch. But here's an overview of the big differences from an architectural point of view.
More coming, still in progress…
The data model is now comprised of simple JSON objects. Previously, it used Immutable.js data structures. This is a huge change, and one that unlocks many other things. Hopefully it will also increase the average performance when using Slate. It also makes it much easier to get started for newcomers. This will be a large change to migrate from, but it will be worth it.
Interfaces & Namespaces
The data model is interface-based. Previously each model was an instance of a class. Now, not only is the data plain objects, but Slate only expects that the objects implement an interface. So custom properties that used to live in
The codebase now uses TypeScript. Working with pure JSON as a data model, and using an interface-based API are two things that have been made easier by migrating to TypeScript. You don't need to use it yourself, but if you do you'll get a lot more security when using the APIs. (And if you use VS Code you'll get nice autocompletion regardless!)
The number of interfaces and commands has been reduced. Previously
The number of commands has been reduced too. Previously we had commands for every type of input, like
In attempt to decrease the maintenance burden, and because the new abstraction and APIs in Slate's core packages make things much easier, the total number of packages has been reduced. Things like
Plugins are now plain functions that augment the
Block-ness and inline-ness is now a runtime choice. Previously it was baked into the data model with the
Will there be a migration guide (or any other documentation on how to upgrade) coming?
If not, I can try to contribute to one , if that would be helpful for others (will probably take detailed notes when I attempt this upgrade).
Also, this is amazing. I'm so excited for so many of these changes! Thank you!