# TypeScript 5.0 Impacts on Vue & Vite Ecosystem https://devblogs.microsoft.com/typescript/announcing-typescript-5-0-beta/ ## TSConfig array extends We'll make use of this. Some possible improvements: - Separate Vue-specific compiler options and strictness-related compiler options. - Rethink how to target different runtimes, i.e., browser, node, etc., with minimum configurations. Currently we extends from the base configuration, in the future we can just add a new entry without extending. - Make some magical improvements to the type-checking performance of a project. * Need to investigate if `--declaration` slows down build, so that we can decide whether to put `declaration` in the config or the command line ## `--moduleResolution bundler` - replace the good old `node` option. - `resolvePackageJsonExports` is default on under `moduleResolution: bundler`, so we need `publint` in all our library projects. - `--moduleResolution bundler` does not support resolution of `require` calls. In TypeScript files, this means the `import mod = require("foo”)` syntax is forbidden * Will this affect how we bundle the config files with esbuild? ## `--verbatimModuleSyntax` - We **have to** migrate to it because the old ones would be dropped after 5.5 - Note: this option implies `isolatesModules` (and may supersede it, per the proposal issue), no big deal for Vite, but might affect `vuejs/core`. - Caveat: `import { writeFile } from "fs”` not allowed in `--module commonjs` https://github.com/microsoft/TypeScript/issues/51479 Would be a small surprise to many users ## `allowArbitraryExtensions` + `node16/nodenext` - `app.vue.d.ts` no longer works, need `app.d.vue.ts`, a big headache for SSR users We also need a versioning strategy for `@vue/tsconfig` because we are going to introduce backwards-incompatible compiler options. ## Timeline: https://github.com/microsoft/TypeScript/issues/51362 | February 28th | TypeScript 5.0 RC Release | | ------------- | --------------------------- | | March 14th | TypeScript 5.0 Final Release 🚀 | ## One more thing On the `esm-bundler` entry of `vue`: https://arethetypeswrong.github.io/ https://twitter.com/atcb/status/1619881540628127744