Title: Typescript pulls entire MUI library - super slow type checking · Issue #25085 · microsoft/TypeScript · GitHub
Open Graph Title: Typescript pulls entire MUI library - super slow type checking · Issue #25085 · microsoft/TypeScript
X Title: Typescript pulls entire MUI library - super slow type checking · Issue #25085 · microsoft/TypeScript
Description: TypeScript Version: 2.9.2 Search Terms: MUI slow typescript TSC compiles all MUI files Code In a react project, I use the UI library MUI (1.0). In total, I'm doing around 15 imports of this library, always in the following way: import Ci...
Open Graph Description: TypeScript Version: 2.9.2 Search Terms: MUI slow typescript TSC compiles all MUI files Code In a react project, I use the UI library MUI (1.0). In total, I'm doing around 15 imports of this library...
X Description: TypeScript Version: 2.9.2 Search Terms: MUI slow typescript TSC compiles all MUI files Code In a react project, I use the UI library MUI (1.0). In total, I'm doing around 15 imports of this lib...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/25085
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Typescript pulls entire MUI library - super slow type checking","articleBody":"\u003c!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨\r\n\r\nHalf of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common \"Bugs\" That Aren't Bugs section!\r\n\r\nPlease help us by doing the following steps before logging an issue:\r\n * Search: https://github.com/Microsoft/TypeScript/search?type=Issues\r\n * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ\r\n\r\nPlease fill in the *entire* template below.\r\n-->\r\n\r\n\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:** 2.9.2\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:** \r\nMUI slow typescript\r\nTSC compiles all MUI files\r\n\r\n**Code**\r\n\r\nIn a react project, I use the UI library MUI (1.0).\r\nIn total, I'm doing around 15 imports of this library, always in the following way:\r\n`import CircularProgress from '@material-ui/core/CircularProgress/CircularProgress';`\r\n\r\ntsconfig.json\r\n```json\r\n{\r\n \"compilerOptions\": {\r\n \"baseUrl\": \"./src\",\r\n \"outDir\": \"build/dist\",\r\n \"target\": \"es5\",\r\n \"lib\": [\"es6\", \"es7\", \"dom\"],\r\n \"sourceMap\": true,\r\n \"allowJs\": false,\r\n \"jsx\": \"react\",\r\n \"esModuleInterop\": true,\r\n \"skipLibCheck\": true,\r\n \"moduleResolution\": \"node\",\r\n \"allowSyntheticDefaultImports\": true,\r\n \"rootDir\": \"./src\",\r\n \"noEmitOnError\": false,\r\n \"isolatedModules\": true,\r\n \"strictPropertyInitialization\": false,\r\n \"forceConsistentCasingInFileNames\": true,\r\n \"noFallthroughCasesInSwitch\": true,\r\n \"noErrorTruncation\": true,\r\n \"noImplicitReturns\": true,\r\n \"noImplicitAny\": true,\r\n \"noImplicitThis\": true,\r\n \"strictNullChecks\": true,\r\n \"diagnostics\": true,\r\n \"suppressImplicitAnyIndexErrors\": true,\r\n \"noUnusedLocals\": true\r\n },\r\n \"include\": [\r\n \"src/**/*\"\r\n ],\r\n \"exclude\": [\r\n \"dist\",\r\n \"build\",\r\n \"node_modules\",\r\n \"src/**/__tests__\"\r\n ],\r\n \"defaultSeverity\": \"warning\"\r\n}\r\n```\r\n**Expected behavior:**\r\nTS picks up only the type definitions it needs from that library. (around 20 files, as I counted)\r\nCode compiles in 3-6 seconds, if I remove MUI (with lots of errors, certainly)\r\n\r\n\r\n**Actual behavior:** \r\nTS pulls the entire MUI library, with over 600.000 types\r\nCompilation (type checking) usually takes >1min\r\n\r\n`tsc --extendedDiagnostics --listFiles --noEmit`\r\n\r\n\r\nand it goes on...\r\n\r\nI would expect this to happen if I was importing from the `core` modules, which exports all types, but I am most definitely not.\r\n\r\n**Related Issues:** \u003c!-- Did you find other bugs that looked similar? -->\r\nNo :( I found other cases of slow compilation, but not of this sort.\r\n","author":{"url":"https://github.com/rpmonteiro","@type":"Person","name":"rpmonteiro"},"datePublished":"2018-06-20T08:11:31Z","url":"https://github.com/microsoft/TypeScript/issues/25085"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c6b4b10d-9c6d-003b-28e9-4c575b6163e3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BB96:399E4B:E42C5B:12FDBCA:6B01026C |
| html-safe-nonce | de84b341468c2b259abb0087bee38979e8d1937fe281a7eb2f7133a1a8ce11f2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjk2OjM5OUU0QjpFNDJDNUI6MTJGREJDQTo2QjAxMDI2QyIsInZpc2l0b3JfaWQiOiI4MDg3NTgyMDI0NzE1NTM0OTU2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 59bbb9651d68723e558de40af07f96e624f1932928a38181c2b09782558a9858 |
| hovercard-subject-tag | issue:333968424 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/25085/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1384c588d7d2f075c503b81a7349c8038dc245a7aec13207eaaace1e9cec5dcd/microsoft/TypeScript/issues/25085 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1384c588d7d2f075c503b81a7349c8038dc245a7aec13207eaaace1e9cec5dcd/microsoft/TypeScript/issues/25085 |
| og:image:alt | TypeScript Version: 2.9.2 Search Terms: MUI slow typescript TSC compiles all MUI files Code In a react project, I use the UI library MUI (1.0). In total, I'm doing around 15 imports of this library... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rpmonteiro |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width