Engine: Add client slot mode that parks untaken branches - #2268
Merged
Conversation
|
View your CI Pipeline Execution ↗ for commit 9eeae6f
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
🌿 Interactive Playground and Documentation PreviewA preview deployment has been built for this pull request. Try out the changes live in the interactive playground: 🌱 Grown from commit ✅ Preview deployment has been cleaned up. |
commit: |
marcoroth
force-pushed
the
slots/statics
branch
from
August 18, 2026 01:17
01cafa1 to
a027f26
Compare
…ches `<%# herb:slots client %>` sends the client the markup of the branches a request did not take, parked in a `<template>` that names its own region, so one of them can be built later without asking the server for markup the page was already given. `<%# herb:slots server %>` is the default and emits nothing beyond the markers, so nothing about a branch that did not render reaches the page. What gets parked is decided while rendering rather than while compiling. A branch that rendered is on the page already, so it is not sent twice, and a template whose every branch ran parks nothing at all. Three smaller changes come with it. A conditional whose branches lay out the same way collapses into one set of slots, since which branch ran only changes what those slots hold. An element-anchored slot now names the attribute it writes, so its name no longer has to be carried separately. And a template can be named by a digest of its path rather than by the path itself, because the markers go out with the page and a view tree says more about an application than its pages do. (cherry picked from commit d6b8667) (cherry picked from commit ca7f737)
marcoroth
force-pushed
the
slots/statics
branch
from
August 18, 2026 02:57
a027f26 to
9eeae6f
Compare
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.
This pull request adds a
clientslot mode, which sends the browser the markup of the branches a request did not take, parked in a<template>that names its own region. One of them can then be built later without asking the server for markup the page was already given.<%# herb:slots client %><%# herb:slots server %>stays the default and emits nothing beyond the markers, so nothing about a branch that did not render reaches the page.What gets parked is decided while rendering, not while compiling. A branch that rendered is on the page already, so it is not sent twice, and a template whose every branch ran parks nothing at all.
Herb::Engine::SlotStaticsprints the markup a branch would render with everything dynamic left out, which is what a client needs to build it: the parts that never change, and the positions of the parts that do.Three smaller changes come with it. A conditional whose branches lay out the same way collapses into one set of slots, since which branch ran only changes what those slots hold. An element-anchored slot names the attribute it writes, so its name no longer has to be carried separately. And a template can be named by a digest of its path instead of by the path itself, because the markers go out with the page and a view tree says more about an application than its pages do.
Slots are experimental and the marker format is not stable yet.