Repository navigation
Define a safe inline script content contract - #215
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
trueadm
marked this pull request as ready for review
July 21, 2026 11:54
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 164e218. Configure here.
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]>
Closed
This branch was previously 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.

Summary
<script>...</script>bodies as static script data, with braces kept as literal JavaScript/JSON sourcedangerouslySetInnerHTML={{ __html: ... }}as the supported dynamic whole-script pathapplication/json, and speculation rulesAddresses JS-01 from #211 only.
Root cause
The current
@tsrx/coreparser exposes a complete script body as verbatim raw text rather than expression AST nodes. Octane therefore cannot safely recover an authored JSX expression from braces, which are also valid JavaScript syntax. In addition, static script data was passing through generic HTML text escaping even though HTML entities are not decoded in the script-data state.This change makes that parser boundary an explicit language contract instead of attempting ambiguous regex recovery. Dynamic values use the existing attribute expression AST retained by
dangerouslySetInnerHTML; client writes usetextContent, while server output applies whole-script token neutralization. Hydration compares against the browser-normalized server spelling, including CRLF/CR normalization.Validation
./node_modules/.bin/tsgo --noEmit -p packages/octane/tsconfig.jsonpnpm --config.minimum-release-age=0 format:checkpnpm --config.minimum-release-age=0 changeset:checkgit diff --checkNo dependency or lockfile changes.
Note
Medium Risk
Touches compiler SSR/client emission and hydration comparison for script elements—security-sensitive HTML boundary behavior—but changes are narrowly scoped with extensive regression tests and fail-closed validation.
Overview
Defines how
<script>bodies work in Octane: authored content is verbatim script data (braces stay literal JS/JSON, not TSRX interpolation), withdangerouslySetInnerHTMLas the supported path for dynamic whole-script values. README documents static vs dynamic usage and the security boundary (token neutralization, not JS sanitization).The compiler threads
@tsrx/core’selement.contentthrough normalization, SSR/client templates, and de-optcreateElementpaths: static bodies skip generic HTML escaping, only neutralize case-insensitive</script/<scripttokens, and apply script-data line/NUL normalization so client and SSR spellings match.dangerouslySetInnerHTMLvs children validation treats non-empty static script bodies (including whitespace-only) as real content.Server joins primitive-only descriptor children before escaping so breakout tokens cannot straddle fragments. Client hydration for script
dangerouslySetInnerHTMLcompares against the same escaped + normalized spelling the browser parsed from SSR, avoiding false mismatches while updates still usetextContent.Adds a patch changeset,
loadCompiledFixtureSourcefor client/server compile tests, fixtures, and a broad regression suite (executable, JSON, speculation rules, static boundaries, hydration).Reviewed by Cursor Bugbot for commit 2610780. Bugbot is set up for automated code reviews on this repo. Configure here.