v38.0.1
zbeyens
released this
13 Sep 11:00
·
630 commits
to main
since this release
These should be the last major changes from v37 rework. We recommend migrating directly to this version from v36
@udecode/[email protected]
Major Changes
-
- 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:
const plugin = createSlatePlugin({ key: 'test', options: { nested: { a: 1 } }, }).extend({ options: { nested: { b: 1 } }, }); // Result: { nested: { a: 1, b: 1 } }
After:
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.
- Change
-
Rename all base plugins that have a React plugin counterpart to be prefixed with
Base
. This change improves clarity and distinguishes base implementations from potential React extensions. Use base plugins only for server-side environments or to extend your own DOM layer. -
Import the following plugins from
/react
entry:AlignPlugin
,CalloutPlugin
,EquationPlugin
,FontBackgroundColorPlugin
,FontColorPlugin
,FontFamilyPlugin
,FontSizePlugin
,FontWeightPlugin
,InlineEquationPlugin
,LineHeightPlugin
,TextIndentPlugin
,TocPlugin