Running tsc takes 10x longer to run, VS Code becomed slow and unresponsive when working on the project, lag, pending code actions from ESLint, and TypeScript actions on save.
🙂 Expected behavior
Given this project is very small, running tsc takes about 1 second and VSCode is snappy.
Bug Report
I created mini-jsx, a tiny library for creating native DOM nodes using JSX syntax, written in TypeScript.
Since I changed the code to define a classic runtime to an automatic runtime, TypeScript is 10x slower when run inside the project.
To try it, clone and setup the project:
Run
tsc
and notice it takes a long time. Also opening it in VS Code will make the editor unresponsive.Now switch to the branch before the automatic runtime was introduced, and notice everything works fine:
🔎 Search Terms
jsxImportSource
jsx import source
jsx automatic runtime
🕗 Version & Regression Information
The issue has existed from the moment support for the automatic runtime was added in TypeScript 4.1, and still exists in version 4.2.x.
⏯ Playground Link
The playground doesn’t offer the options needed to show the problem.
💻 Code
jsx-runtime.ts
jsx-runtime.test.ts
🙁 Actual behavior
Running
tsc
takes 10x longer to run, VS Code becomed slow and unresponsive when working on the project, lag, pending code actions from ESLint, and TypeScript actions on save.🙂 Expected behavior
Given this project is very small, running
tsc
takes about 1 second and VSCode is snappy.