Repository navigation
Description
Problem
#407 (TypeScript 6 upgrade) is blocked on a new antlr4 release, and that release may not come.
Why upgrade TypeScript at all
This is a maintenance upgrade. Consumers are unaffected by which TypeScript version we compile with, and build speed is not a factor (type-checking takes under a second per package). The reasons are:
- our current
moduleResolution: "node"is deprecated in TypeScript 6 and removed in TypeScript 7, which is now the defaultnpminstall; - our examples and templates should work with current TypeScript;
- delaying makes the migration larger.
Is ANTLR still maintained, and what does that mean for us
ANTLR 4 looks dormant rather than actively maintained:
- The latest release is
4.13.2(Aug 2024). Requests for a new release, including one for a CVE, are open with no timeline (Are there plans for a new release? antlr/antlr4#4940, CVE-2026-13500 Resolution antlr/antlr4#4952). - Commits to the repo dropped from 243 in 2023 to 60 in 2024, 22 in 2025 and 3 so far in 2026.
- The typings fix we are waiting for (- Typescript runtime: adding .js to imports in d.ts files antlr/antlr4#4826) was merged in Feb 2026 but never released.
- Upstream's own TypeScript runtime tests are pinned to TypeScript 5.
For us this is a slow risk, not an urgent one. Our grammar changes rarely and the runtime itself is stable and works. What we lose is the ability to get fixes: typings problems, security reports and future TypeScript incompatibilities will have to be worked around on our side. We should stop treating "wait for upstream" as a plan.
The active TypeScript work has moved to the antlr-ng project (antlr4ng runtime). It is largely a single-maintainer effort, so it is a more active dependency but not obviously a safer one.
What breaks today
- For us: with
moduleResolution: "nodenext", theantlr4typings fail to resolve their own directory imports, givingTS2305: Module '"antlr4"' has no exported member 'ErrorListener'(alsoParseTreeVisitor,ParserRuleContext,TerminalNode,ATN).skipLibCheckdoes not help. Same on TS 6.0.3 and 7.0.2. - For consumers: projects using
nodenextwithskipLibCheck: falseget 70 type errors fromantlr4's typings viacashc's public types. This happens on TS 5.9 too and is not fixed by upgrading our compiler.
Options
- Use
moduleResolution: "bundler"and keepantlr4@4.13.2. Works on TS 6 and 7 in a minimal repro. Downsides: no compiler enforcement of.jsextensions on relative imports, and it does not fix the consumer problem. - Patch the
antlr4typings (yarn patch/patch-package) with the upstream fix. Upstreamdevstill has a broken../state.jsimport, so it only passes withskipLibCheck: true. A local patch does not reach consumers. - Migrate to
antlr4ng. Compiles cleanly undernodenexton TS 6 and 7 with full lib checking, and would fix the consumer problem. Requires regenerating the parser and adaptingAstBuilder, the error listeners andLocationto API differences. - Wait for upstream. No timeline.
Proposal
Do option 1 now to unblock #407, and use this issue to evaluate option 3 as the longer-term path.
Commit counts are from the GitHub API as of 2026-11-29. The repro results are from a scratch project, not from the #407 branch.
Activity
chore: replace ESLint with oxlint and add oxfmt
chore: replace ESLint with oxlint and add oxfmt