Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
zbeyens committed Sep 11, 2024
1 parent 6e42b38 commit c08d091
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions BREAKING_CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,51 @@
For older changelogs, see https://github.com/udecode/plate/blob/main/docs

# 38.0.0

## @udecode/plate-core@38.0.0

### Major Changes

- [#3506](https://github.com/udecode/plate/pull/3506) by [@zbeyens](https://github.com/zbeyens)

- Change `plugin.options` merging behavior from deep merge to shallow merge.
- This affects `.extend()`, `.configure()`, and other methods that modify plugin options.
- This update addresses a **performance regression** introduced in v37 that affected editor creation.

Before:

```ts
const plugin = createSlatePlugin({
key: 'test',
options: { nested: { a: 1 } },
}).extend({
options: { nested: { b: 1 } },
});

// Result: { nested: { a: 1, b: 1 } }
```

After:

```ts
const plugin = createSlatePlugin({
key: 'test',
options: { nested: { a: 1 } },
}).extend(({ getOptions }) => ({
options: {
...getOptions(),
nested: { ...getOptions().nested, b: 1 },
},
}));

// Result: { nested: { a: 1, b: 1 } }
```

Migration:

- If you're using nested options and want to preserve the previous behavior, you need to manually spread both the top-level options and the nested objects.
- If you're not using nested options, no changes are required.

# 37.0.0

Migration example: https://github.com/udecode/plate/pull/3480
Expand Down

0 comments on commit c08d091

Please sign in to comment.