Title: Design Meeting Notes, 9/15/2023 · Issue #55754 · microsoft/TypeScript · GitHub
Open Graph Title: Design Meeting Notes, 9/15/2023 · Issue #55754 · microsoft/TypeScript
X Title: Design Meeting Notes, 9/15/2023 · Issue #55754 · microsoft/TypeScript
Description: API for Skipping JSDoc #55739 (background is #52921) #52921 made it so that tsc can skip JSDoc so that fewer nodes need to be allocated. Nice reduction in memory use + allocation/GC time! Prettier and typescript-eslint care about comment...
Open Graph Description: API for Skipping JSDoc #55739 (background is #52921) #52921 made it so that tsc can skip JSDoc so that fewer nodes need to be allocated. Nice reduction in memory use + allocation/GC time! Prettier ...
X Description: API for Skipping JSDoc #55739 (background is #52921) #52921 made it so that tsc can skip JSDoc so that fewer nodes need to be allocated. Nice reduction in memory use + allocation/GC time! Prettier ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/55754
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Design Meeting Notes, 9/15/2023","articleBody":"# API for Skipping JSDoc\r\n\r\n#55739\r\n\r\n(background is #52921)\r\n\r\n* #52921 made it so that `tsc` can skip JSDoc so that fewer nodes need to be allocated.\r\n * Nice reduction in memory use + allocation/GC time!\r\n* Prettier and typescript-eslint care about comments, but they don't care about how TypeScript's parser populated comments.\r\n* In #55739, the proposal is to add a flag so that other 3rd party tools can call into `createSourceFile` while also skipping JSDoc nodes.\r\n* The downside is that it's more API surface area.\r\n* ESLint already has something similar to say whether or not to bother parsing comments.\r\n* 3 new modes:\r\n * Skip-all\r\n * Keep-all\r\n * Keep *semantic only*.\r\n * What is a semantic comment?\r\n * Comments that contain `@see` or `@link`, or any comment outside of TS/TSX.\r\n * Not \"safe\" to use in the services layer where you want quick info to display JSDOc and whatnot.\r\n* Could we do JSDoc population lazily?\r\n * Complicated by the fact that JSDoc checking really expects the comments to be around for JS files.\r\n * Probably best to keep it consistent for now.\r\n* Still a good improvement overall, excited to make 3rd party tools faster too.\r\n* Want to still bikeshed the name.\r\n\r\n# Enabling Implementations of Functions with Overloads and Conditional Return Types\r\n\r\nhttps://github.com/microsoft/TypeScript/issues/33014\r\nhttps://github.com/microsoft/TypeScript/issues/33912\r\n\r\nImagine (from our handbook)\r\n\r\n```js\r\n/**\r\n * @param idOrName {string | number}\r\n */\r\nfunction createLabel(idOrName) {\r\n if (typeof idOrName === \"number\") {\r\n return { id: idOrName };\r\n }\r\n return { name: idOrName };\r\n}\r\n```\r\n\r\n* Could do overloads\r\n\r\n ```ts\r\n function createLabel(id: number): LabelWithId;\r\n function createLabel(name: string): LabelWithName;\r\n function createLabel(isOrName: string | number): LabelWithId | LabelWithName;\r\n function createLabel(isOrName: string | number): LabelWithId | LabelWithName {\r\n // ...\r\n }\r\n ```\r\n * But no checking that the overloads themselves correspond to the implementation.\r\n * Can implement this incorrectly.\r\n* Conditional types can describe what will happen - but today you cannot usually assign to them without a type assertion/cast.\r\n * When you introduce a cast, you are very likely to still make a mistake.\r\n * Also very verbose - you have to rename the casted type over and over again between the declared return type and each `return` expression.\r\n* Easy to get this stuff wrong.\r\n* So do we have agree we should fix this? \r\n * And if so, which? Overloads or conditional types?\r\n * Would love to have both. If we had to pick one, conditional types because overloads don't play well with unions etc.\r\n* Have a prototype working for conditional types - can't cover every case, requires distributive conditional and the like.\r\n* There's also a question of type soundness - conditional types aren't quite sound.\r\n * Still, today the workaround is to blast a wall instead of sneaking in through the air vent.\r\n","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2023-09-15T18:52:42Z","url":"https://github.com/microsoft/TypeScript/issues/55754"}
| 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:9897ab35-d177-a70e-4757-6d30b2a57e13 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 80B4:EDA7A:101E0D9:1486560:6B0112B0 |
| html-safe-nonce | 615f4066d961d72e9f54d4378546b35c1ea96598362c88f5c697041acd9bddb0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MEI0OkVEQTdBOjEwMUUwRDk6MTQ4NjU2MDo2QjAxMTJCMCIsInZpc2l0b3JfaWQiOiI3NDMxMjMzNzA4MTgwNDQzODI0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 37a4f704f9b72b2f7e75a8e80a85f6c40dca57f19eebc40f741e7d2f27c52619 |
| hovercard-subject-tag | issue:1898922274 |
| 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/55754/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c143ff9a6666d9f96da55a06662e1db7ee8d7ab22e5ab10816e1d83d1044ac54/microsoft/TypeScript/issues/55754 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c143ff9a6666d9f96da55a06662e1db7ee8d7ab22e5ab10816e1d83d1044ac54/microsoft/TypeScript/issues/55754 |
| og:image:alt | API for Skipping JSDoc #55739 (background is #52921) #52921 made it so that tsc can skip JSDoc so that fewer nodes need to be allocated. Nice reduction in memory use + allocation/GC time! Prettier ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DanielRosenwasser |
| 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