github udecode/plate @udecode/plate-core@38.0.0

latest releases: @udecode/plate-selection@39.3.7, @udecode/plate@39.3.7, @udecode/plate-ai@39.3.7...
2 months ago

Major Changes

  • #3506 by @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:

    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.

Don't miss a new plate release

NewReleases is sending notifications on new releases.