Skip to content

Document TSRX directive arm output semantics - #213

Merged
trueadm merged 2 commits into
mainfrom
codex/fix-js-02-directive-expression-arms
Jul 21, 2026
Merged

trueadm merged 2 commits into
mainfrom
codex/fix-js-02-directive-expression-arms

Conversation

@trueadm

@trueadm trueadm commented Jul 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • document that ordinary expression statements in TSRX directive arms are setup and do not render
  • show the explicit fragment form for rendering computed values from directive arms
  • replace the misleading parser-ticket note with a negative behavioral pin for the intentional contract

Design

Directive arms are code blocks with a setup/output split. A statement such as console.log(value); or value; remains setup even when it is the arm's only statement. Renderable output must be explicit JSX, for example <>{value}</>.

This clarifies JS-02 from #211 as intentional TSRX semantics. It does not change the compiler or runtime.

Validation

  • control.test.ts in normal and octane-prod modes: 18 tests passed
  • website documentation test: 11 tests passed
  • changeset validation passed; no changeset is required for docs/test-only changes
  • pnpm format:check passed

Note

Low Risk
User-facing documentation and regression tests only; no compiler or runtime logic appears in this diff.

Overview
Documents and pins TSRX directive-arm semantics: a lone expression statement inside @if, @for, @switch, @try, and related arms is setup only—it runs but does not render (e.g. console.log(value); or value;). To show a computed value, authors must use an explicit fragment such as <>{value}</>.

README control-flow section and TSRX vs TSX gain examples and scope across all directive variants. The WhitespaceInIf fixture drops the extra braces around ' spaced ' as string;, and the control test now expects an empty <p> when show is true while still proving stripTsOnlyWrappers keeps TypeScript assertions out of emitted JavaScript.

Reviewed by Cursor Bugbot for commit 344ecd9. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Jul 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
octane-website Ready Ready Preview, Comment Jul 21, 2026 9:42am
octane-website-mcp Ready Ready Preview, Comment Jul 21, 2026 9:42am

Request Review

@trueadm
trueadm marked this pull request as ready for review July 21, 2026 00:15
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 21, 2026 00:15 Inactive
@trueadm trueadm changed the title Fix expression-only TSRX directive arms Document TSRX directive arm output semantics Jul 21, 2026
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 21, 2026 09:42 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 21, 2026 09:42 Inactive
@trueadm
trueadm merged commit 28a08dc into main Jul 21, 2026
20 checks passed
@trueadm
trueadm deleted the codex/fix-js-02-directive-expression-arms branch July 21, 2026 09:46
mrdiyorbek-juraev added a commit to mrdiyorbek-juraev/octane that referenced this pull request Jul 21, 2026
Brings in 5 upstream commits: the safe inline-script content contract
(octanejs#215), the tanstack.com shell port (octanejs#214), the TSRX directive arm output
docs (octanejs#213), the inline hook-memo tier (octanejs#208), and the website menu /
scroll-spy work (octanejs#209). Upstream added three bindings
(tanstack-router-ssr-query, tanstack-hotkeys, tanstack-pacer), taking the
table to 39.

Six conflicts, all resolved as unions so neither side lost content:

- website/src/content/bindings.json — @octanejs/cmdk listed alongside
  upstream's three new bindings; the "UI and interaction" description
  keeps command menus and gains keyboard shortcuts and event pacing.
- website/public/llms.txt — same union in prose form.
- docs/bindings-status.md, docs/packages.md, docs/binding-parity-gaps.md
  and the evals user-apps-v1 manifest are generated, so they were taken
  from upstream and regenerated (39 bindings, 48 publishable packages,
  0 parity pins, 19 eval tasks).

packages/cmdk is byte-identical to its pre-merge state; upstream's
compiler changes do not perturb it. Verified: 32/32 cmdk and cmdk-ssr
tests including both differential parity checks against [email protected],
tsrx-tsc and tsgo clean, prettier clean, and all five freshness gates
current.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

This branch was previously deployed

2 inactive deployments
Preview – octane-website — 344ecd92 Deployed Jul 21, 2026 by vercel[bot]
Preview – octane-website-mcp — 344ecd92 Deployed Jul 21, 2026 by vercel[bot]
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