Skip to content

perf(runtime-tags): stop materializing branch boundary nodes - #3712

Open
DylanPiercey wants to merge 1 commit into
mainfrom
dpiercey-ws-marko-comments-optimization-lfdet4
Open

perf(runtime-tags): stop materializing branch boundary nodes#3712
DylanPiercey wants to merge 1 commit into
mainfrom
dpiercey-ws-marko-comments-optimization-lfdet4

Conversation

@DylanPiercey

@DylanPiercey DylanPiercey commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Control flow boundaries no longer leave permanent nodes behind. Client rendered templates stop padding the ends of a template or branch body whose edge is if/for/dynamic tag content, and resuming a server rendered branch adopts its real edge nodes rather than retaining the start comment and inserting a text node. A new fixBranchEdges keeps owner ranges valid by repairing their endpoints as nested content moves.

<show>, <await> and <try> keep their own anchors — a <show> body is inlined into the enclosing scope and the others move their anchors themselves — so they repair their owner's edges rather than being repaired.

Costs ~69B brotli of runtime; halves the marker nodes in a resumed page.

@changeset-bot

changeset-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4f592ea

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@marko/runtime-tags Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.37%. Comparing base (3ba2287) to head (4f592ea).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3712      +/-   ##
==========================================
+ Coverage   90.34%   90.37%   +0.02%     
==========================================
  Files         414      414              
  Lines       19746    19786      +40     
  Branches     3615     3633      +18     
==========================================
+ Hits        17840    17881      +41     
  Misses       1367     1367              
+ Partials      539      538       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DylanPiercey
DylanPiercey marked this pull request as ready for review July 30, 2026 21:43
Client rendered templates no longer pad the ends of a template or branch
body whose edge is `if`/`for`/dynamic tag content, and resuming a server
rendered branch adopts its real edge nodes instead of retaining the start
comment and inserting a text node. `fixBranchEdges` keeps owner ranges
valid by repairing their endpoints as nested content moves.

`<show>`, `<await>` and `<try>` own their anchors — a `<show>` body is
inlined into the enclosing scope and the others move their anchors
themselves — so the branch chain cannot repair their ranges. They keep
their padding and markers, and instead repair their owner's edges when
they detach, swap in a placeholder, or resolve.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant