Skip to content

chore: upgrade to TypeScript 6 - #11347

Open
erwanMarmelab wants to merge 9 commits into
nextfrom
feat/typescript-v7/main
Open

chore: upgrade to TypeScript 6#11347
erwanMarmelab wants to merge 9 commits into
nextfrom
feat/typescript-v7/main

Conversation

@erwanMarmelab

@erwanMarmelab erwanMarmelab commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Problem

TypeScript v6 is out, but RA is still on TypeScript v5.

Solution

Upgrade to TypeScript v6.

We deliberately choose not to upgrade to TypeScript V7 because the entire toolchain (eslint, VSCode) isn't yet ready to support it out of the box.

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature
  • The PR includes unit tests (if not possible, describe why)
  • The PR includes one or several stories (if not possible, describe why)
  • The documentation is up to date

@erwanMarmelab erwanMarmelab added the WIP Work In Progress label Aug 26, 2026
@erwanMarmelab erwanMarmelab changed the title chore: upgrade to TypeScript 7 chore: upgrade to TypeScript 6 Aug 27, 2026
@erwanMarmelab erwanMarmelab added RFR Ready For Review and removed WIP Work In Progress labels Aug 28, 2026
@fzaninotto

Copy link
Copy Markdown
Member

needs rebase...

- name: Build
run: make build
- name: Typecheck
run: make typecheck

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

make build already does the typecheck, so you're essentially doing it twice

@@ -1,6 +1,5 @@
{
"compilerOptions": {
"baseUrl": ".",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why did you remove this? It's required to make the demo run in a subpath

"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"skipLibCheck": true,
"strict": false,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is a mistake, the simple example should compile in strict mode

import Typography, { TypographyProps } from '@mui/material/Typography';
import { useFieldValue, useTranslate, genericMemo } from 'ra-core';
import purify from 'dompurify';
import purify, { type Config } from 'dompurify';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We prefer to split import lines int wo in this case:

import purify from 'dompurify';
import type { Config } from 'dompurify';

Because some bundlers simply drop the import type lines when compiling to JS.

Comment thread tsconfig.json
/* Basic Options */
"target": "ES2020" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */,
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
"module": "esnext" /* Specify module code generation. zshy overrides this per output format (commonjs for .cjs, esnext for .js). */,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why does this need changing if zshy overrides it?

Comment thread tsconfig.json

/* Strict Type-Checking Options */
// "strict": true /* Enable all strict type-checking options. */,
"strict": false /* TypeScript 6 defaults this to true. Kept off to preserve the current type surface; packages opt into strictNullChecks individually. */,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No, we want strict true everywhere

Comment thread yarn.lock
linkType: hard

"@rollup/pluginutils@npm:^5.0.1, @rollup/pluginutils@npm:^5.0.2, @rollup/pluginutils@npm:^5.3.0":
"@rollup/pluginutils@npm:^5.0.1, @rollup/pluginutils@npm:^5.3.0":

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't understand this change

Comment thread yarn.lock
languageName: node
linkType: hard

"react-dom@npm:^19.0.0":

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't understand this changes, which leads to a duplicate react in the repo

Comment thread yarn.lock
languageName: node
linkType: hard

"react@npm:^19.0.0":

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't understand this changes, which leads to a duplicate react in the repo

Comment thread yarn.lock
languageName: node
linkType: hard

"typescript@patch:typescript@npm%3A>=3 < 6#optional!builtin<compat/typescript>":

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

so we still bundle typescript 5?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RFR Ready For Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants