Summary
Two dev-server correctness fixes in packages/bun-plugin/src/serve.ts. Bug reports tracked on the framework repo: stacksjs/stacks#1926 and stacksjs/stacks#1927.
stacksjs/stacks#1926 — dev mode emits no-cache (should be no-store)
- 8 response sites set
Cache-Control: no-cache. That means "revalidate before reuse", not "don't store" — and with no ETag/Last-Modified, Chrome/Safari heuristically reused stale bodies, so edit→save→reload sometimes showed ghost output. Swapped all 8 tono-store. The SSE stream'sno-cache, no-transformis intentionally untouched (no static body to cache). - Companion: the rendered-HTML cache in
processTemplate()is gated off (ENABLE_HTML_CACHE = false).templateSignatureFreshcompares dependency mtimes, but transitive@includes sometimes weren't registered into the dependency set, so editing a deeply-included partial intermittently served stale HTML. The dev server should be source-of-truth every request; a fresh render (~50ms) is worth the correctness. Infra kept behind the flag to re-enable once dep-tracking is closed.
stacksjs/stacks#1927 — nested dynamic routes 404 on hard reload
judges/[id]/profile/index.stxproduced^judges/([^/]+)/profile/index$, which never matchedjudges/35/profile. The/index-stripped variant was already pushed inline; this extracts the regex-set construction into an exportedbuildDynamicRouteRegexes(fileRouteBase)(behavior identical) so it's unit-testable, and adds 10 tests (single-segment, nested,pages/-prefixed, capture-group, and back-compat for the index-included URL).
Note on stacksjs/stacks#1928
The sibling issue (_handleStxLoad only scanning the SPA container) is already fixed in current main — signals.ts walks document.body.querySelectorAll('[data-stx-scope]') at both the bind and mount loops (landed under #1697). No code change needed.
Test plan
packages/bun-plugin/test/dynamic-routes.test.ts— 10 new tests, all green- existing
serve.test.ts— 6/6 green no-storecount = 8; SSEno-cache, no-transformpreserved- maintainer: confirm disabling the dev htmlCache outright (vs. fixing transitive-include dep tracking) is the preferred call
🤖 Generated with Claude Code