Skip to content

fix(core): share generic-arrow and typed-default editor fixes - #89

Merged
leonidaz merged 1 commit into
mainfrom
fix/shared-editor-diagnostics
Sep 7, 2026
Merged

leonidaz merged 1 commit into
mainfrom
fix/shared-editor-diagnostics

Conversation

@leonidaz

@leonidaz leonidaz commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Move the two shared editor fixes currently carried in Octane’s @tsrx/core patch into their owning core package. Both failures reproduce through the React, Preact, Solid, and Vue tooling entry points on current main.

  • Valid generic arrows such as <Value extends { id: string }> and <Value = string> no longer report a false trailing-comma diagnostic. A bare <Value> still receives the existing diagnostic, and <Value,> remains accepted.
  • Destructuring defaults ending in a type assertion, such as items = EMPTY_ARRAY as string[], retain the full diagnostic mapping. This fixes No source map entry failures, including multiline defaults.

The mapping change only adds boundary locations to the tooling printer. Add an @tsrx/core patch changeset and reusable regression coverage in the existing shared source-mapping harness, which runs against all four target compilers. Octane can drop its local patch after consuming the resulting release; its compiler integration checks can remain downstream.

Validation

  • Before the fixes: 16 new cases fail across all four targets; 8 control cases pass.
  • After the fixes: all 24 new cases pass across React, Preact, Solid, and Vue.
  • Full pnpm test: 92 files passed; 4,021 tests passed, 33 skipped.
  • Production JavaScript and source maps are identical before/after for 12 cases across all four targets.
  • pnpm typecheck
  • Prettier check on all changed JavaScript files.
  • pnpm changeset:check, pnpm rules:check, and git diff --check.

Provenance

  • An agent produced this diff (agent-authored)

Note

Low Risk
Targeted parser and source-map printer tweaks with regression tests; no auth, data, or runtime behavior changes beyond editor diagnostics.

Overview
Fixes two shared @tsrx/core editor diagnostics that affect React, Preact, Solid, Vue, and other consumers of the Volar mapping pipeline.

Generic arrow functions: reportReservedArrowTypeParam now only suggests a trailing comma when a single type parameter is ambiguous (no extends constraint, no default, no trailing comma). Forms like <Value extends { id: string }>, <Value = string>, and <Value,> compile without a false trailing-comma error; bare <Value> still gets the existing diagnostic.

Typed destructuring defaults: The JSX tooling printer wraps AssignmentPattern nodes with location markers (alongside exports and property signatures), so defaults such as items = EMPTY_ARRAY as string[] keep a single diagnostic span through the type assertion instead of losing mapping or crashing with “No source map entry”.

Adds an @tsrx/core patch changeset and shared harness tests in source-mappings.js that run across all target compilers.

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

@vercel

vercel Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
tsrx-website Ready Ready Preview Sep 7, 2026 2:46am UTC
tsrx-website-mcp Ready Ready Preview Sep 7, 2026 2:46am UTC

Request Review

This branch was successfully deployed

2 active deployments
Preview – tsrx-website — ba61e65b Deployed Sep 7, 2026 by vercel[bot]
Preview – tsrx-website-mcp — ba61e65b Deployed Sep 7, 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