Repository navigation
fix(website): suppress aborted requests when switching playground targets - #125
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Sep 25, 2026
leonidaz
added a commit
that referenced
this pull request
Sep 26, 2026
…rs, and print JSX text from `raw` (#694, #693) (#711) * fix(core): write a `>` in text as `>`, read it as text in containers, and keep character references in plain JSX text (#694, #693) A `>` in template text compiled to a bare `>`, which esbuild, oxc, and TypeScript reject and vue-jsx-vapor compiles to nothing. The `JSXText` printer now writes `<`, `>`, `{`, and `}` as character references (`escape_jsx_text`), which JSX decodes back to the same characters. Braces reach it only from a raw-text `<script>` body, where they started an expression container. In an element in a `{…}` container, `jsx_readToken` read a `>` right after a tag as code, dropping the text before it, and after a child container reported TSX's error. A `>` is now text wherever template text is read, as it is outside a container. Text that acorn-typescript's JSX parser reads, in an element in a spread argument or an unbraced attribute value, had its character references decoded into `value`, so `{x}` compiled to the expression `{x}` and the formatter printed it decoded. `jsx_parseText` now keeps the source as `value`, as template text does. The editor's completion mapping for `@`-leading text now stops before the first escaped character, so it stays same-length and is found by its text. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): print JSX text from `raw`, and keep acorn's decoded `value` (#693, #710) The user decided #710: TSRX follows the JSX AST, where a `JSXText` node's `value` has its character references decoded and `raw` keeps the text as written, and printers print `raw`. So `jsx_parseText` no longer sets `value` to `raw`. Instead the `JSXText` printer, `wrap_edge_whitespace`, the editor's `@`-text completion mapping, and `@tsrx/prettier-plugin` read `raw`, and the printer escapes `<`, `>`, `{`, and `}` in it as before. A template text's `raw` spanned its comments, which `value` leaves out, so printing it would have printed them as text. Its `raw` now leaves them out too; the parser still reads its line breaks from the source it spans. Co-Authored-By: Claude Opus 5.5 <[email protected]> * style: format the runtime fixture Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This was referenced Sep 27, 2026
This branch was successfully 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.
Switching playground targets while compilation is pending can show “signal is aborted without reason”: the canceled request's error handler checks the controller for the replacement request, which has not been aborted.
Capture each request's controller and ignore failures from superseded requests. Invalidate pending compilation before validating input so clearing the editor or exceeding the source limit also prevents stale results from overwriting the current state.
Validation:
pnpm test --project website— 47 tests passed.pnpm --filter tsrx-website typecheck— passed.pnpm exec prettier --check website-tsrx/src/components/compiler-demo.tsrxandgit diff --check— passed.compile_sourceimplementation — seven scenarios passed, covering target-switch cancellation, stale responses, empty/oversized input, current network/compiler errors, and cleanup.No changeset: the private website is excluded from Changesets.
Note
Low Risk
Scoped to live-demo compile cancellation and error suppression in
compiler-demo.tsrx; no API or auth changes.Overview
Fixes spurious “signal is aborted without reason” (and similar) errors in the TSRX playground when a new compile supersedes an in-flight
/api/compilerequest—e.g. switching output targets while compilation is pending.compile_sourcenow bumpsrequest_idand aborts the previousAbortControllerimmediately, including before empty-source and max-length validation, so stale fetches cannot win after the editor is cleared or limited. Each run keeps a localcontrollerforfetch, and thecatchpath ignores failures whencurrent_request_id !== request_idor the request was aborted, instead of only checking the sharedactive_controller(which may already point at the replacement request).Reviewed by Cursor Bugbot for commit 437092e. Bugbot is set up for automated code reviews on this repo. Configure here.