Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memoize markdownUtils inside the commit hook #541

Merged
merged 5 commits into from
Nov 21, 2024

Conversation

j-piasecki
Copy link
Collaborator

Details

Instead of creating RCTMarkdownUtils every time the commit hook is run, memoize it in the state of the decorator shadow node. We can accomplish that by cloning the decorator node after the text input node is cloned. This way, we can clone the decorator in-place since the parent would be mutable at that point in time.

Manual Tests

Verify that the library still works and isn't flickering on the new architecture

@j-piasecki j-piasecki changed the title @jpiasecki/memoize utils commit hook Memoize markdownUtils inside the commit hook Nov 7, 2024
@j-piasecki j-piasecki requested a review from tomekzaw November 7, 2024 09:42
Copy link
Collaborator

@tomekzaw tomekzaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR!

@tomekzaw tomekzaw merged commit 03ffb78 into main Nov 21, 2024
7 checks passed
@tomekzaw tomekzaw deleted the @jpiasecki/memoize-utils-commit-hook branch November 21, 2024 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants