1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-20 06:01:24 +02:00

update changelogs

This commit is contained in:
Ian Storm Taylor
2019-05-01 19:49:51 -07:00
parent a220cd5ae1
commit 4af9a8b345
7 changed files with 94 additions and 3 deletions

View File

@@ -4,6 +4,14 @@ This document maintains a list of changes to the `slate-html-serializer` package
---
### `0.8.0` — May 1, 2019
###### BREAKING
**Updated to work with `slate@0.46`.** The HTML serializer has been updated to work alongside the new text data model in the latest version of slate. For serializing it requires you pass in the new format for text nodes. And for deserializing it will return the new format.
---
### `0.7.0` — August 22, 2018
###### BREAKING

View File

@@ -19,7 +19,7 @@
"immutable": ">=3.8.1 || >4.0.0-rc",
"react": ">=0.14.0",
"react-dom": ">=0.14.0",
"slate": ">=0.32.0"
"slate": ">=0.36.0"
},
"devDependencies": {
"mocha": "^2.5.3",

View File

@@ -2,6 +2,35 @@
This document maintains a list of changes to the `slate-hyperscript` package with each new version. Until `1.0.0` is released, breaking changes will be added as minor version bumps, and smaller changes won't be accounted for since the library is moving quickly.
---
### `0.12.0` — May 1, 2019
###### BREAKING
**Updated to work with `slate@0.46`.** The hyperscript creators have been updated to work alongside the new text data model in the latest version of slate.
**The `<text>` and `<mark>` hyperscript tags must now return a single text node.** Previously they were more lenient, and might return an array of text nodes. This made it hard to be explicit in tests, and made certain configurations impossible. This new restriction makes it easier to reason about what the tags return, even if it makes certain cases slightly more verbose. For example:
```jsx
<paragraph>
<b>a few <i>italic</i> and bold words.</b>
</paragraph>
```
Must now be written as:
```jsx
<paragraph>
<b>a few </b>
<b><i>italic</i></b>
<b> and bold words.</b>
</paragraph>
```
Slightly more verbose, but with the benefit of being easy to tell exactly how many text nodes you will receive in your resulting document. And it allows setting `key=` values on the mark tags directly, since they map `1:1` to text nodes.
---
### `0.11.0` — October 9, 2018

View File

@@ -16,7 +16,7 @@
"is-plain-object": "^2.0.4"
},
"peerDependencies": {
"slate": ">=0.42.0"
"slate": ">=0.46.0"
},
"devDependencies": {
"mocha": "^2.5.3",

View File

@@ -4,6 +4,14 @@ This document maintains a list of changes to the `slate-plain-serializer` packag
---
### `0.7.0` — May 1, 2019
###### BREAKING
**Updated to work with `slate@0.46`.** The plain serializer has been updated to work alongside the new text data model in the latest version of slate. For serializing it requires you pass in the new format for text nodes. And for deserializing it will return the new format.
---
### `0.6.0` — August 22, 2018
###### BREAKING

View File

@@ -14,7 +14,7 @@
],
"peerDependencies": {
"immutable": ">=3.8.1",
"slate": ">=0.32.0"
"slate": ">=0.46.0"
},
"devDependencies": {
"mocha": "^2.5.3",

View File

@@ -4,6 +4,52 @@ A list of changes to the `slate` package with each new version. Until `1.0.0` is
---
### `0.46.0` — May 1, 2019
###### BREAKING
**Mark operations no longer have `offset` or `length` properties.** Since text nodes now contain a unique set of marks, it wouldn't make sense for a single mark-related operation to result in a splitting of nodes. Instead, when a mark is added to only part of a text node, it will result in a `split_node` operation as well as an `add_mark` operation.
**Text operations no longer have a `marks` property.** Previously it was used to add text with a specific set of marks. However this is no longer necessary, and when text is added with marks it will result in an `insert_text` operation as well as an `add_mark` operation.
**Using `Text.create` or `Text.createList` with a `leaves` property will error.** Now that text nodes no longer have leaves, you will need to pass in the `text` string and `marks` directly when creating a new text node. (However, you can still create entire values using `Value.create` in a backwards compatible way for convenience while migrating.)
```js
// This works, although deprecated, which is the common case...
Value.create(oldValueJson)
// ...but this will error!
Text.create(oldTextJson)
```
**`Value.toJSON` returns the new data model format, without leaves.** Although `Value.fromJSON` and `Value.create` allow the old format in deprecated mode, calling `Value.toJSON` will return the new data format. If you still need the old one you'll need to iterate the document tree converting text nodes yourself.
**The low-level `Value.*` and `Node.*` mutation methods have changed.** These changes follow the operation signature changes, since the methods take the same arguments as the operations themselves. For example:
```js
// Previously...
value.addMark(path, offset, length, mark)
// ...is now:
value.addMark(path, mark)
```
These are low-level methods, so this change shouldn't affect the majority of use cases.
###### DEPRECATED
**Initializing editors with `Text` nodes with a `leaves` property is deprecated.** In this new version of Slate, creating a new value with `Value.create` with the old leaf data model is still allowed for convenience in migration, but it will be removed in a coming version. (However, using the low-level `Text.create` will throw an error!)
```js
// This works, although deprecated, which is the common case...
Value.create(oldValueJson)
// ...but this will error!
Text.create(oldTextJson)
```
---
### `0.45.0` — April 2, 2019
###### BREAKING