Skip to content

chore: test against TypeScript 6#419

Open
JoviDeCroock wants to merge 2 commits into
mainfrom
JoviDeCroock/typescript-6
Open

chore: test against TypeScript 6#419
JoviDeCroock wants to merge 2 commits into
mainfrom
JoviDeCroock/typescript-6

Conversation

@JoviDeCroock

Copy link
Copy Markdown
Member

Summary

Follow-up to #417. Bumps the workspace to TypeScript 6.0.3 — the override in pnpm-workspace.yaml plus 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/tsserverlibrary still 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 semanticDiag event 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 into test/e2e/util.ts as pollDiagnostics(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:

  • the long-standing e2e flakiness is gone (three clean consecutive runs)
  • the suite runs in ~30s instead of ~60–90s, since polling resolves as soon as the schema is ready rather than waiting on tsserver's background emission cadence

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

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>
@changeset-bot

changeset-bot Bot commented Jul 5, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 18cb651

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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>
@onionhammer

Copy link
Copy Markdown

What about Typescript 7 👀

@JoviDeCroock

Copy link
Copy Markdown
Member Author

@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.

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.

2 participants