Repository navigation
fix(website): restore the spaces between words and inline code or links - #1105
Merged
Merged
Conversation
…ks (tsrx-org#481) The page sources separated words from `<code>`, `<a>` and string children with a line break only (`has\n<code>…</code>\nand`), or with nothing at all (`a<code>`, `,<code>`). Whitespace that contains a line break is layout in JSX, so the text read "TSRX no longer has&{ ... }and&[ ... ]." in every target. Most of these came from the old formatter turning a space between children into a line break (tsrx-org#402, fixed in tsrx-org#459). A codemod over the parsed TSRX AST put a space at each such boundary, except after an opening bracket or a slash (`(<code>`, `if</code>/<code>else`) and before closing punctuation or a plural suffix (`</code>.`, `</code>s`); one `@switch` `@case` pair got a `{' '}` by hand. Prettier then laid the paragraphs out again. 1,105 boundaries in 8 pages changed. Each page compiles, with the Ripple compiler the site uses, to the same output except for whitespace. Under JSX's whitespace rules (React, Preact, Solid, Vue), the glued word/inline-element boundaries go from 1,087 to 0. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jonkwheeler
marked this pull request as ready for review
October 26, 2026 19:57
1 task done
jonkwheeler
added a commit
that referenced
this pull request
Nov 14, 2026
…nd inline elements (#1337) * fix(website): build the site with a Ripple that keeps the spaces around inline elements #1105 restored the spaces between words and inline code or links in the website's sources, but the site still rendered most of them glued ("TSRX no longer has<code>&{ ... }</code>"): it builds with `@ripple-ts/vite-plugin` 0.4.0, which pins `@tsrx/ripple` 0.2.0, and that compiler drops a space at the edge of a multi-line text run. Ripple-TS/ripple #1608 fixed the trim in `@tsrx/ripple` 0.2.8. Move the Ripple packages the workspace builds with to the current release: `ripple`, `@ripple-ts/vite-plugin` and `@ripple-ts/adapter-node` 0.6.1, whose plugin uses `@tsrx/ripple` 0.2.11, and resolve the workspace's own `@tsrx/ripple` to 0.2.11 as well. The catalog range of `@tsrx/ripple` stays `^0.2.0`, so the optional peer range `@tsrx/typescript-plugin` publishes doesn't change. The release-age exclusions for the 0.4.0/0.2.0 releases go with them. Also put back the one space the sources still lacked, before `TSRX3014` in the specification (added by #1130 beside #1105). Fixes #481 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FRKmwAwuyPbGQ1ejNqiJ46
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
Website text now has the spaces around inline code, links and string children that the page sources had lost.
&{ ... }and&[ ... ]." The sources separated words from<code>,<a>and{'…'}children with only a line break (has\n<code>…</code>\nand) or with nothing (a<code>,,<code>). Whitespace that contains a line break is layout in JSX, so it rendered as nothing.&{ ... }and&[ ... ]." Every such boundary has a space, and Prettier lays the paragraphs out again. It writes{' '}where a line breaks at a significant space (fix(prettier): lay out template children like Prettier's TSX, put template values in parentheses like elements, keep significant spaces, and break attribute values like Prettier (#369, #402, #403, #376, #443, #447, #450, #457) #459).Root cause. In the sources, not in a helper. Under JSX's whitespace rules, which React, Preact, Solid and Vue apply,
word\n<code>has no space, so the sources were wrong for every target. Most of these boundaries came from the old formatter turning a space between children into a line break (#402, fixed in #459). The edit is a codemod over the parsed TSRX AST, not hand edits, so each boundary gets the same rule:<code>,<a>,<strong>,<em>,<kbd>or{'string'}child when only a line break, or nothing, separates them.(,[,{,/or-:(<code>,if</code>/<code>else.</code>.,</code>,,</code>s,</code>'s.@switch@casepair of code spans got a{' '}by hand.That is 1,105 boundaries in 8 pages.
A second cause, outside this repository. The site renders with Ripple, and Ripple's
get_template_text_value(@tsrx/ripple,src/template-ast.js, Ripple-TS/ripple) trims every text run that contains a line break:/[\r\n]/.test(value) ? value.trim() : value. JSX trims per line instead. So in Ripple, a space at the edge of a multi-line run is lost, for example the space after "has" in<p>\n TSRX no longer has <code>. JSX keeps it. Prettier normalizes{' '}before an element on the same line back to a plain space, so the sources can't work around it.Verification
mode: 'server') fromorigin/mainand from this branch, gives the same output once whitespace and style hashes are ignored. Only spaces change.blog-removing-lazy-destructuring.tsrx, under JSX's rules:TSRX no longer has<code>&{ ... }</code>and<code>&[ ... ]</code>. Destructuring…TSRX no longer has <code>&{ ... }</code> and <code>&[ ... ]</code>. Destructuring…TSRX no longer has<code>&{ ... }</code> and <code>&[ ... ]</code>.The first space is lost to the Ripple trim above.npx prettier --check website-tsrx/src,pnpm --filter tsrx-website typecheckandnpx vitest run --project website(47/47) pass. Two of four website runs here had one failing test (shiki-codemirror.test.tsin the run whose log was kept). That test checks Shiki highlighting in CodeMirror withvi.waitFor's 1s default and doesn't read the pages, so it looks like a separate flake under load.npx vitest run(all three of my branches merged locally, on a machine with load average 50-75 from parallel runs): 10,002 passed, 82 skipped, 10 failed. All 10 are "Test timed out in 5000ms" in projects this PR doesn't touch (content-mapper,typescript-plugin,tsrx-vue). Those three projects pass in full with--testTimeout=60000(1,284 passed, 15 skipped).pnpm typecheckis clean,pnpm changeset:checkpasses, and Prettier passes on the changed files.No changeset:
tsrx-websiteis in the Changesets ignore list, and this is a docs-only change.Related
Related: #481. This fixes the sources the issue describes and every JSX target. The live site also needs the Ripple trim fix above for the rest.
🤖 Generated with Claude Code
Note
Low Risk
Docs-only JSX whitespace in the marketing site; no product logic, auth, or data handling.
Overview
Fixes missing spaces in the TSRX marketing site copy where words ran into inline
<code>, links, and similar children (e.g.has<code>…</code>andinstead ofhas <code>…</code> and).The updates touch eight
website-tsrxpages (blog posts, features, getting started, home, blog index). Prose is reformatted so boundaries between text and inline elements use explicit spaces or{' '}where JSX would drop a newline-only gap—mostly fallout from Prettier line breaks (#459) and JSX whitespace rules, applied via an AST codemod per the PR description.No compiler, runtime, or API changes—only how documentation renders. Full spacing on the live Ripple-built site may still need a separate Ripple text-trim fix (#481).
Reviewed by Cursor Bugbot for commit 0d37b0d. Bugbot is set up for automated code reviews on this repo. Configure here.