Feat/rehydrate optimization - #179
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See changelog.md.