v0.2.4
Pyxle Kit (the new pyxle/client reference demo) exercises every
client component in one place, so this release implements or
hardens the ones that were still stubs or racy on hydration.
Highlights
SSR pathname plumbing
The worker pool now propagates the request path into the Node SSR
runtime, which sets globalThis.__PYXLE_CURRENT_PATHNAME__ for the
duration of the render. This eliminates:
- hydration mismatches on
usePathname()(e.g. active-link highlighting) <Form>/useActionaction-URL mismatches between SSR and client
Client components
<Head>— clientuseEffectrewrite. Adopts SSR-rendered head
nodes by key attribute (no duplicates on hydration), restores the
previous<title>on unmount.<Script>— full implementation, not a stub. Strategies
afterInteractive(default),lazyOnload, andbeforeInteractive;
module-level promise dedup; cooperation with bootstrap-preloaded
scripts;onLoad/onError; inline children viascript.textContent.<Image>—placeholder=\"blur\"withblurDataURLor
placeholderColor,fallbackSrcfor graceful recovery on broken
primarysrc,onLoad/onErrorwith cache-hit detection, and a
data-pyxle-image-stateattribute for CSS-only fade transitions.
Also fixes a hydration race: a terminal-error on an SSR-rendered
src(e.g. a 404 avatar) is now recovered via the post-mount
complete && naturalWidth === 0check, sofallbackSrckicks in
even when the nativeerrorevent fired before React hydrated.usePathname()— reads the SSR pathname global so the first
client render matches SSR, then subscribes to framework navigation
events for reactive updates.
Documentation
Resolved the 8-item docs/framework parity audit:
- Documented
usePathname()inreference/client-api.md - Removed stale
dev:css/build:cssreferences across quick-start,
project-structure, faq, deployment, and thepyxle inithint — the
scaffold's actual flow is PostCSS-via-Vite, auto-run bypyxle dev - Updated the quick-start landing-page description and the
project-structure loader example to match the scaffold's real output - Added
source_absolute_path,content_hash, andhead_elementsto
theRouteContexttable in the middleware guide - Clarified the
pyxle buildchain description in the deployment guide
Tests
1141 passing (+14 new).