ReviewOS

also looking at this

stacks/bench-review

fix: revert {⁠{ }} → :text in 6 @include partials (SSR regression from #67)

#68
Merged glennmichael123 wants to merge fix/revert-mustache-in-includes into main
6 files +22 -18
9 days ago

What

Reverts the :text → conversion in 6 @include partials that #67 broke. Each goes back to its exact pre-migration :text/x-text form.

PartialBindings
Bench/Admin/AdminDashboardpendingCount(), userCount()
Bench/Admin/AdminShelladminName
Bench/Blog/BlogHeaderpost.title, post.author.name, readingTime, post.date
Bench/Court/CourtHeadercourtName, #${courtHeaderId}, city/state
Bench/PricingSectionpricingPeriod() ×3
Bench/VerifyEmailmessage(), resendNote(), resending() ×…

Why

These partials define their reactive data in their own <script client>. But includes.ts strips a partial's <script> before processExpressions runs, so usesSignalsInScript can't detect the state()/derived() and the are evaluated server-side (vars undefined → emptied). Because the marker is then gone, the re-executed scoped script has nothing to bind — the elements render permanently empty. bench-review is SSR (Mode 1), so this is user-visible (blank admin counts, blank verify-email message, blank blog/court headers, blank pricing period).

:text is an attribute — it survives server-side untouched, and the client binds it after the scoped script re-runs. That's why the original code worked.

Pages converted in #67 are unaffected (a top-level page keeps its <script>, so the gate stays true and is preserved).

Framework root cause

Full analysis + proposed fix: stacksjs/stx#1758. Once stx preserves in partials that had a client <script>, these can migrate back — until then :text/x-text is required in @include partials/components.

🤖 Generated with Claude Code

6 changed files on the files tab, with 0 review threads.

Sign in to comment on this pull request.