chore: test against TypeScript 6#419
Conversation
Bump the workspace's TypeScript override and devDependency ranges from 5.9 to 6.0.3. No source changes are needed: the plugin's peer range already advertises ^6.0.0, tsserverlibrary still ships as the merged re-export shim, and all peers (rollup-plugin-dts, @gql.tada/internal, gql.tada) already allow TS 6. The one casualty was the e2e suites that asserted on the first automatically emitted semanticDiag event: TS 6's tsserver computes those diagnostics fast enough to consistently beat the plugin's asynchronous schema load, so the events arrived empty. Extract the geterr-polling helper the misconfiguration suite already used into util.ts as pollDiagnostics and use it everywhere diagnostics are asserted, instead of relying on spontaneous events. This also removes the long-standing intermittent flakiness of those suites on TS 5 and cuts the suite's runtime roughly in half, since polling resolves as soon as the schema is ready. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
On CI, module resolution settles slower than locally, and the first geterr rounds report transient TypeScript errors (2307 for imports of plugin-generated files) that disappear once project loading finishes. pollDiagnostics treated any non-empty diagnostics as ready, so the client-preset suite asserted on that transient state and failed. Require the settled state instead: at least one diagnostic and none below the plugin's 52001+ code range. Sites whose settled diagnostics legitimately include TypeScript errors (ts-expect-error fixture, documents without generated types) pass an explicit readiness check. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
What about Typescript 7 👀 |
|
@onionhammer as previously mentioned, we can't support this realistically. The plugin system of TSGo is currently a pie in the sky kind of thing. They have mentioned that they might pursue this for TS7.1. During that time TS won't be able to support Svelte/Vue/Volar/GraphQLSP and many others that rely on extending the TS semantics. They have advised people to stay on TS6 if you have this requirement. |
Summary
Follow-up to #417. Bumps the workspace to TypeScript 6.0.3 — the override in
pnpm-workspace.yamlplus the devDependency ranges. Verified: build passes and all 52/52 tests pass across three consecutive runs (re-verified after rebasing onto the merged #417).Zero source changes were needed. The plugin's peer range already advertises
^6.0.0,typescript/lib/tsserverlibrarystill ships as the merged re-export shim, and every peer in the tree (rollup-plugin-dts,@gql.tada/internal,gql.tada) already allows TS 6. No changeset: the published artifact is unchanged.Test hardening (the actual work)
TS 6's tsserver computes the automatically-emitted post-open diagnostics fast enough to consistently beat the plugin's asynchronous schema load, so e2e suites that asserted on the first spontaneous
semanticDiagevent received empty pre-schema diagnostics and failed. These suites were already intermittently flaky on TS 5 for exactly this reason — TS 6 just made the race deterministic-in-the-wrong-direction.The fix: the
geterr-polling helper the misconfiguration suite already used is extracted intotest/e2e/util.tsaspollDiagnostics(server, file, isReady?, attempts?), and every diagnostics assertion now polls until the plugin reports settled diagnostics instead of trusting the first spontaneous event. Nice side effects:Note for review
This drops TS 5.x from CI coverage (the override forces a single version workspace-wide). If you'd rather keep 5.x coverage, the alternative is a CI matrix that runs the e2e suite once per TS major — happy to do that as a follow-up.
🤖 Generated with Claude Code