Repository navigation
Conversation
commit a62a1a6 Author: James Fitzsimmons <[email protected]> Date: Thu Jan 30 19:13:35 2025 +1100 [lexical-mark] Feature: include inline decorator nodes in marks (meta#7086) commit 881c7fe Author: Bob Ippolito <[email protected]> Date: Thu Jan 30 00:13:00 2025 -0800 [lexical-utils] Fix: Modify $reverseDfs to be a right-to-left variant of $dfs (meta#7112) commit ce2bb45 Author: Nigel Gutzmann <[email protected]> Date: Wed Jan 29 14:41:12 2025 -0800 [lexical-utils] Feature: add reverse dfs iterator (meta#7107) commit 3a140d2 Author: mohammed shaheer kp <[email protected]> Date: Tue Jan 28 06:19:45 2025 +0530 [lexical-playground] Bug Fix: Ensure Delete Node handles all node types (meta#7096) Co-authored-by: shaheerkpzaigo <[email protected]> commit 8e2ede2 Author: Adam Pugh <[email protected]> Date: Mon Jan 27 18:49:38 2025 -0600 Listeners Lexical: 3 updates to spelling and grammar - Update listeners.md (meta#7100) commit 9fcc494 Author: Adam Pugh <[email protected]> Date: Mon Jan 27 18:49:34 2025 -0600 Lexical Docs: 2 updates to spelling README.md (meta#7102) commit 946a6df Author: Adam Pugh <[email protected]> Date: Mon Jan 27 18:49:29 2025 -0600 Selection | Lexical: 1 Spelling Update Update selection.md (meta#7103) commit ce93ea6 Author: Adam Pugh <[email protected]> Date: Mon Jan 27 18:49:25 2025 -0600 Creating a React Plugin: 1 Grammar Update - Update create_plugin.md (meta#7104) commit ed29d89 Author: Adam Pugh <[email protected]> Date: Mon Jan 27 18:49:21 2025 -0600 Working with DOM Events: 2 Spelling and Grammar Updates Update dom-ev… (meta#7105) commit 212b70f Author: James Fitzsimmons <[email protected]> Date: Mon Jan 27 08:48:09 2025 +1100 [lexical-yjs] Bug Fix: handle text node being split by Yjs redo (meta#7098) commit 6a98a47 Author: Torleif Berger <[email protected]> Date: Fri Jan 24 21:46:45 2025 +0100 [lexical-react] Bug Fix: Import `JSX` type from React to prevent "Cannot find namespace 'JSX'"-error when type-checking with React 19 (meta#7080) commit f8e5968 Author: Tetsuya <[email protected]> Date: Sat Jan 25 04:06:57 2025 +0800 [lexical] Chore: Rename variable and add comments for Safari compositing workaround (meta#7092) commit 81c9ab6 Author: Mateo Vuković <[email protected]> Date: Fri Jan 24 18:44:05 2025 +0100 Fix: Use already defined RegisteredNodes type (meta#7085) commit 63958a2 Author: Sherry <[email protected]> Date: Tue Jan 21 18:15:21 2025 +0800 [playground] Bug fix: prevent growing whitespaces in markdown table toggle (meta#7041) Co-authored-by: Bob Ippolito <[email protected]> commit d9f9924 Author: Sherry <[email protected]> Date: Tue Jan 21 14:58:08 2025 +0800 Unrevert [Breaking Change][lexical] Bug Fix: Commit updates on editor.setRootElement(null) meta#7023 (meta#7068) commit 92fa0a3 Author: mohammed shaheer kp <[email protected]> Date: Tue Jan 21 06:23:24 2025 +0530 [lexical-playground] plugins TableOfContent Scroll smooth behaviour A… (meta#7069) commit 2e4a63e Author: Ivaylo Pavlov <[email protected]> Date: Mon Jan 20 02:37:34 2025 +0000 [lexical-playground] Fix Columns Layout Item Overflow (meta#7066) commit d319b07 Author: Bob Ippolito <[email protected]> Date: Sun Jan 19 14:45:41 2025 -0800 Change fork modules to use production only when NODE_ENV explicitly set to production (meta#7065) commit 46c9c2f Author: CityHunter <[email protected]> Date: Sat Jan 18 13:00:38 2025 +0800 [lexical] Bug Fix: In the Safari browser, during the compositing event process, the delete key exhibits unexpected behavior. (meta#7061) Co-authored-by: 涂博闻 <[email protected]> commit 92a1cd7 Author: Violet Rosenzweig <[email protected]> Date: Thu Jan 16 18:44:11 2025 -0500 docs: Change "here" link to more descriptive text (meta#7058) commit f6377a3 Author: Aman Harwara <[email protected]> Date: Fri Jan 17 02:08:17 2025 +0530 [lexical-table] Bug Fix: Prevent error if pasted table has empty row (meta#7057) commit 0835029 Author: Aman Harwara <[email protected]> Date: Fri Jan 17 00:18:08 2025 +0530 [lexical-list] Bug Fix: Prevent error when calling formatList when selection is at root (meta#6994) commit 940435d Author: Brayden <[email protected]> Date: Wed Jan 15 16:10:01 2025 -0800 fix: iOS Autocorrect strips formatting by reporting wrong dataType (meta#5789) Co-authored-by: Bob Ippolito <[email protected]> commit 136a565 Author: Aman Harwara <[email protected]> Date: Thu Jan 16 04:48:32 2025 +0530 [lexical-yjs] Feature: Allow passing in custom `syncCursorPositions` function to collab hook (meta#7053) commit 415c576 Author: Maksim Horbachevsky <[email protected]> Date: Wed Jan 15 18:18:03 2025 -0500 fix: triple click around inline elements (links) (meta#7055) commit a3ef4f3 Author: Ivaylo Pavlov <[email protected]> Date: Wed Jan 15 23:15:39 2025 +0000 [lexical-table] Support table alignment (meta#7044) commit 29d733c Author: Sherry <[email protected]> Date: Wed Jan 15 21:50:07 2025 +0800 Revert [Breaking Change][lexical] Bug Fix: Commit updates on editorSetRootElement(null) (meta#7023) (meta#7052) commit 65ce66a Author: Bob Ippolito <[email protected]> Date: Tue Jan 14 14:57:54 2025 -0800 [lexical] Bug Fix: Normalize selection after applyDOMRange to account for Firefox differences (meta#7050) commit bbc07af Author: Bob Ippolito <[email protected]> Date: Tue Jan 14 08:55:46 2025 -0800 [*] Bug Fix: Use GITHUB_OUTPUT instead of GITHUB_ENV for size-limit action (meta#7051) commit c8f27ed Author: Bob Ippolito <[email protected]> Date: Tue Jan 14 06:36:13 2025 -0800 [Breaking Change][*] Chore: Use terser for optimizing cjs prod build (meta#7047) commit 8bd22d5 Author: Bob Ippolito <[email protected]> Date: Mon Jan 13 07:09:31 2025 -0800 [lexical] Bug Fix: Handle MutationObserver/input event re-ordering when using contentEditable inside of an iframe (meta#7045) commit 930629c Author: Ivaylo Pavlov <[email protected]> Date: Sat Jan 11 06:03:30 2025 +0000 Clean up nested editor update (meta#7039) commit bd874a3 Author: Bob Ippolito <[email protected]> Date: Fri Jan 10 15:23:54 2025 -0800 [Breaking Change][lexical][lexical-selection][lexical-list] Bug Fix: Fix infinite loop when splitting invalid ListItemNode (meta#7037) commit 541fa43 Author: Bob Ippolito <[email protected]> Date: Thu Jan 9 12:42:23 2025 -0800 v0.23.1 (meta#7035) Co-authored-by: Lexical GitHub Actions Bot <> commit d7abafd Author: Bob Ippolito <[email protected]> Date: Thu Jan 9 08:33:12 2025 -0800 [Breaking Change][lexical] Bug Fix: Commit updates on editor.setRootElement(null) (meta#7023) commit 6add515 Author: Bob Ippolito <[email protected]> Date: Wed Jan 8 17:27:15 2025 -0800 [lexical] Fix TabNode deserialization regression (meta#7031) commit 33e3677 Author: Maksim Horbachevsky <[email protected]> Date: Wed Jan 8 14:59:03 2025 -0500 [lexical-react] Feature: Merge TabIndentionPlugin and ListMaxIndentLevelPlugin plugins (meta#7018) commit 7de86e4 Author: James Fitzsimmons <[email protected]> Date: Wed Jan 8 09:45:25 2025 +1100 [lexical-mark] Bug Fix: reverse ternary in MarkNode.addID (meta#7020) commit 7961130 Author: Bob Ippolito <[email protected]> Date: Sun Jan 5 13:55:25 2025 -0800 v0.23.0 (meta#7017) Co-authored-by: Lexical GitHub Actions Bot <> commit 2b4252d Author: Aman Harwara <[email protected]> Date: Sat Jan 4 11:31:19 2025 +0530 [lexical-yjs] Feature: Expose function to get anchor and focus nodes for given user awareness state (meta#6942) commit 8100d6d Author: Ivaylo Pavlov <[email protected]> Date: Sat Jan 4 01:12:04 2025 +0000 [lexical-playground] Fix table hover actions button position (meta#7011) commit bd1ef2a Author: Bob Ippolito <[email protected]> Date: Fri Jan 3 14:25:31 2025 -0800 [lexical] Bug Fix: Fix registerNodeTransform regression introduced in meta#6894 (meta#7016) commit 85c08b6 Author: Christian Grøngaard <[email protected]> Date: Thu Jan 2 00:20:20 2025 +0100 [lexical-playground] Refactor: switch headings test file names (meta#7008) commit 7c21d4f Author: Bob Ippolito <[email protected]> Date: Wed Jan 1 12:48:12 2025 -0800 [Breaking Change][lexical] Feature: Add updateFromJSON and move more textFormat/textStyle to ElementNode (meta#6970) commit aaa9009 Author: Bob Ippolito <[email protected]> Date: Wed Jan 1 07:50:39 2025 -0800 [lexical] Bug Fix: Fix getNodes over-selection (meta#7006) commit 803391d Author: Sherry <[email protected]> Date: Tue Dec 31 11:26:17 2024 +0800 [__test__] npm upgrade astro (meta#7001) commit 684352b Author: Christian Grøngaard <[email protected]> Date: Mon Dec 30 05:12:45 2024 +0100 Documentation: Fix typo "nest nest"->"nest" in README.md (meta#7000) Co-authored-by: Bob Ippolito <[email protected]> commit 27b75cc Author: Sherry <[email protected]> Date: Fri Dec 27 11:06:29 2024 +0800 [__tests__] npm upgrade next (meta#6996) commit 05ddbcc Author: Simon <[email protected]> Date: Thu Dec 26 03:37:50 2024 +0100 [lexical] Bug Fix: Flow is missing some variables and functions (meta#6977) commit e79c946 Author: Sherry <[email protected]> Date: Tue Dec 24 09:54:46 2024 +0800 v0.22.0 (meta#6993) Co-authored-by: Lexical GitHub Actions Bot <> commit c415f7a Author: Sam Zhou <[email protected]> Date: Mon Dec 23 10:31:36 2024 -0800 [lexical-react] Refactor: Replace `React$MixedElement` and `React$Node` with `React.MixedElement` and `React.Node` (meta#6984) commit c844a4d Author: Sherry <[email protected]> Date: Tue Dec 24 02:30:52 2024 +0800 [lexical] Fix flow error: change this to any (meta#6992) commit 6190033 Author: Germán Jabloñski <[email protected]> Date: Mon Dec 23 05:19:27 2024 -0300 Refactor: exportJSON (meta#6983) commit e0dafb8 Author: Germán Jabloñski <[email protected]> Date: Sat Dec 21 13:59:01 2024 -0300 feature: expose forEachSelectedTextNode (meta#6981) Co-authored-by: Bob Ippolito <[email protected]> commit 23715f5 Author: Alex <[email protected]> Date: Fri Dec 20 18:23:27 2024 +0300 [lexical][lexical-table] Bug fix: TablePlugin: - check is current selection in target table node (meta#6979) Co-authored-by: alazarev <[email protected]>
Co-authored-by: Bob Ippolito <[email protected]>
Co-authored-by: Bob Ippolito <[email protected]>
Co-authored-by: Bob Ippolito <[email protected]>
Co-authored-by: Bob Ippolito <[email protected]>
…r $config and config
Collaborator
Author
|
Superseded by #7258 |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Superseded by #7258
Description
Exploratory fork of #7117 also exploring how to work around the fact that we can't really properly type things like updateFromJSON, etc.
See also #6998 discussion.
The short story is that this sort of thing will let us get better type-level information about nodes. We can't have
node.getType()ever give a more specific type thanstringbut we could write a$getType(node)that does infer to the exact type if we want. Same thing fornode.exportJSON()and similar methods.It also facilitates scrapping all of the node subclass boilerplate, except for this one method, so long as the class has a compatible signature (trivial constructor)
Example of extension and inference capability from the tests
How it works
The proposed protocol for declaring nodes would scale down to something like this:
The two method interface is useful for TypeScript reasons, basically. The outer
getStaticNodeConfig(could come up with a shorter and/or more memorable name) is the API and thethis.configureNode(…)is a helper method that has the right generics to make it easy to return something with the right shape and type. The types are very delicate, if you don't have all of the annotations just right then the type will simplify into something without information that can be extracted. Basically it is just returning an object like this, but in a way where TypeScript doesn't collapse the type into something simpler (kind of like usingas constorsatisfiesin the right place):On the LexicalEditor side, during createEditor,
CustomTextNode.prototype.$config()is called and can grab the type and any other useful metadata (e.g. a defined transform, registered state, anything else we want to put in there). For compatibility reasons it will also monkeypatchgetType,importJSON, andclonestatic methods onto the node class if they are not already there. It adds a module global variable to inject cloned node keys so it doesn't need to break any compatibility with multi-argument constructors, it only requires that they have a 0-argument form.I've also put a
$createmethod in there which reduces the boilerplate and increases the efficiency there, assuming that we'd be willing to deprecatewithin the node overrides and go directly towithKlassso that we don't have to construct any intermediate garbage when that's configured.I think this covers most of the breaking-ish changes I would want to make to the lowest level stuff, in exchange for better DX and no loss of performance (probably better, even if just code size improves).
Future direction
I think this is where we fix the rest of the #6998 things here with some combination of middleware-style functions or automatic super calls (like
$afterCloneFrom) instead of methods so that we can control things better without variance violations.