Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .changeset/batched-style-injection.md

This file was deleted.

14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# @cube-dev/ui-kit

## 0.168.0

### Minor Changes

- [#1344](https://github.com/cube-js/cube-ui-kit/pull/1344) [`7f786591`](https://github.com/cube-js/cube-ui-kit/commit/7f7865910ae4f9858d5052cd1452cb457530ce92) Thanks [@tenphi](https://github.com/tenphi)! - Collapse the kit's stylesheet writes into one style invalidation per commit.

Every `insertRule()` on a live stylesheet invalidates style for that sheet's scope. Kit components inject during React's render phase, so when anything else reads layout in the same pass — a tooltip positioning itself, `TextArea` autosizing, a virtualized table measuring rows — the two interleave and the browser is forced to recalculate style between every injection.

`<Root>` now enables tasty's `batchInjection` and opens a batch window for its own commits. A commit that mounts a portal does not re-render `<Root>`, so windows are opened per portal boundary too: `<Portal>` (tooltips) and `<Overlay>` (popovers, modals and trays — the `Dialog` and `Menu` surfaces). Those are the commits where injection and measurement interleave worst, because react-aria positions the overlay from a layout effect in the same commit that mounts it.

Writes are queued and applied together, and the flush happens in `useInsertionEffect` — before any `useLayoutEffect` — so nothing can measure an element whose rules have not landed yet. Any commit without a window in it writes straight through exactly as before.

No API change: no new props, no new setup. SSR is unaffected — styles are collected as text there and the provider is inert without a `document`.

## 0.167.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cube-dev/ui-kit",
"version": "0.167.0",
"version": "0.168.0",
"type": "module",
"description": "UIKit for Cube Projects",
"repository": {
Expand Down
Loading