mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-25 16:20:49 +02:00
update changelog
This commit is contained in:
69
Changelog.md
69
Changelog.md
@@ -4,12 +4,33 @@
|
||||
This document maintains a list of changes to Slate with each new version. Until `1.0.0` is released, breaking changes will be added as minor version bumps, and non-breaking changes won't be accounted for since the library is moving quickly.
|
||||
|
||||
|
||||
---
|
||||
|
||||
### `0.23.0` — September 10, 2017
|
||||
|
||||
###### BREAKING
|
||||
|
||||
- **The `isNative` property of `State` has been removed.** Previously this was used for performance reasons to avoid re-rendering, but it is no longer needed. This shouldn't really affect most people because it's rare that you'd be relying on this property to exist.
|
||||
|
||||
###### DEPRECATED
|
||||
|
||||
- **The `Raw` serializer is now deprecated.** Instead, use the `fromJSON` and `toJSON` models directly.
|
||||
|
||||
- **The `toRaw` options for the `Plain` and `Html` serializers are now called `toJSON`.** To stay symmetrical with the removal of the "raw" concept everywhere.
|
||||
|
||||
- **The `terse` option for JSON serialization has been deprecated!** This option causes lots of abstraction leakiness because it means there is no one canonical JSON representation of objects. You had to work with either terse or not terse data.
|
||||
|
||||
- **The `Html` serializer no longer uses the `terse` representation.** This shouldn't actually be an issue for anyone because the main manifestation of this has a deprecation notice with a patch in place for now.
|
||||
|
||||
- **The `defaultBlockType` of the `Html` serializer is now called `defaultBlock`.** This is just to make it more clear that it supports not only setting the default `type` but also `data` and `isVoid`.
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
### `0.22.0` — September 5, 2017
|
||||
|
||||
###### BREAKING CHANGES
|
||||
###### BREAKING
|
||||
|
||||
- **The `Plain` serializer now adds line breaks between blocks.** Previously between blocks the text would be joined without any space whatsoever, but this wasn't really that useful or what you'd expect.
|
||||
|
||||
@@ -53,7 +74,7 @@ function onKeyDown(e, data, change) {
|
||||
|
||||
- **All references to "joining" nodes is now called "merging".** This is to be slightly clearer, since merging can only happen with adjacent nodes already, and to have a nicer parallel with "splitting", as in cells. The operation is now called `merge_node`, and the transforms are now `merge*`.
|
||||
|
||||
###### DEPRECATION CHANGES
|
||||
###### DEPRECATED
|
||||
|
||||
- **The `transform.apply()` method is deprecated.** Previously this is where the saving into the history would happen, but it created an awkward convention that wasn't necessary. Now operations are saved into the history as they are created with change methods, instead of waiting until the end. You can access the new `State` of a change at any time via `change.state`.
|
||||
|
||||
@@ -63,7 +84,7 @@ function onKeyDown(e, data, change) {
|
||||
|
||||
### `0.21.0` — July 20, 2017
|
||||
|
||||
###### BREAKING CHANGES
|
||||
###### BREAKING
|
||||
|
||||
- **The `Html` serializer now uses `DOMParser` instead of `cheerio`.** Previously, the `Html` serializer used the `cheerio` library for representing elements in the serialization rule logic, but cheerio was a very large dependency. It has been removed, and the native browser `DOMParser` is now used instead. All HTML serialization rules will need to be updated. If you are working with Slate on the server, you can now pass in a custom serializer to the `Html` constructor, using the `parse5` library.
|
||||
|
||||
@@ -73,7 +94,7 @@ function onKeyDown(e, data, change) {
|
||||
|
||||
### `0.20.0` — May 17, 2017
|
||||
|
||||
###### BREAKING CHANGES
|
||||
###### BREAKING
|
||||
|
||||
- **Returning `null` from the `Html` serializer skips the element.** Previously, `null` and `undefined` had the same behavior of skipping the rule and trying the rest of the rules. Now if you explicitly return `null` it will skip the element itself.
|
||||
|
||||
@@ -83,11 +104,11 @@ function onKeyDown(e, data, change) {
|
||||
|
||||
### `0.19.0` — March 3, 2017
|
||||
|
||||
###### BREAKING CHANGES
|
||||
###### BREAKING
|
||||
|
||||
- **The `filterDescendants` and `findDescendants` methods are now depth-first.** This shouldn't affect almost anyone, since they are usually not the best things to be using for performance reasons. If you happen to have a very specific use case that needs breadth-first, (or even likely something better), you'll need to implement it yourself.
|
||||
|
||||
###### DEPRECATION CHANGES
|
||||
###### DEPRECATED
|
||||
|
||||
- **Some `Node` methods have been deprecated!** There were a few methods that had been added over time that were either poorly named that have been deprecated and renamed, and a handful of methods that are no longer useful for the core library that have been deprecated. Here's a full list:
|
||||
- `areDescendantSorted` -> `areDescendantsSorted`
|
||||
@@ -107,7 +128,7 @@ function onKeyDown(e, data, change) {
|
||||
|
||||
### `0.18.0` — March 2, 2017
|
||||
|
||||
###### BREAKING CHANGES
|
||||
###### BREAKING
|
||||
|
||||
- **The `plugin.render` property is now called `plugin.renderPortal`.** This is to make way for the new `plugin.render` property that offers HOC-like behavior, so that plugins can augment the editor however they choose.
|
||||
|
||||
@@ -117,7 +138,7 @@ function onKeyDown(e, data, change) {
|
||||
|
||||
### `0.17.0` — February 27, 2017
|
||||
|
||||
###### DEPRECATION CHANGES
|
||||
###### DEPRECATED
|
||||
|
||||
- **Some `Selection` methods have been deprecated!** Previously there were many inconsistencies in the naming and handling of selection changes. This has all been cleaned up, but in the process some methods have been deprecated. Here is a full list of the deprecated methods and their new alternatives:
|
||||
- `moveToOffsets` -> `moveOffsetsTo`
|
||||
@@ -150,7 +171,7 @@ function onKeyDown(e, data, change) {
|
||||
|
||||
### `0.16.0` — December 2, 2016
|
||||
|
||||
###### BREAKING CHANGES
|
||||
###### BREAKING
|
||||
|
||||
- **Inline nodes are now always surrounded by text nodes.** Previously this behavior only occured for inline nodes with `isVoid: true`. Now, all inline nodes will always be surrounded by text nodes. If text nodes don't exist, empty ones will be created. This allows for more consistent behavior across Slate, and parity with other editing experiences.
|
||||
|
||||
@@ -160,7 +181,7 @@ function onKeyDown(e, data, change) {
|
||||
|
||||
### `0.15.0` - November 17, 2016
|
||||
|
||||
###### BREAKING CHANGES
|
||||
###### BREAKING
|
||||
|
||||
- **The unique `key` generated values have changed.** Previously, Slate generated unique keys that looked like `'9dk3'`. But they were not very conflict-resistant. Now the keys are simple string of auto-incrementing numbers, like `'0'`, `'1'`, `'2'`. This makes more clear that keys are simply a convenient way to uniquely reference nodes in the **short-term** lifespan of a single in-memory instance of Slate. They are not designed to be used for long-term uniqueness. A new `setKeyGenerator` function has been exported that allows you to pass in your own key generating mechanism if you want to ensure uniqueness.
|
||||
|
||||
@@ -168,7 +189,7 @@ function onKeyDown(e, data, change) {
|
||||
|
||||
- **Operations on the document now update the selection when needed.** This won't affect you unless you were doing some very specific things with transforms and updating selections. Overall, this makes it much easier to write transforms, since in most cases, the underlying operations will update the selection as you would expect without you doing anything.
|
||||
|
||||
###### DEPRECATION CHANGES
|
||||
###### DEPRECATED
|
||||
|
||||
- **Node accessor methods no longer accept being passed another node!** Previously, node accessor methods like `node.getParent` could be passed either a `key` string or a `node` object. For performance reasons, passing in a `node` object is being deprecated. So if you have any calls that look like: `node.getParent(descendant)`, they will now need to be written as `node.getParent(descendant.key)`. They will throw a warning for now, and will throw an error in a later version of Slate.
|
||||
|
||||
@@ -178,7 +199,7 @@ function onKeyDown(e, data, change) {
|
||||
|
||||
### `0.14.0` — September 10, 2016
|
||||
|
||||
###### BREAKING CHANGES
|
||||
###### BREAKING
|
||||
|
||||
- **The `undo` and `redo` transforms need to be applied!** Previously, `undo` and `redo` were special cased such that they did not require an `.apply()` call, and instead would return a new `State` directly. Now this is no longer the case, and they are just like every other transform.
|
||||
|
||||
@@ -194,7 +215,7 @@ function onKeyDown(e, data, change) {
|
||||
|
||||
### `0.13.0` — August 15, 2016
|
||||
|
||||
###### BREAKING CHANGES
|
||||
###### BREAKING
|
||||
|
||||
- **The `renderNode` and `renderMark` properties are gone!** Previously, rendering nodes and marks happened via these two properties of the `<Editor>`, but this has been replaced by the new `schema` property. Check out the updated examples to see how to define a schema! There's a good chance this eliminates extra code for most use cases! :smile:
|
||||
|
||||
@@ -206,7 +227,7 @@ function onKeyDown(e, data, change) {
|
||||
|
||||
### `0.12.0` — August 9, 2016
|
||||
|
||||
###### BREAKING CHANGES
|
||||
###### BREAKING
|
||||
|
||||
- **The `data.files` property is now an `Array`.** Previously it was a native `FileList` object, but needed to be changed to add full support for pasting an dropping files in all browsers. This shouldn't affect you unless you were specifically depending on it being array-like instead of a true `Array`.
|
||||
|
||||
@@ -216,7 +237,7 @@ function onKeyDown(e, data, change) {
|
||||
|
||||
### `0.11.0` — August 4, 2016
|
||||
|
||||
###### BREAKING CHANGES
|
||||
###### BREAKING
|
||||
|
||||
- **Void nodes are renderered implicitly again!** Previously Slate had required that you wrap void node renderers yourself with the exposed `<Void>` wrapping component. This was to allow for selection styling, but a change was made to make selection styling able to handled in Javascript. Now the `<Void>` wrapper will be implicitly rendered by Slate, so you do not need to worry about it, and "voidness" only needs to toggled in one place, the `isVoid: true` property of a node.
|
||||
|
||||
@@ -226,7 +247,7 @@ function onKeyDown(e, data, change) {
|
||||
|
||||
### `0.10.0` — July 29, 2016
|
||||
|
||||
###### BREAKING CHANGES
|
||||
###### BREAKING
|
||||
|
||||
- **Marks are now renderable as components.** Previously the only supported way to render marks was by returning a `style` object. Now you can return a style object, a class name string, or a full React component. Because of this, the DOM will be renderered slightly differently than before, resulting in an extra `<span>` when rendering non-component marks. This won't affect you unless you were depending on the DOM output by Slate for some reason.
|
||||
|
||||
@@ -236,7 +257,7 @@ function onKeyDown(e, data, change) {
|
||||
|
||||
### `0.9.0` — July 28, 2016
|
||||
|
||||
###### BREAKING CHANGES
|
||||
###### BREAKING
|
||||
|
||||
- **The `wrap` and `unwrap` method signatures have changed!** Previously, you would pass `type` and `data` as separate parameters, for example: `wrapBlock('code', { src: true })`. This was inconsistent with other transforms, and has been updated such that a single argument of `properties` is passed instead. So that example could now be: `wrapBlock({ type: 'code', { data: { src: true }})`. You can still pass a `type` string as shorthand, which will be the most frequent use case, for example: `wrapBlock('code')`.
|
||||
|
||||
@@ -246,7 +267,7 @@ function onKeyDown(e, data, change) {
|
||||
|
||||
### `0.8.0` — July 27, 2016
|
||||
|
||||
###### BREAKING CHANGES
|
||||
###### BREAKING
|
||||
|
||||
- **The `onKeyDown` and `onBeforeInput` handlers signatures have changed!** Previously, some Slate handlers had a signature of `(e, state, editor)` and others had a signature of `(e, data, state, editor)`. Now all handlers will be passed a `data` object—which contains Slate-specific data related to the event—even if it is empty. This is helpful for future compatibility where we might need to add data to a handler that previously didn't have any, and is nicer for consistency. The `onKeyDown` handler's new `data` object contains the `key` name, `code` and a series of `is*` properties to make working with hotkeys easier. The `onBeforeInput` handler's new `data` object is empty.
|
||||
|
||||
@@ -262,7 +283,7 @@ function onKeyDown(e, data, change) {
|
||||
|
||||
### `0.7.0` — July 24, 2016
|
||||
|
||||
###### BREAKING CHANGES
|
||||
###### BREAKING
|
||||
|
||||
- **The `Raw` serializer is no longer terse by default!** Previously, the `Raw` serializer would return a "terse" representation of the document, omitting information that wasn't _strictly_ necessary to deserialize later, like the `key` of nodes. By default this no longer happens. You have to opt-in to the behavior by passing `{ terse: true }` as the second `options` argument of the `deserialize` and `serialize` methods.
|
||||
|
||||
@@ -272,7 +293,7 @@ function onKeyDown(e, data, change) {
|
||||
|
||||
### `0.6.0` — July 22, 2016
|
||||
|
||||
###### BREAKING CHANGES
|
||||
###### BREAKING
|
||||
|
||||
- **Void components are no longer rendered implicity!** Previously, Slate would automatically wrap any node with `isVoid: true` in a `<Void>` component. But doing this prevented you from customizing the wrapper, like adding a `className` or `style` property. So you **must now render the wrapper yourself**, and it has been exported as `Slate.Void`. This, combined with a small change to the `<Void>` component's structure allows the "selected" state of void nodes to be rendered purely with CSS based on the `:focus` property of a `<Void>` element, which previously [had to be handled in Javascript](https://github.com/ianstormtaylor/slate/commit/31782cb11a272466b6b9f1e4d6cc0c698504d97f). This allows us to streamline selection-handling logic, improving performance and reducing complexity.
|
||||
|
||||
@@ -284,7 +305,7 @@ function onKeyDown(e, data, change) {
|
||||
|
||||
### `0.5.0` — July 20, 2016
|
||||
|
||||
###### BREAKING CHANGES
|
||||
###### BREAKING
|
||||
|
||||
- **`node.getTextNodes()` is now `node.getTexts()`.** This is just for consistency with the other existing `Node` methods like `getBlocks()`, `getInlines()`, etc. And it's nicely shorter. :wink:
|
||||
|
||||
@@ -296,7 +317,7 @@ function onKeyDown(e, data, change) {
|
||||
|
||||
### `0.4.0` — July 20, 2016
|
||||
|
||||
###### BREAKING CHANGES
|
||||
###### BREAKING
|
||||
|
||||
- **`renderMark(mark, state, editor)` is now `renderMark(mark, marks, state, editor)`.** This change allows you to render marks based on multiple `marks` presence at once on a given range of text, for example using a custom `BoldItalic.otf` font when text has both `bold` and `italic` marks.
|
||||
|
||||
@@ -306,7 +327,7 @@ function onKeyDown(e, data, change) {
|
||||
|
||||
### `0.3.0` — July 20, 2016
|
||||
|
||||
###### BREAKING CHANGES
|
||||
###### BREAKING
|
||||
|
||||
- **`transform.unwrapBlock()` now unwraps selectively.** Previously, calling `unwrapBlock` with a range representing a middle sibling would unwrap _all_ of the siblings, removing the wrapping block entirely. Now, calling it with those same arguments will only move the middle sibling up a layer in the hierarchy, preserving the nesting on any of its siblings. This changes makes it much simpler to implement functionality like unwrapping a single list item, which previously would unwrap the entire list.
|
||||
|
||||
@@ -316,7 +337,7 @@ function onKeyDown(e, data, change) {
|
||||
|
||||
### `0.2.0` — July 18, 2016
|
||||
|
||||
###### BREAKING CHANGES
|
||||
###### BREAKING
|
||||
|
||||
- **`transform.mark()` is now `transform.addMark()` and `transform.unmark()` is now `transform.removeMark()`.** The new names make it clearer that the transforms are actions being performed, and it paves the way for adding a `toggleMark` convenience as well.
|
||||
|
||||
|
Reference in New Issue
Block a user