Skip to content

perf: optimize toolbar rendering#978

Merged
d3m1d0v merged 1 commit intomainfrom
perf-toolbar
Mar 10, 2026
Merged

perf: optimize toolbar rendering#978
d3m1d0v merged 1 commit intomainfrom
perf-toolbar

Conversation

@d3m1d0v
Copy link
Copy Markdown
Member

@d3m1d0v d3m1d0v commented Mar 6, 2026

  • optimized re-rendering of toolbar in editor (wysiwyg and markup mode)
  • Toolbar and FlexToolbar components now expects to be wrapped in a context (ToolbarProvider component) containing an event bus. Controls within toolbar update their state when receiving an "update" event via the event bus.
  • for backward compatibility, Toolbar and FlexToolbar components continue to work without context. However, this will be removed in the next major version.
  • For custom toolbar controls (with type=ToolbarDataType.ReactComponent), you can use the useToolbarContext() hook to access the context and event bus. This way, you can manually subscribe to "update" event. Set noRerenderOnUpdate:true to disable component re-rendering; otherwise, toolbar will re-render your component when it receives the "update" event.

@d3m1d0v d3m1d0v requested a review from makhnatkin as a code owner March 6, 2026 14:14
@d3m1d0v d3m1d0v changed the title perf(): optimize toolbar rendering perf: optimize toolbar rendering Mar 6, 2026
@gravity-ui
Copy link
Copy Markdown

gravity-ui Bot commented Mar 6, 2026

Storybook Deployed

@gravity-ui
Copy link
Copy Markdown

gravity-ui Bot commented Mar 6, 2026

🎭 Playwright Report

@d3m1d0v d3m1d0v merged commit c771392 into main Mar 10, 2026
8 checks passed
@d3m1d0v d3m1d0v deleted the perf-toolbar branch March 10, 2026 11:29
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