Repository navigation
fix(tsrx): patch @tsrx/core to map TS parameter properties and bodyless methods - #1276
Merged
Merged
Conversation
…ss methods tsrx-tsc threw "Unhandled AST node type in mapping walker" on constructor parameter properties (TSParameterProperty) and bodyless class methods (TSDeclareMethod: overloads, abstract, optional), fell back to raw text, and reported bogus TS1144/TS1005/TS1128. The printer also dropped `override` on parameter properties. Carry the upstream fix (tsrx-org/tsrx#143) as a pnpm patch until a release ships it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm
marked this pull request as ready for review
September 23, 2026 08:51
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
@tsrx/[email protected]. With it,tsrx-tsctype-checks.tsrxfiles that use TypeScript constructor parameter properties or bodyless class methods.Why
pnpm typecheck:filesfailed on any.tsrxfile with, for example,constructor(private readonly start: number, public step = 1) {}. tsrx-tsc loggedUnhandled AST node type in mapping walker: TSParameterProperty, fell back to raw text, and reported bogus TS1144/TS1005/TS1128.TSDeclareMethodfailing the same way. The parser emits it for overload signatures (including constructor overloads),abstract m(): T;, and optionalm?(): T;. Abstract properties,accessorfields, and index signatures already worked. The parser never emitsTSAbstract*node types.overrideon parameter properties, soconstructor(override readonly n: number)failed with TS4115 undernoImplicitOverride.@tsrx/coreis published from tsrx-org/tsrx, and itsmain(0.2.4) still has both bugs. The upstream fix is fix(core): map TS parameter properties and bodyless class methods tsrx-org/tsrx#143. This patch should be dropped once a release containing it is adopted.Changes
patches/@[email protected]and thepnpm-workspace.yamlpatchedDependenciesentry, with a removal note.pnpm-lock.yaml: only the@tsrx/corepatch-hash changes.pnpm patch-commitalso pruned ~1,900 unrelated orphan lines, so I rebuilt the lockfile without that churn.pnpm install --frozen-lockfileaccepts it.packages/octane/tests/compiler/volar.test.ts: new regression test. It compiles a.tsrxfile with parameter properties,override, abstract members, overloads, and an optional method. It asserts that parameter names map back to source and that the virtual TSX has zero diagnostics understrictandnoImplicitOverride. Without the patch it fails with the original walker error.pnpm sync.Validation
pnpm format:checkpnpm typecheckpnpm test: not run in full.packages/octane/tests/compiler/volar.test.ts(30/30 pass). The new test fails against unpatched@tsrx/core.pnpm typecheck:fileson the original repro plus overload, abstract, and optional-method shapes is clean, and a planted TS2322 is reported on the correct line.Risk / follow-ups
tsrx-tscand editor mappings. Published packages ship.tsrxsource and are unaffected, so there is no changeset.@tsrx/coreincludes the fix, parameter-property coverage for the in-progress TypeScript runtime-lowering work can move from compiled source strings into checked.tsrxfixtures.@dec() x). That only matters with legacyexperimentalDecoratorsand is not addressed here.Provenance
agent-authored)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Low Risk
Tooling-only change to local
@tsrx/corepatching and audit/eval hash metadata; no runtime package behavior change for published Octane consumers.Overview
Adds a pnpm patch on
@tsrx/[email protected](upstream tsrx-org/tsrx#143) so the TSRX→virtual TSX mapping walker handles constructor parameter properties and bodyless methods (TSParameterProperty,TSDeclareMethod), including preservingoverrideon parameters fornoImplicitOverride. That stopstsrx-tsc/editor tooling from falling back to raw text and emitting bogus parse errors on real.tsrxclass syntax.A new
volar.test.tsregression compiles a fixture with parameter properties, abstract/optional/overloaded members, checks source mappings, and asserts zero TypeScript diagnostics on the generated TSX.Lockfile-driven metadata is refreshed everywhere it is pinned:
lockfileSha256in packageaudit/react-parity.jsonfiles andoverlayLockfileHashon user-apps-v1 eval manifest rows (same new workspace lock hash).Reviewed by Cursor Bugbot for commit 9610af5. Bugbot is set up for automated code reviews on this repo. Configure here.