Title: flag to customize type instantiation depth limit · Issue #46180 · microsoft/TypeScript · GitHub
Open Graph Title: flag to customize type instantiation depth limit · Issue #46180 · microsoft/TypeScript
X Title: flag to customize type instantiation depth limit · Issue #46180 · microsoft/TypeScript
Description: Suggestion 🔍 Search Terms customize type instantiation depth limit ✅ Viability Checklist My suggestion meets these guidelines: This wouldn't be a breaking change in existing TypeScript/JavaScript code This wouldn't change the runtime beh...
Open Graph Description: Suggestion 🔍 Search Terms customize type instantiation depth limit ✅ Viability Checklist My suggestion meets these guidelines: This wouldn't be a breaking change in existing TypeScript/JavaScript c...
X Description: Suggestion 🔍 Search Terms customize type instantiation depth limit ✅ Viability Checklist My suggestion meets these guidelines: This wouldn't be a breaking change in existing TypeScript/JavaScri...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/46180
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"flag to customize type instantiation depth limit","articleBody":"# Suggestion\r\n\r\n\u003c!--\r\n Please fill in each section completely. Thank you!\r\n-->\r\n\r\n## 🔍 Search Terms\r\ncustomize type instantiation depth limit\r\n## ✅ Viability Checklist\r\n\r\n\u003c!--\r\n Suggestions that don't meet all these criteria are very, very unlikely to be accepted.\r\n We always recommend reviewing the TypeScript design goals before investing time writing\r\n a proposal for ideas outside the scope of the project.\r\n-->\r\nMy suggestion meets these guidelines:\r\n\r\n* [X] This wouldn't be a breaking change in existing TypeScript/JavaScript code\r\n* [X] This wouldn't change the runtime behavior of existing JavaScript code\r\n* [X] This could be implemented without emitting different JS based on the types of the expressions\r\n* [X] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)\r\n* [X] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).\r\n\r\n\r\n## ⭐ Suggestion\r\n\r\nit seems that the type instantiation depth limit changes quite often (most recently in #45711). i think it would be useful to be able to customize this behavior in compiler flags such as `typeInstantiationDepthLimit` and `tailRecursionTypeInstantiationDepthLimit`\r\n\r\nthough i'm not sure how this would work if a project depends on a project that customizes these...\r\n\u003c!-- A summary of what you'd like to see added or changed -->\r\n\r\n## 💻 Use Cases\r\ni have a repository of utility types, many of which use recursive conditional types and rely on the depth limit being quite high. a workaround for the depth limit i've been using is [this logarithmic approach](https://github.com/microsoft/TypeScript/issues/26223#issuecomment-674514787), but with the new tail recursion change i've been thinking of replacing it with a much simpler implementation, though that would change the limit from 10000 to 1000.\r\n\u003c!--\r\n What do you want to use this for?\r\n What shortcomings exist with current approaches?\r\n What workarounds are you using in the meantime?\r\n-->\r\n","author":{"url":"https://github.com/DetachHead","@type":"Person","name":"DetachHead"},"datePublished":"2021-10-03T06:01:10Z","url":"https://github.com/microsoft/TypeScript/issues/46180"}
| 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:af927766-3a33-bc58-2514-d0809591bb2e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8EDA:215B92:29E6CF1:37D154D:6B01BDD3 |
| html-safe-nonce | a2216f1592cb437373f129c4391e398505fc94314ee875f2aa415077d603c485 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RURBOjIxNUI5MjoyOUU2Q0YxOjM3RDE1NEQ6NkIwMUJERDMiLCJ2aXNpdG9yX2lkIjoiNDU0Njk4ODU5OTk3MDc0MTcxNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 73b99e5f4b0dc0dd8207ef2e059d2a49e3e7394998242afc3323f572b5ebfb37 |
| hovercard-subject-tag | issue:1014275753 |
| 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/46180/issue_layout |
| twitter:image | https://opengraph.githubassets.com/87ef753fc90a779b9ef6ccb68d4ce766ab37b01fc875207f10afe5a35e355b0e/microsoft/TypeScript/issues/46180 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/87ef753fc90a779b9ef6ccb68d4ce766ab37b01fc875207f10afe5a35e355b0e/microsoft/TypeScript/issues/46180 |
| og:image:alt | Suggestion 🔍 Search Terms customize type instantiation depth limit ✅ Viability Checklist My suggestion meets these guidelines: This wouldn't be a breaking change in existing TypeScript/JavaScript c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DetachHead |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width