Ship a TypeScript 7.1 content mapper for .rx, so tsgo/tsrs check .rx in one pass
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- node.js, typescript
调研方向
Read notes/contentmappers.md and the sample at testdata/contentmapper/header-mapper/mapper.mjs to understand the protocol, then inspect the crate’s existing TSX projection and checker diagnostics mentioned in the issue. Determine how a wrapper can expose those outputs through initialize, openProject, transform, and closeProject; done means TS 7.1 and tsrs report both TypeScript and checker diagnostics for .rx in one pass.
由索引模型根据 Issue 内容生成。
描述
Proposal
Ship a TypeScript 7.1 content mapper for .rx, beside (or eventually instead of) the Volar language plugin.
Why
rx-tsc and the language server run on Volar over TypeScript's JS API (typescript 6.x). TypeScript 7 (the Go compiler) has no plugin API of that kind. Projects that have moved their type checking to TS 7 or tsrs (the Rust port, which also hosts oxlint's type-aware rules) are left with two problems:
- They must run a second, slower checker just for
.rx. - Their editor's TS 7 language server doesn't know
.rxexists.
TypeScript 7.1 defines the extension point for this: content mappers. Here is how it works:
- A tsconfig declares
"contentMappers": [{ "package": "…", "extensions": [".rx"] }], and the package'spackage.jsonnames an executable undertypescript.contentMapper.exec. - The compiler spawns that executable with
--runExternalCodeand talks JSON-RPC over stdio. The methods areinitialize,openProject,transformandcloseProject. transformreturns{ text, extension: ".tsx", mappings: [[virtualStart, virtualLength, originalStart, originalLength, kind]], diagnostics }.
The compiler checks the virtual file as part of the program. It reports type errors at the original positions, and reports the mapper's own diagnostics as well.
tsrs implements this in the compiler, -b/incremental builds, the language server, the Node API and its linter. References: notes/contentmappers.md, and the ~80-line sample mapper in testdata/contentmapper/header-mapper/mapper.mjs.
Why it fits .rx well
The crate already produces everything transform needs:
- the TSX projection with exact mappings onto the
.rx(spec/11 CP-8c, spec/13 TY-1c,rxc project); - its own checker diagnostics with ranges, which map onto the mapper's
diagnostics.
So tsc -p, tsgo and tsrs -p would report TypeScript errors and checker errors for .rx in one pass, with no Volar in between. A small Node (or native) wrapper around the existing analysis would be enough. The Volar plugin can stay for TS 6 editors.
Context
We tried 0.3.1 in a Solid 2 app whose type checking runs on tsrs. rx-tsc works (it places TS errors on .rx correctly), but only as a separate pass on TypeScript 6.
- 主要语言
- TypeScript
- 星标
- 127
- 派生
- 7
- 平均合并
- 15 小时 42 分钟
- 30 天内合并 PR
- 63
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
solidjs/reactivescript 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
solidjs/reactivescript#96 ·
维护者通常 1 天内回复
-
Vite front end keeps serving a failed build after the missing/broken imported module is fixed可能已有人在做 @cgaaf 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 77/100
solidjs/reactivescript#84 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
solidjs/reactivescript#77 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
solidjs/reactivescript#74 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 62/100
solidjs/reactivescript#97 ·
维护者通常 1 天内回复
查看 solidjs/reactivescript 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
GetStream/stream-chat-react#3467 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
vercel-labs/ui#1139 ·
维护者通常 1 天内回复
-
generate_image reference URL guard lets through IPv4-mapped IPv6 hosts and 100.64.0.0/10可能已有人在做 @goranai 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
bot:ai-assisted component:platform-js status:untriaged
难度 2/5 1-3 小时 新手友好度 82/100
midnightntwrk/platform-js#93 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100