From ac23c3aaae3ca112ef968532ae54a061677550a2 Mon Sep 17 00:00:00 2001 From: Fadekemi Adebayo Date: Fri, 22 Nov 2024 11:36:18 +0000 Subject: [PATCH 1/3] change default skipInitialization --- packages/lexical-website/docs/concepts/listeners.md | 2 +- packages/lexical/src/LexicalEditor.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/lexical-website/docs/concepts/listeners.md b/packages/lexical-website/docs/concepts/listeners.md index 834db37c0bf..076f3826a57 100644 --- a/packages/lexical-website/docs/concepts/listeners.md +++ b/packages/lexical-website/docs/concepts/listeners.md @@ -84,7 +84,7 @@ handle external UI state and UI features relating to specific types of node. If any existing nodes are in the DOM, and skipInitialization is not true, the listener will be called immediately with an updateTag of 'registerMutationListener' where all nodes have the 'created' NodeMutation. This can be controlled with the skipInitialization option -(default is currently true for backwards compatibility in 0.17.x but will change to false in 0.18.0). +(The default was previously true for backwards compatibility with <= 0.16.1 but has been changed to false as of 0.21.0). ```js const removeMutationListener = editor.registerMutationListener( diff --git a/packages/lexical/src/LexicalEditor.ts b/packages/lexical/src/LexicalEditor.ts index 174b18cb62c..5a740018af0 100644 --- a/packages/lexical/src/LexicalEditor.ts +++ b/packages/lexical/src/LexicalEditor.ts @@ -216,13 +216,13 @@ export interface MutationListenerOptions { /** * Skip the initial call of the listener with pre-existing DOM nodes. * - * The default is currently true for backwards compatibility with <= 0.16.1 - * but this default is expected to change to false in 0.17.0. + * The default was previously true for backwards compatibility with <= 0.16.1 + * but this default has been changed to false as of 0.21.0. */ skipInitialization?: boolean; } -const DEFAULT_SKIP_INITIALIZATION = true; +const DEFAULT_SKIP_INITIALIZATION = false; export type UpdateListener = (arg0: { dirtyElements: Map; @@ -844,7 +844,7 @@ export class LexicalEditor { * If any existing nodes are in the DOM, and skipInitialization is not true, the listener * will be called immediately with an updateTag of 'registerMutationListener' where all * nodes have the 'created' NodeMutation. This can be controlled with the skipInitialization option - * (default is currently true for backwards compatibility in 0.16.x but will change to false in 0.17.0). + * (The default was previously true for backwards compatibility with <= 0.16.1 but has been changed to false as of 0.21.0). * * @param klass - The class of the node that you want to listen to mutations on. * @param listener - The logic you want to run when the node is mutated. From 3b15093d254f8b7ee6d05e6477427c8c5c723022 Mon Sep 17 00:00:00 2001 From: Fadekemi Adebayo Date: Fri, 22 Nov 2024 13:43:49 +0000 Subject: [PATCH 2/3] fix unexpected character error for = --- packages/lexical-website/docs/concepts/listeners.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lexical-website/docs/concepts/listeners.md b/packages/lexical-website/docs/concepts/listeners.md index 076f3826a57..ef95f1c6d0b 100644 --- a/packages/lexical-website/docs/concepts/listeners.md +++ b/packages/lexical-website/docs/concepts/listeners.md @@ -84,7 +84,7 @@ handle external UI state and UI features relating to specific types of node. If any existing nodes are in the DOM, and skipInitialization is not true, the listener will be called immediately with an updateTag of 'registerMutationListener' where all nodes have the 'created' NodeMutation. This can be controlled with the skipInitialization option -(The default was previously true for backwards compatibility with <= 0.16.1 but has been changed to false as of 0.21.0). +(whose default was previously true for backwards compatibility with <=0.16.1 but has been changed to false as of 0.21.0). ```js const removeMutationListener = editor.registerMutationListener( From 60be703b9692ae7ab7ff0724f21241f367ba9813 Mon Sep 17 00:00:00 2001 From: Fadekemi Adebayo Date: Fri, 22 Nov 2024 13:56:38 +0000 Subject: [PATCH 3/3] fix error for starting name with = --- packages/lexical/src/LexicalEditor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lexical/src/LexicalEditor.ts b/packages/lexical/src/LexicalEditor.ts index 5a740018af0..9223e571544 100644 --- a/packages/lexical/src/LexicalEditor.ts +++ b/packages/lexical/src/LexicalEditor.ts @@ -844,7 +844,7 @@ export class LexicalEditor { * If any existing nodes are in the DOM, and skipInitialization is not true, the listener * will be called immediately with an updateTag of 'registerMutationListener' where all * nodes have the 'created' NodeMutation. This can be controlled with the skipInitialization option - * (The default was previously true for backwards compatibility with <= 0.16.1 but has been changed to false as of 0.21.0). + * (whose default was previously true for backwards compatibility with <=0.16.1 but has been changed to false as of 0.21.0). * * @param klass - The class of the node that you want to listen to mutations on. * @param listener - The logic you want to run when the node is mutated.