chore: upgrade to TypeScript 6 - #11347
Conversation
|
needs rebase... |
| - name: Build | ||
| run: make build | ||
| - name: Typecheck | ||
| run: make typecheck |
There was a problem hiding this comment.
make build already does the typecheck, so you're essentially doing it twice
| @@ -1,6 +1,5 @@ | |||
| { | |||
| "compilerOptions": { | |||
| "baseUrl": ".", | |||
There was a problem hiding this comment.
why did you remove this? It's required to make the demo run in a subpath
| "allowSyntheticDefaultImports": true, | ||
| "esModuleInterop": true, | ||
| "skipLibCheck": true, | ||
| "strict": false, |
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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.
| /* 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). */, |
There was a problem hiding this comment.
why does this need changing if zshy overrides it?
|
|
||
| /* 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. */, |
There was a problem hiding this comment.
No, we want strict true everywhere
| 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": |
There was a problem hiding this comment.
I don't understand this change
| languageName: node | ||
| linkType: hard | ||
|
|
||
| "react-dom@npm:^19.0.0": |
There was a problem hiding this comment.
I don't understand this changes, which leads to a duplicate react in the repo
| languageName: node | ||
| linkType: hard | ||
|
|
||
| "react@npm:^19.0.0": |
There was a problem hiding this comment.
I don't understand this changes, which leads to a duplicate react in the repo
| languageName: node | ||
| linkType: hard | ||
|
|
||
| "typescript@patch:typescript@npm%3A>=3 < 6#optional!builtin<compat/typescript>": |
There was a problem hiding this comment.
so we still bundle typescript 5?
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
masterfor a bugfix or a documentation fix, ornextfor a feature