Engine: Report template values as payload that names where they belong - #2273
Merged
Conversation
|
View your CI Pipeline Execution ↗ for commit cd58803
💡 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/values
branch
from
August 18, 2026 02:57
143c541 to
cd58803
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 turns what
DynamicsCompilerproduces from a bare Hash of indices into a payload that says which template, version and rendering the values came from, so a client can join them to the markers on the page.An index is a position in one template's numbering and means something else in the next, so a bare Hash of them cannot be joined to anything. Carrying the identifier and version
SlotVisitorgave the markers lets a client tell the two were compiled together, and that a version no longer matching means the indices are not to be trusted.That shape is also what a partial needs.
<%= render "posts/card" %>evaluates to the partial's own values, and coercing them to a string flattened a whole payload into the markup it was meant to replace. A render keeps its value as it is, so a partial nests as a payload of its own, as deeply as the template does.A template on the page more than once has one region per rendering, and counting them down the document holds only while render order and document order agree, which
content_forandprovidebreak by design. The region marker carries the number now, counted as the page renders, so the client reads the server's own answer instead of inferring one. The counter hangs off the view, which in Rails is the request, so every response starts at zero and a partial shares the count with the template that rendered it.The round trip is what proves the two halves agree. It renders a template twice, hands the second rendering's values to the first rendering's markers, and asserts the page is byte for byte what the server would have sent. Nothing else says the numbering, the row keys, the attribute names and the collapsed conditional are all right at once, and each of them is wrong in a way that leaves the page looking plausible. Swapping two indices in the fixture fails the round trip, which is the check that the check is worth having.