Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
acywatson
commented
Mar 4, 2023
acywatson
commented
Mar 4, 2023
Contributor
|
One deserialization error that I've had before is caused by the fact that markdown's shortcut's regex for the numeric list matches on any number, so it's possible to create numeric lists that do not start from |
Contributor
Author
Oh weird. I guess starting a list at a number other than 1 should be possible. Might need to look into that separately. |
zurfyx
approved these changes
Mar 7, 2023
Merged
Merged
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.
This one was a bit gnarly and probably requires a deeper fix at some point. We've had reports of people encountering issues when deserializing lists, and it all goes back to this issue: #3227
What we're doing here is basically trying to update Lexical nodes during the reconciliation phase, which typically works fine, but encounters some issues in a few cases. One of those is when reconciliation runs asynchronously, which seems to be what's happening in the case of state being initialized from a string via LexicalComposer. Basically, we "freeze" the node map after the update cycle to ensure that state can't be further updated outside of that cycle. In this case, we were freezing the map, then createDOM was running, calling these list item update functions, which tried to update the nodes. There are several interrelated issues here, including the underlying structure/function of lists, which we will ultimately probably change (as discussed elsewhere).
The fix I'm proposing here is to introduce a method to nodes that allows them to declare a transform on themselves, rather than registering it through the register API. This allows us to keep this logic encapsulated at the node level, rather than moving it to the plugin, and it should otherwise function the same.
fixes #3975 and #3227