Repository navigation
Reconcile whitespace where request-time instances meet - #149
Closed
collin-thomas wants to merge 1 commit into
Closed
collin-thomas wants to merge 1 commit into
collin-thomas wants to merge 1 commit into
Conversation
With minify.html on, each component instance rendered from a server or stream script is minified on its own. Where two were written with nothing between them, the space each kept at its own edge could differ from the build, which minifies the page once: - in a table, where a removed comment leaves an empty separator, the space landed before the separator instead of after it; - an instance that leaves nothing at its edge (empty, or only comments and whitespace) was treated as a neighbor, so the instance beside it kept or doubled a space the build drops. The finalizer now resolves each instance's neighbors past instances that leave nothing, and merges the whitespace and separators at each seam the way the build treats that stretch. The differences were in bytes, not in what a browser renders. The fidelity test loaded each root's components once and reused them for every variant, so some variants paired files loaded with minify.html off with pages built with it on. No build does that (component files are minified as they load), and it is how a comment at the top of a component file reached this code. Components are now loaded per variant. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
collin-thomas
had a problem deploying
to
shop-preview
November 12, 2026 09:56 — with
GitHub Actions
Failure
Collaborator
Author
|
Superseded by the PR from |
This branch had an error being deployed
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.
Follow-up to the fidelity failure on #148. Independent of that PR; based on
main.What was wrong
With
minify.htmlon, each component instance rendered from a server or stream script is minified on its own, while the build minifies the page once. Where two instances were written with nothing between them, the request-time bytes could differ from the build's:<!---->separator. The space between two inline instances landed before the separator (</a> <!----> <a>) where the build puts it after (</a><!----> <a>).These are byte differences. A browser renders both forms the same.
What it was not
A comment at the top of a component file does not reach this code in a real build: component files are minified as they are loaded, so the comment is already gone. The fidelity test hit it because it loaded each root's components once (with
minify.htmloff for the first root) and reused that list for variants that build with it on.Changes
request-render.ts: the usage finalizer resolves each instance's neighbors past instances that leave nothing, then merges the whitespace and separators at each seam the way the build treats that stretch. One pass over the pieces' edges.component-manifest-fidelity.integration.test.ts: components are loaded per variant, under that variant's config.Tests
<pre>, paragraph), each compared withminifyHtmlof the same bytes.Verification
🤖 Generated with Claude Code