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

perf(portable-text-editor): improve range deocration render perf #6441

Merged
merged 6 commits into from
Apr 22, 2024

Conversation

skogsmaskin
Copy link
Member

@skogsmaskin skogsmaskin commented Apr 22, 2024

Description

This will skip unnecessary re-renders of range decorations when the previous values are the same (but the object might be different).

Also added a test for this.

What to review

Will there be a situation where we did want to re-render even though the values are the same, but the object is different? I can't think of anything, but perhaps give this an extra thought.

Testing

Covered by automatic tests

Notes for release

N/A

@skogsmaskin skogsmaskin requested review from a team and jordanl17 and removed request for a team April 22, 2024 08:49
Copy link

vercel bot commented Apr 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview Apr 22, 2024 4:41pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 22, 2024 4:41pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Apr 22, 2024 4:41pm

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Apr 22, 2024

Component Testing Report Updated Apr 22, 2024 4:47 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 34s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 6s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 26s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 13s 4 2 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 13s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 34s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 1s 14 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 4s 18 0 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 21s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 15s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 21s 9 0 0

@skogsmaskin
Copy link
Member Author

I see the e2e tests picked up on something here, investigating.

@skogsmaskin
Copy link
Member Author

skogsmaskin commented Apr 22, 2024

I see the e2e tests picked up on something here, investigating.

This is now resolved

There was an issue where decorations were returned for items that should not have decorations,
causing the browser to freeze.
@skogsmaskin skogsmaskin added this pull request to the merge queue Apr 22, 2024
Merged via the queue into next with commit c9b1ebb Apr 22, 2024
25 of 27 checks passed
@skogsmaskin skogsmaskin deleted the feat/range-decorations-perf-improvement branch April 22, 2024 16:40
jordanl17 pushed a commit that referenced this pull request Apr 23, 2024
* feat(portable-text-editor): improve range decorations perf by comparing prev values

* test(portable-text-editor): add tests for range decorations rendering

* fixup! feat(portable-text-editor): improve range decorations perf by comparing prev values

* test(portable-text-editor): improve some minor test things

* fix(portable-text-editor): fix issue with invalid return of decorations

There was an issue where decorations were returned for items that should not have decorations,
causing the browser to freeze.

* fix(portable-text-editor): move ref to top
cngonzalez pushed a commit that referenced this pull request May 8, 2024
* feat(portable-text-editor): improve range decorations perf by comparing prev values

* test(portable-text-editor): add tests for range decorations rendering

* fixup! feat(portable-text-editor): improve range decorations perf by comparing prev values

* test(portable-text-editor): improve some minor test things

* fix(portable-text-editor): fix issue with invalid return of decorations

There was an issue where decorations were returned for items that should not have decorations,
causing the browser to freeze.

* fix(portable-text-editor): move ref to top
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