Skip to content

Compute slot items once per render instead of once per slot - #613

Merged
dannyleech merged 1 commit into
mainfrom
612-compute-slot-items-once
Oct 21, 2026
Merged

dannyleech merged 1 commit into
mainfrom
612-compute-slot-items-once

Conversation

@dannyleech

Copy link
Copy Markdown
Contributor

Resolves #612

Every SlotRenderer used to call getSlotItems, which ran every excludeWhen across all buttons and controls before keeping its own slot's items. Slot items are now built once per render by getItemsBySlot and shared with every slot through a new SlotItemsProvider around <Layout />. This cuts repeated checks by about 15×, so the cost grows with the number of items rather than slots × items. Behaviour and the number of renders are unchanged. Reducing renders, for example with a stateMap, will be explored in a follow-up ticket.

@sonarqubecloud

Copy link
Copy Markdown

@dannyleech
dannyleech merged commit d3c7772 into main Oct 21, 2026
2 checks passed
@dannyleech
dannyleech deleted the 612-compute-slot-items-once branch October 21, 2026 12:28
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.

Compute slot items once per render instead of once per slot

2 participants