Repository navigation
Conversation
Actions now go through a custom Datastar action, @Hyperaction(id, params), instead of one @post per action. Each call numbers the action and queues it with the page's signals and the render version of the HTML it was made on; every request posts the tab's actions whose requests have not completed. The server runs a tab's requests one at a time and skips sequence numbers it has already run, so each action runs once and in the order it was made, whichever request arrives first. Each render that changes the HTML gets a version, sent as data-hyper-render-version on #hyper-app (or on a reactive region's root for a partial render), and its actions are kept under it. Positional action ids are resolved against that render, so a click from an outdated page runs the action it showed rather than whatever now sits at its position. A render of the same HTML keeps its version; renders before the page version the client shows are dropped.
An h/expr with a ; returns its value through __hyper_r, a statement that only works as a whole handler. As a client param it sits in an action's argument object or inside another expression, where it was a syntax error, so such a param is now wrapped in a function.
An action brings the page's signals as they were when it was made. When the server wrote a signal after that (an upload landing, say), the action's copy overwrote it, and the client was never patched back. Signal patches are now numbered and the client sends the number of the last one it applied (hyperSignalSeq); a path the server wrote after that keeps the server's value, which is then patched to the client.
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.
Actions now go through a custom Datastar action, @Hyperaction(id, params),
instead of one https://github.com/post per action. Each call numbers the action and queues it
with the page's signals and the render version of the HTML it was made on;
every request posts the tab's actions whose requests have not completed.
The server runs a tab's requests one at a time and skips sequence numbers it
has already run, so each action runs once and in the order it was made,
whichever request arrives first.
Each render that changes the HTML gets a version, sent as
data-hyper-render-version on #hyper-app (or on a reactive region's root for
a partial render), and its actions are kept under it. Positional action ids
are resolved against that render, so a click from an outdated page runs the
action it showed rather than whatever now sits at its position. A render of
the same HTML keeps its version; renders before the page version the client
shows are dropped.