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

Improve cache #2706

Merged
merged 9 commits into from
Jun 18, 2024
Merged

Improve cache #2706

merged 9 commits into from
Jun 18, 2024

Conversation

JiuqingSong
Copy link
Collaborator

@JiuqingSong JiuqingSong commented Jun 14, 2024

This is an improvement to existing cache code.

  1. Rename function updateCachedSelection to updateCache to let it update both cached content model and selection
  2. In setContentModel, we need to flush mutations before updating cache, so that the previous mutations will not impact the cached model, since we know the passed in model is the latest one
  3. Do not set DOM selection if the new selection is the same with the old one
  4. Fully decouple TextMutationObserver and DomIndexer. Now TextMutationObserver only capture mutations, and let CachePlugin.onMutation decide how to handle the mutations
  5. Refactor the callback onMuation of TextMutationObserver to let it handle all kinds of mutation, with a new comibined parameter to specify mutation types and content
  6. Add/update test cases

@JiuqingSong JiuqingSong merged commit 1996e17 into master Jun 18, 2024
7 checks passed
@JiuqingSong JiuqingSong deleted the u/jisong/improvecache branch June 18, 2024 19:15
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