Skip to content

v3.26.1

@tjloong tjloong tagged this 13 Sep 06:18
A group whose open state is only settled once Alpine runs — `expanded=false`, which
x-show applies, or a persisted state, which is not known until localStorage has been
read — was rendered with nothing hiding it, so the browser was free to paint it open
and snap it shut a moment later. Held the Livewire script (which carries Alpine) and
measured it: first paint at 28ms, the body hidden at 683ms, so the group sat open for
655ms. It is invisible locally only because Alpine wins the race — ~17ms against a
20-48ms first paint.

`x-cloak` now covers exactly those two cases. A group that simply starts open needs no
correction, so it still renders immediately rather than waiting on Alpine to reveal it.
atom.css has defined `[x-cloak]{display:none!important}` since v3.24.0 and the body sits
inside the group's x-data, so Alpine strips it.

This is also what made "a group stored collapsed never paints open" flaky (3 failures in
6 runs). It sampled computed display every requestAnimationFrame, which is not evidence
of a paint: a rAF callback can run before a deferred script and read a state that is
never rendered — measured first paint consistently landing after Alpine had corrected
the DOM. It also matched `[data-group] [x-show]`, which is the chevron inside the button
rather than the disclosure body. So it was deciding a real question with the wrong signal
on the wrong element, and passed or failed on scheduling luck.

It now holds the Alpine script back to make the race deterministic and asserts the body
is already hidden in the window after first paint and before Alpine, with a guard that
fails the run if Alpine got through anyway rather than passing vacuously. Stable 6/6.
Plus a blade-level assertion of which groups get cloaked and which must not.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Assets 2
Loading