Skip to content

Ruby CLI: Support --slots on compile and render - #2269

Merged
marcoroth merged 1 commit into
slots/staticsfrom
slots/cli
Aug 18, 2026
Merged

Ruby CLI: Support --slots on compile and render#2269
marcoroth merged 1 commit into
slots/staticsfrom
slots/cli

Conversation

@marcoroth

@marcoroth marcoroth commented Aug 18, 2026

Copy link
Copy Markdown
Owner

--slots now takes an optional mode, server or client, and an unknown one is rejected before anything is compiled:

herb compile app/views/posts/index.html.erb --slots client

render ignored --slots entirely and never read the herb:slots directive, so it could not show what a template actually sends.

It now builds the visitor the same way compile does, and reads its source once, because reading stdin a second time returns nothing.

@github-actions github-actions Bot added ruby Ruby source for the gem and its libraries rbs RBS type signatures in sig/ engine Herb engine and Rails template compilation rubygem The herb RubyGem and its packaging labels Aug 18, 2026
@nx-cloud

nx-cloud Bot commented Aug 18, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 577577c

Command Status Duration Result
nx run-many -t test --all --parallel --exclude=... ✅ Succeeded 3m 53s View ↗
nx run-many -t build --all --exclude=herb-langu... ✅ Succeeded 17s View ↗
nx build @herb-tools/tailwind-class-sorter ✅ Succeeded 1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-08-18 03:32:45 UTC

@marcoroth
marcoroth changed the base branch from main to slots/statics August 18, 2026 01:19
@marcoroth marcoroth added the reactivity Reactive ERB templates: diff and re-render only what changed label Aug 18, 2026
@github-actions

github-actions Bot commented Aug 18, 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 577577c


✅ Preview deployment has been cleaned up.

@pkg-pr-new

pkg-pr-new Bot commented Aug 18, 2026

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

commit: 577577c

`--slots` now takes an optional mode, `server` or `client`, and an unknown one
is rejected before anything is compiled.

`render` ignored `--slots` entirely and never read the `herb:slots` directive,
so it could not show what a template actually sends. It now builds the visitor
the same way `compile` does, and reads its source once, because reading stdin
a second time returns nothing.

(cherry picked from commit 19b39e6)
(cherry picked from commit e867c3a)
@marcoroth
marcoroth merged commit e9fb14e into main Aug 18, 2026
65 of 71 checks passed
@marcoroth
marcoroth deleted the slots/cli branch August 18, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine Herb engine and Rails template compilation rbs RBS type signatures in sig/ reactivity Reactive ERB templates: diff and re-render only what changed ruby Ruby source for the gem and its libraries rubygem The herb RubyGem and its packaging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant