Skip to content

Analysis: Work out which templates a state change affects - #2188

Merged
marcoroth merged 1 commit into
analysis-dependency-trackingfrom
analysis-affected-templates
Aug 11, 2026
Merged

Analysis: Work out which templates a state change affects#2188
marcoroth merged 1 commit into
analysis-dependency-trackingfrom
analysis-affected-templates

Conversation

@marcoroth

@marcoroth marcoroth commented Aug 11, 2026

Copy link
Copy Markdown
Owner

This pull request adds the query the dependency data exists for: given a template and one piece of state, which templates have to be rendered again.

show.html.erb:

<%= render "posts/header", post: @post %>

_header.html.erb:

<%= render "posts/title", title: post.title %>

_title.html.erb:

<h1><%= title %></h1>
affectedTemplates(graph, "app/views/posts/show.html.erb", "@post")
// ["app/views/posts/_header.html.erb", "app/views/posts/_title.html.erb", "app/views/posts/show.html.erb"]

State enters at the entry point and goes no further than the locals carrying it. A partial is affected only when a render call hands it something derived from state its caller is already carrying, so it walks a chain:

Changing @post affects all three. @post flows into post, post flows into title, and each partial starts carrying the local it was handed.

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

🌿 Interactive Playground and Documentation Preview

A preview deployment has been built for this pull request. Try out the changes live in the interactive playground:


🌱 Grown from commit ee32342


✅ Preview deployment has been cleaned up.

@pkg-pr-new

pkg-pr-new Bot commented Aug 11, 2026

Copy link
Copy Markdown
npx https://pkg.pr.new/@herb-tools/formatter@2188
npx https://pkg.pr.new/@herb-tools/language-server@2188
npx https://pkg.pr.new/@herb-tools/linter@2188

commit: ee32342

@marcoroth
marcoroth marked this pull request as ready for review August 11, 2026 17:45
@marcoroth
marcoroth merged commit 9221b25 into main Aug 11, 2026
23 checks passed
@marcoroth
marcoroth deleted the analysis-affected-templates branch August 11, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

analysis typescript TypeScript source across the javascript/ packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant