Skip to content

feat: update TypeScript support to 5.8 - 6.0 - #18332

Merged
WikiRik merged 4 commits into
mainfrom
WikiRik/typescript-6
Sep 11, 2026
Merged

WikiRik merged 4 commits into
mainfrom
WikiRik/typescript-6

Conversation

@WikiRik

@WikiRik WikiRik commented Sep 3, 2026 •

Copy link
Copy Markdown
Member

Pull Request Checklist

  • Have you added new tests to prevent regressions?
  • If a documentation update is necessary, have you opened a PR to the documentation repository?
  • Did you update the typescript typings accordingly (if applicable)?
  • Does the description below contain a link to an existing issue or a description of the issue you are solving?
  • Does the name of your PR follow our conventions?

Description of Changes

Top of the stack, stacked on #18331.

Moves the supported TypeScript range up from 5.5–5.8 to 5.8, 5.9 and 6.0, and builds on 6.0.2.

ConstraintChecking had to be restructured

TypeScript 6.0 rejects ConstraintChecking.DEFERRED and IMMEDIATE as they were written:

src/deferrable.ts(67,19): error TS4094: Property '#constraints' of exported
anonymous class type may not be private or protected.

Both were class expressions passed straight to classToInvokable inside a static property initializer, so the type they produce has no name to refer to, and a private field cannot be described in the emitted declarations without one. They now have named declarations outside the class body, with the static accessors kept as the documented entry points — which preserves both the class names and the descriptions the generated docs point at.

One observable side effect: DEFERRED and IMMEDIATE become static accessors rather than enumerable data properties, so they no longer appear in Object.keys(ConstraintChecking) or a spread of it. Both are still reached the same way.

cls.test.ts also gains an explicit declare id: CreationOptional<number>, which 6.0 needs to infer the model's creation attributes.

This is the one non-mechanical change in the PR, so it is covered by new unit tests in packages/core/test/unit/deferrable.test.ts: accessor identity, name preservation, construction with and without new, frozen constraints, and isEqual (including that DEFERRED and IMMEDIATE are never equal to each other).

Everything else is mechanical

The @ts-ignore comments that newer compilers no longer need are dropped, and the two in the data types test become @ts-expect-error — which is what their own comments said they were waiting to be:

// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error -- error only appears in TS 5.5+
// @ts-ignore -- intentionally testing invalid input

Ordering

TypeDoc had to reach 0.28 first (#18331); 0.27 refuses to run on TypeScript 6.0 and docs is a required CI job.

Verification

yarn build, yarn test-unit (2220 passing), yarn test-typings across all 13 projects, and yarn docs with no warnings — all on TypeScript 6.0.2.


🤖 Generated with Claude Code

https://claude.ai/code/session_01EgPPfqYYk6PFGbanp5mAFh

Summary by CodeRabbit

  • Compatibility

    • Added TypeScript 5.9 and 6.0 to typing validation alongside TypeScript 5.8.
    • Updated the development toolchain to TypeScript 6.0.2.
  • Bug Fixes

    • Improved consistency and reliability of constraint-checking behavior while preserving existing functionality.
  • Tests

    • Added coverage for deferred and immediate constraint-checking behavior, including equality, immutability, and construction scenarios.

@coderabbitai

coderabbitai Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 1804a2b7-93a2-4f55-b42f-18e724aed177

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: acdc379c-3c84-4223-b4a6-5214dfa6f65b

📥 Commits

Reviewing files that changed from the base of the PR and between 73d63b9 and 9f1370f.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • package.json

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The pull request expands TypeScript CI coverage, upgrades the development compiler to TypeScript 6.0.2, removes obsolete suppressions, and refactors ConstraintChecking implementations into named subclasses with expanded tests.

Changes

TypeScript compatibility and constraint checking

Layer / File(s) Summary
TypeScript 6 compatibility updates
.github/workflows/ci.yml, package.json, packages/core/src/decorators/shared/model.ts, packages/core/src/model-definition.ts, packages/core/test/integration/cls.test.ts, packages/core/test/integration/data-types/data-types.test.ts
The development compiler changes to TypeScript 6.0.2. Typing CI adds TypeScript 5.9 and 6.0. Obsolete @ts-ignore directives are removed, and invalid-input tests use @ts-expect-error.
Constraint checking class refactor
packages/core/src/deferrable.ts, packages/core/test/unit/deferrable.test.ts
DEFERRED and IMMEDIATE use static getters that return named top-level subclasses. Tests cover construction, inheritance, constraints, equality, and base-class behavior.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 9f137

The TypeScript support update and constraint-checking refactor are ready to merge.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the primary change: updating TypeScript support to versions 5.8 through 6.0.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 4…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch WikiRik/typescript-6

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@WikiRik
WikiRik force-pushed the WikiRik/typedoc-all-packages branch from 04bd9ba to 0b1b706 Compare September 3, 2026 12:47
@WikiRik
WikiRik force-pushed the WikiRik/typescript-6 branch 2 times, most recently from 7b11666 to e223edd Compare September 3, 2026 13:13
@WikiRik
WikiRik force-pushed the WikiRik/typedoc-all-packages branch from 0b1b706 to 7ba51de Compare September 3, 2026 13:13
@WikiRik
WikiRik force-pushed the WikiRik/typescript-6 branch from e223edd to 44cda1a Compare September 3, 2026 16:33
@WikiRik
WikiRik force-pushed the WikiRik/typedoc-all-packages branch 2 times, most recently from 29e1c8d to 92e4bc1 Compare September 3, 2026 17:53
@WikiRik
WikiRik force-pushed the WikiRik/typescript-6 branch from 44cda1a to 5a0b25c Compare September 3, 2026 17:53
@WikiRik
WikiRik force-pushed the WikiRik/typedoc-all-packages branch from 92e4bc1 to 70a18e0 Compare September 3, 2026 20:14
@WikiRik
WikiRik force-pushed the WikiRik/typescript-6 branch from 5a0b25c to a74d1e6 Compare September 3, 2026 20:14
Comment thread packages/core/src/deferrable.ts Resolved
Comment thread packages/core/src/deferrable.ts Resolved
@WikiRik
WikiRik marked this pull request as ready for review September 3, 2026 20:18
@WikiRik
WikiRik requested a review from a team as a code owner September 3, 2026 20:18
@WikiRik
WikiRik requested review from ephys and sdepold September 3, 2026 20:18
@WikiRik
WikiRik force-pushed the WikiRik/typedoc-all-packages branch from 70a18e0 to a2f6e3c Compare September 3, 2026 20:18
@WikiRik
WikiRik force-pushed the WikiRik/typescript-6 branch from 09453a2 to bb3309c Compare September 3, 2026 20:18
@WikiRik
WikiRik requested a review from SippieCup September 3, 2026 20:18
Base automatically changed from WikiRik/typedoc-all-packages to main September 7, 2026 05:58
Rik Smale and others added 2 commits September 7, 2026 07:58
Move the supported range up to 5.8, 5.9 and 6.0, and build on 6.0.2.

TypeScript 6.0 rejects `ConstraintChecking.DEFERRED` and `IMMEDIATE` as they
were written, with "Property '#constraints' of exported anonymous class type may
not be private or protected" (TS4094). Both were class expressions passed
straight to `classToInvokable` inside a static property initializer, so the type
they produce has no name to refer to, and a private field cannot be described in
the emitted declarations without one. Give them named declarations outside the
class body and keep the static accessors as the documented entry points, so the
class names, and the descriptions the documentation points at, are preserved.

Note that this turns `DEFERRED` and `IMMEDIATE` from enumerable static data
properties into accessors, so they no longer show up in `Object.keys` or a
spread of `ConstraintChecking`. Both are still reached the same way.

Cover the two with unit tests in `packages/core/test/unit/deferrable.test.ts`:
accessor identity, name preservation, construction with and without `new`,
frozen constraints, and `isEqual`, including that the two are never equal to
each other.

Drop the `@ts-ignore` comments that newer compilers no longer need, and turn the
two in the data types test into `@ts-expect-error`, which is what they were
waiting to become. The CLS test gains an explicit `id` declaration, which 6.0
needs to infer the model's creation attributes.

TypeDoc must have moved to 0.28 first; 0.27 refuses to run on TypeScript 6.0.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01EgPPfqYYk6PFGbanp5mAFh
@WikiRik
WikiRik force-pushed the WikiRik/typescript-6 branch from bb3309c to 73d63b9 Compare September 7, 2026 05:58
@WikiRik
WikiRik removed this pull request from stack #18333 September 11, 2026 20:19
@WikiRik
WikiRik enabled auto-merge (squash) September 11, 2026 20:19

@SippieCup SippieCup left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@WikiRik
WikiRik merged commit 781e922 into main Sep 11, 2026
76 checks passed
@WikiRik
WikiRik deleted the WikiRik/typescript-6 branch September 11, 2026 21:56
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