Improved performance for BasicTranscript, in PR 5183, by @OEvgeny
Fixed potential memory usage issues caused by useActivitiesWithRenderer, in PR 5183, by @OEvgeny
Description
Improve performance by more carefully memoizing activity-related components. Rework the useMemoAll hook into the new useMemoized hook exposing the memoized function to be used during render phase.
Design
The main changes driving the performance boost are:
Introduced TranscriptActivity to memoize everything we want to reuse for activity inside of a single component
Make renderingElements an array of React nodes, so it could be directly returned from render
Better memoize props by momizing children as well, so we could take advantage of memo when children are not changing
Specific Changes
BasicTranscript improvements
Use memo for activity related components
Add name for some components
Remove useMemoAll and replace with useMemoized
Add tests for useMemoized
Add TranscriptActivity component
Fix tests
Add end-to-end tests
-
-
[x] I have added tests and executed them locally
[x] I have updated CHANGELOG.md
[x] ~I have updated documentation~
Review Checklist
This section is for contributors to review your work.
[x] ~Accessibility reviewed (tab order, content readability, alt text, color contrast)~
[x] ~Browser and platform compatibilities reviewed~
[x] ~CSS styles reviewed (minimal rules, no z-index)~
[x] ~Documents reviewed (docs, samples, live demo)~
[x] ~Internationalization reviewed (strings, unit formatting)~
[x] ~package.json and package-lock.json reviewed~
[x] ~Security reviewed (no data URIs, check for nonce leak)~
Changelog Entry
BasicTranscript
, in PR 5183, by @OEvgenyuseActivitiesWithRenderer
, in PR 5183, by @OEvgenyDescription
Improve performance by more carefully memoizing activity-related components. Rework the
useMemoAll
hook into the newuseMemoized
hook exposing the memoized function to be used during render phase.Design
The main changes driving the performance boost are:
TranscriptActivity
to memoize everything we want to reuse for activity inside of a single componentrenderingElements
an array of React nodes, so it could be directly returned from rendermemo
when children are not changingSpecific Changes
BasicTranscript
improvementsmemo
for activity related componentsuseMemoAll
and replace withuseMemoized
useMemoized
TranscriptActivity
component-
-
CHANGELOG.md
Review Checklist
z-index
)~package.json
andpackage-lock.json
reviewed~