diff --git a/.changeset/chatty-flies-pay.md b/.changeset/chatty-flies-pay.md deleted file mode 100644 index 8651323a3..000000000 --- a/.changeset/chatty-flies-pay.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'slate-dom': minor ---- - -- Add `splitDecorationsByChild` to split an array of decorated ranges by child index. diff --git a/.changeset/silly-crabs-sort.md b/.changeset/silly-crabs-sort.md deleted file mode 100644 index 5716d7e20..000000000 --- a/.changeset/silly-crabs-sort.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'slate': patch ---- - -- PERF: Use pure JS instead of Immer for applying operations and transforming points and ranges. Immer is now used only for producing fragments. diff --git a/.changeset/tiny-scissors-yell.md b/.changeset/tiny-scissors-yell.md deleted file mode 100644 index 4fb814622..000000000 --- a/.changeset/tiny-scissors-yell.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -'slate-react': minor ---- - -- Implement experimental chunking optimization (disabled by default, see https://docs.slatejs.org/walkthroughs/09-performance). -- Add `useElement` and `useElementIf` hooks to get the current element. -- **BREAKING CHANGE:** Decorations are no longer recomputed when a node's parent re-renders, only when the node itself re-renders or when the `decorate` function is changed. - - Ensure that `decorate` is a pure function of the node passed into it. Depending on the node's parent may result in decorations not being recomputed when you expect them to be. - - If this change impacts you, consider changing your `decorate` function to work on the node's parent instead. - - For example, if your `decorate` function decorates a `code-line` based on the parent `code-block`'s language, decorate the `code-block` instead. - - This is unlikely to result in any performance detriment, since in previous versions of `slate-react`, the decorations of all siblings were recomputed when one sibling was modified. -- Increase minimum `slate-dom` version to `0.116.0`. -- Deprecate the `useSlateWithV` hook -- PERF: Use subscribable pattern for `useSlate`, `useSelected` and decorations to reduce re-renders. diff --git a/packages/slate-dom/CHANGELOG.md b/packages/slate-dom/CHANGELOG.md index 129e535d0..ebfe0ec52 100644 --- a/packages/slate-dom/CHANGELOG.md +++ b/packages/slate-dom/CHANGELOG.md @@ -1,5 +1,11 @@ # slate-dom +## 0.116.0 + +### Minor Changes + +- [#5871](https://github.com/ianstormtaylor/slate/pull/5871) [`fb87646e`](https://github.com/ianstormtaylor/slate/commit/fb87646e8643e1d0547134cea9d1f57912f06a92) Thanks [@12joan](https://github.com/12joan)! - - Add `splitDecorationsByChild` to split an array of decorated ranges by child index. + ## 0.114.0 ### Patch Changes diff --git a/packages/slate-dom/package.json b/packages/slate-dom/package.json index eff791066..c97c9c816 100644 --- a/packages/slate-dom/package.json +++ b/packages/slate-dom/package.json @@ -1,7 +1,7 @@ { "name": "slate-dom", "description": "Tools for building completely customizable richtext editors with React.", - "version": "0.114.0", + "version": "0.116.0", "license": "MIT", "repository": "git://github.com/ianstormtaylor/slate.git", "main": "dist/index.js", @@ -29,7 +29,7 @@ "@types/jsdom": "^21.1.4", "@types/lodash": "^4.14.200", "@types/resize-observer-browser": "^0.1.8", - "slate": "^0.115.0", + "slate": "^0.116.0", "slate-hyperscript": "^0.115.0", "source-map-loader": "^4.0.1" }, diff --git a/packages/slate-history/package.json b/packages/slate-history/package.json index bf17cac9c..4f6959bd8 100644 --- a/packages/slate-history/package.json +++ b/packages/slate-history/package.json @@ -16,7 +16,7 @@ "devDependencies": { "@babel/runtime": "^7.23.2", "lodash": "^4.17.21", - "slate": "^0.115.0", + "slate": "^0.116.0", "slate-hyperscript": "^0.115.0", "source-map-loader": "^4.0.1" }, diff --git a/packages/slate-hyperscript/package.json b/packages/slate-hyperscript/package.json index 4ab3fd0df..4137030a0 100644 --- a/packages/slate-hyperscript/package.json +++ b/packages/slate-hyperscript/package.json @@ -15,7 +15,7 @@ ], "devDependencies": { "@babel/runtime": "^7.23.2", - "slate": "^0.115.0", + "slate": "^0.116.0", "source-map-loader": "^4.0.1" }, "peerDependencies": { diff --git a/packages/slate-react/CHANGELOG.md b/packages/slate-react/CHANGELOG.md index 988f8012d..d6fb97219 100644 --- a/packages/slate-react/CHANGELOG.md +++ b/packages/slate-react/CHANGELOG.md @@ -1,5 +1,20 @@ # slate-react +## 0.116.0 + +### Minor Changes + +- [#5871](https://github.com/ianstormtaylor/slate/pull/5871) [`fb87646e`](https://github.com/ianstormtaylor/slate/commit/fb87646e8643e1d0547134cea9d1f57912f06a92) Thanks [@12joan](https://github.com/12joan)! - - Implement experimental chunking optimization (disabled by default, see https://docs.slatejs.org/walkthroughs/09-performance). + - Add `useElement` and `useElementIf` hooks to get the current element. + - **BREAKING CHANGE:** Decorations are no longer recomputed when a node's parent re-renders, only when the node itself re-renders or when the `decorate` function is changed. + - Ensure that `decorate` is a pure function of the node passed into it. Depending on the node's parent may result in decorations not being recomputed when you expect them to be. + - If this change impacts you, consider changing your `decorate` function to work on the node's parent instead. + - For example, if your `decorate` function decorates a `code-line` based on the parent `code-block`'s language, decorate the `code-block` instead. + - This is unlikely to result in any performance detriment, since in previous versions of `slate-react`, the decorations of all siblings were recomputed when one sibling was modified. + - Increase minimum `slate-dom` version to `0.116.0`. + - Deprecate the `useSlateWithV` hook + - PERF: Use subscribable pattern for `useSlate`, `useSelected` and decorations to reduce re-renders. + ## 0.115.0 ### Patch Changes diff --git a/packages/slate-react/package.json b/packages/slate-react/package.json index 2323760de..a88495726 100644 --- a/packages/slate-react/package.json +++ b/packages/slate-react/package.json @@ -1,7 +1,7 @@ { "name": "slate-react", "description": "Tools for building completely customizable richtext editors with React.", - "version": "0.115.0", + "version": "0.116.0", "license": "MIT", "repository": "git://github.com/ianstormtaylor/slate.git", "main": "dist/index.js", @@ -34,8 +34,8 @@ "@types/resize-observer-browser": "^0.1.8", "react": "^18.2.0", "react-dom": "^18.2.0", - "slate": "^0.115.0", - "slate-dom": "^0.114.0", + "slate": "^0.116.0", + "slate-dom": "^0.116.0", "slate-hyperscript": "^0.115.0", "source-map-loader": "^4.0.1" }, diff --git a/packages/slate/CHANGELOG.md b/packages/slate/CHANGELOG.md index 65c4451e3..88bf7e52e 100644 --- a/packages/slate/CHANGELOG.md +++ b/packages/slate/CHANGELOG.md @@ -1,5 +1,11 @@ # slate +## 0.116.0 + +### Patch Changes + +- [#5871](https://github.com/ianstormtaylor/slate/pull/5871) [`fb87646e`](https://github.com/ianstormtaylor/slate/commit/fb87646e8643e1d0547134cea9d1f57912f06a92) Thanks [@12joan](https://github.com/12joan)! - - PERF: Use pure JS instead of Immer for applying operations and transforming points and ranges. Immer is now used only for producing fragments. + ## 0.115.1 ### Patch Changes diff --git a/packages/slate/package.json b/packages/slate/package.json index e42b9a8d7..aad6ad8e1 100644 --- a/packages/slate/package.json +++ b/packages/slate/package.json @@ -1,7 +1,7 @@ { "name": "slate", "description": "A completely customizable framework for building rich text editors.", - "version": "0.115.1", + "version": "0.116.0", "license": "MIT", "repository": "git://github.com/ianstormtaylor/slate.git", "main": "dist/index.js", diff --git a/yarn.lock b/yarn.lock index b493d8274..2a6e3afa3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13325,7 +13325,7 @@ __metadata: languageName: node linkType: hard -"slate-dom@npm:^0.114.0, slate-dom@workspace:*, slate-dom@workspace:packages/slate-dom": +"slate-dom@npm:^0.116.0, slate-dom@workspace:*, slate-dom@workspace:packages/slate-dom": version: 0.0.0-use.local resolution: "slate-dom@workspace:packages/slate-dom" dependencies: @@ -13341,7 +13341,7 @@ __metadata: is-plain-object: "npm:^5.0.0" lodash: "npm:^4.17.21" scroll-into-view-if-needed: "npm:^3.1.0" - slate: "npm:^0.115.0" + slate: "npm:^0.116.0" slate-hyperscript: "npm:^0.115.0" source-map-loader: "npm:^4.0.1" tiny-invariant: "npm:1.3.1" @@ -13356,7 +13356,7 @@ __metadata: dependencies: "@babel/runtime": "npm:^7.23.2" lodash: "npm:^4.17.21" - slate: "npm:^0.115.0" + slate: "npm:^0.116.0" slate-hyperscript: "npm:^0.115.0" source-map-loader: "npm:^4.0.1" peerDependencies: @@ -13369,7 +13369,7 @@ __metadata: resolution: "slate-hyperscript@workspace:packages/slate-hyperscript" dependencies: "@babel/runtime": "npm:^7.23.2" - slate: "npm:^0.115.0" + slate: "npm:^0.116.0" source-map-loader: "npm:^4.0.1" peerDependencies: slate: ">=0.114.3" @@ -13483,8 +13483,8 @@ __metadata: react: "npm:^18.2.0" react-dom: "npm:^18.2.0" scroll-into-view-if-needed: "npm:^3.1.0" - slate: "npm:^0.115.0" - slate-dom: "npm:^0.114.0" + slate: "npm:^0.116.0" + slate-dom: "npm:^0.116.0" slate-hyperscript: "npm:^0.115.0" source-map-loader: "npm:^4.0.1" tiny-invariant: "npm:1.3.1" @@ -13496,7 +13496,7 @@ __metadata: languageName: unknown linkType: soft -"slate@npm:^0.115.0, slate@workspace:*, slate@workspace:packages/slate": +"slate@npm:^0.116.0, slate@workspace:*, slate@workspace:packages/slate": version: 0.0.0-use.local resolution: "slate@workspace:packages/slate" dependencies: