Skip to content

Feat/rehydrate optimization - #179

Merged
breezykermo merged 2 commits into
mainfrom
feat/rehydrate-optimization
Sep 18, 2026
Merged

breezykermo merged 2 commits into
mainfrom
feat/rehydrate-optimization

Conversation

@breezykermo

Copy link
Copy Markdown
Contributor

See changelog.md.

…g a page

A morph does not re-execute the page's scripts, and refetched page bytes are
the pre-hydration build output, so a package whose script does work at boot
had that work reverted with nothing re-running to redo it. The widget was
left drawn as though it had never started, and nothing threw.

A package now declares `js_rehydrate = true` in its `[tool.rheo.<format>]`
block and pushes a callback onto `window.__rheoRehydrate`. Declaring scripts
render with `data-rheo-rehydrate`; the live client surveys every script on
the page before morphing and reloads instead if any one of them is
undeclared, then runs the callbacks after a morph it did perform.
A package that #imports another package now contributes that package's
declared css_stylesheet and js_scripts too, so a shared helper package works
by being depended on rather than by every consuming project repeating the
import. The asset scan walks the imported packages breadth-first from the
project's own imports until no new ones appear.

Specs a project imports directly keep their position ahead of anything reached
only through a package, because injection order is script execution order on
the page. An import cycle terminates, and a spec that resolves to no package
is skipped rather than failing a build that would otherwise have succeeded.
@breezykermo
breezykermo merged commit e8e6c89 into main Sep 18, 2026
2 of 3 checks passed
@breezykermo
breezykermo deleted the feat/rehydrate-optimization branch September 18, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant