René's URL Explorer Experiment


Title: Design Meeting Notes, 12/10/2021 · Issue #47151 · microsoft/TypeScript · GitHub

Open Graph Title: Design Meeting Notes, 12/10/2021 · Issue #47151 · microsoft/TypeScript

X Title: Design Meeting Notes, 12/10/2021 · Issue #47151 · microsoft/TypeScript

Description: "Correlated Union Types" #30581 type NumberRecord = { kind: "n", v: number, f: (v: number) => void }; type StringRecord = { kind: "s", v: string, f: (v: string) => void }; type BooleanRecord = { kind: "b", v: boolean, f: (v: boolean) => ...

Open Graph Description: "Correlated Union Types" #30581 type NumberRecord = { kind: "n", v: number, f: (v: number) => void }; type StringRecord = { kind: "s", v: string, f: (v: string) => void }; type BooleanRecord = { ki...

X Description: "Correlated Union Types" #30581 type NumberRecord = { kind: "n", v: number, f: (v: number) => void }; type StringRecord = { kind: "s", v: string, f: (v: string) =&g...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/47151

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Design Meeting Notes, 12/10/2021","articleBody":"\r\n# \"Correlated Union Types\"\r\n\r\nhttps://github.com/microsoft/TypeScript/issues/30581\r\n\r\n```ts\r\ntype NumberRecord = { kind: \"n\", v: number, f: (v: number) => void };\r\ntype StringRecord = { kind: \"s\", v: string, f: (v: string) => void };\r\ntype BooleanRecord = { kind: \"b\", v: boolean, f: (v: boolean) => void };\r\ntype UnionRecord = NumberRecord | StringRecord | BooleanRecord;\r\n\r\nfunction processRecord(record: UnionRecord) {\r\n  record.f(record.v); // error!\r\n // error msg in TS3.2 and below: can't call union of functions\r\n // error msg in TS3.3 and up: record.v not assignable to never\r\n}\r\n```\r\n\r\n* We want to be able to feed the callback with the original value; but now `v` is a union type and `f`'s parameter type is an intersection; that's not precise for `v`, and that intersection now only accepts `never`.\r\n* People have speculated that maybe we need existential types so that we can say \"this function takes whatever type `v` has\" and can feed it through.\r\n* Can try to re-model this in the form of a re-indexed mapped type.\r\n\r\n  ```ts\r\n  interface TypeMap {\r\n      \"n\": number;\r\n      \"s\": string;\r\n      \"b\": boolean;\r\n  }\r\n\r\n  type UnionRecord\u003cP extends keyof TypeMap> = { [K in P}]: {\r\n          kind: K;\r\n          v: TypeMap[K];\r\n          f: (p: TypeMap[K]) => void;\r\n      }\r\n  }[K];\r\n\r\n  function processRecord\u003cK extends keyof TypeMap>(record: UnionRecord\u003cK>) {\r\n      record.f(record.v);\r\n  }\r\n  ```\r\n* With some improvements of inference and apparent types, we can enable most of these cases - 2 improvements on the scale of what feel like bug fixes.\r\n    * First is inference to the IIFE-like mapped object pattern from above.\r\n    * Second is how we present the apparent members of certain types when you index into an already-instantiated mapped object type (a \"table type\") with some generic key.\r\n        * `{ [P in K]: Foo\u003cP> }[X] => Foo\u003cX>`\r\n        * Does that mean that if you *aren't* using a type that was declared as a mapped type, then we won't get a more precise type?\r\n            * Yes, if you leave off types on these objects.\r\n                * I guess we don't have an easy way to correlate.\r\n                * We could *try* to do something there...but that's a bit of a stretch.\r\n* This is a weird pattern. Would like to not have to teach people to write this.\r\n\r\n# Modules Migration Status Update\r\n\r\nhttps://github.com/microsoft/TypeScript/pull/46567\r\n\r\n* A lot of time running tests.\r\n* A lot of time is going into getters for every single binding.\r\n* Had TypeScript generate to CJS, had esbuild run on top of that.\r\n* Swapped TS to generate ESM, and esbuild generates the same sorts of bindings - so no optimization there.\r\n* 25 minutes to run the full tests! Thanks to the multiple levels of indirections of calling functions.\r\n* Could switch to ES3 emit to avoid accessors.\r\n* Also could switch to native ESM emit.\r\n    * No telling how slow ESM live bindings would be.\r\n* Could avoid indirect barrel imports.\r\n* Looked at bundler front-ends that are largely esbuild wrappers.\r\n    * But these tend to push for the optimized build to use Rollup.\r\n* \\[\\[Whole discussion on what the right shipping format and layout to send.]]\r\n* Dogfooding with modules showed us just how slow this is.\r\n    * Even getting complaints on tslib: https://github.com/microsoft/tslib/issues/165\r\n* Conclusion\r\n    * Investigate the `__createBindings` issue.\r\n    * Investigate alternative bundlers.\r\n\r\n# Ensuring Modules Conform to a Type\r\n\r\nhttps://github.com/microsoft/TypeScript/issues/38511\r\n\r\n* Lots of people would like to be able to ensure \"this file has this sort of shape.\"\r\n    * Then \"I would like this folder to describe this shape\".\r\n* `export implements SomeType` that \r\n* PR suggests everything should be contextually typed.\r\n* You can emulate this today with a self-import.\r\n    * Without contextual typing, this is possibly just sugar that saves you 2 lines. Maybe not as compelling.\r\n* This links to typing default exports - is that the real feature?\r\n* Out of time - revisit in the new year.","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2021-12-14T18:47:21Z","url":"https://github.com/microsoft/TypeScript/issues/47151"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:5221b5d9-0243-0737-940d-a60c62358abd
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBB8A:F7C4C:189CEEF:20F43A4:6B01518D
html-safe-nonce76669432c32371974c3ad667e51b7a114da87d9d2d01185732d52613ff03dc7c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjhBOkY3QzRDOjE4OUNFRUY6MjBGNDNBNDo2QjAxNTE4RCIsInZpc2l0b3JfaWQiOiIxOTk0MzI3Nzk1MDU2ODQ4NzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac38332600d2cd0aae0859b874a2c02aaca86ea517b3d719700404d14311b62d80
hovercard-subject-tagissue:1080098761
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/47151/issue_layout
twitter:imagehttps://opengraph.githubassets.com/bb0f5b0ecfb63a79dbf5eacb285b7dd7d2d1a4eba684a0b5fc4d4d4884ac3f0d/microsoft/TypeScript/issues/47151
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/bb0f5b0ecfb63a79dbf5eacb285b7dd7d2d1a4eba684a0b5fc4d4d4884ac3f0d/microsoft/TypeScript/issues/47151
og:image:alt"Correlated Union Types" #30581 type NumberRecord = { kind: "n", v: number, f: (v: number) => void }; type StringRecord = { kind: "s", v: string, f: (v: string) => void }; type BooleanRecord = { ki...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameDanielRosenwasser
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/47151#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F47151
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F47151
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/47151
Reloadhttps://github.com/microsoft/TypeScript/issues/47151
Reloadhttps://github.com/microsoft/TypeScript/issues/47151
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests312 (312)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/47151
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/47151
Design Meeting Notes, 12/10/2021https://github.com/microsoft/TypeScript/issues/47151#top
Design NotesNotes from our design meetingshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Design%20Notes%22
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Dec 14, 2021https://github.com/microsoft/TypeScript/issues/47151#issue-1080098761
#30581https://github.com/microsoft/TypeScript/issues/30581
#46567https://github.com/microsoft/TypeScript/pull/46567
__createBinding performance issue on web browsers tslib#165https://github.com/microsoft/tslib/issues/165
#38511https://github.com/microsoft/TypeScript/issues/38511
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
Design NotesNotes from our design meetingshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Design%20Notes%22
on Dec 14, 2021https://github.com/microsoft/TypeScript/issues/47151#event-5766278388
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Dec 14, 2021https://github.com/microsoft/TypeScript/issues/47151#issuecomment-993887782
#47109https://github.com/microsoft/TypeScript/pull/47109
https://github.com/ShuiRuTian
Song Gao (ShuiRuTian)https://github.com/ShuiRuTian
on Dec 15, 2021https://github.com/microsoft/TypeScript/issues/47151#issuecomment-994360763
#46567https://github.com/microsoft/TypeScript/pull/46567
#35561https://github.com/microsoft/TypeScript/pull/35561
https://github.com/orta
Orta Therox (orta)https://github.com/orta
on Dec 15, 2021https://github.com/microsoft/TypeScript/issues/47151#issuecomment-994427917
#46567https://github.com/microsoft/TypeScript/pull/46567
#35561https://github.com/microsoft/TypeScript/pull/35561
https://github.com/evanw
Evan Wallace (evanw)https://github.com/evanw
on Dec 21, 2021https://github.com/microsoft/TypeScript/issues/47151#issuecomment-999021010
#46567https://github.com/microsoft/TypeScript/pull/46567
Rolluphttps://github.com/microsoft/TypeScript/issues/github.com/rollup/rollup
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Dec 21, 2021https://github.com/microsoft/TypeScript/issues/47151#issuecomment-999077355
Evan Wallace (@evanw)https://github.com/evanw
Eli Barzilay (@elibarzilay)https://github.com/elibarzilay
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Dec 21, 2021https://github.com/microsoft/TypeScript/issues/47151#issuecomment-999078451
https://github.com/elibarzilay
Eli Barzilay (elibarzilay)https://github.com/elibarzilay
on Jan 12, 2022https://github.com/microsoft/TypeScript/issues/47151#issuecomment-1011438499
Evan Wallace (@evanw)https://github.com/evanw
#47409https://github.com/microsoft/TypeScript/pull/47409
https://github.com/evanw
Evan Wallace (evanw)https://github.com/evanw
on Jan 13, 2022https://github.com/microsoft/TypeScript/issues/47151#issuecomment-1012405589
https://github.com/mohsen1
Mohsen Azimi (mohsen1)https://github.com/mohsen1
on Jan 18, 2022https://github.com/microsoft/TypeScript/issues/47151#issuecomment-1015602678
#38511https://github.com/microsoft/TypeScript/issues/38511
#3792https://github.com/microsoft/TypeScript/issues/3792
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Jan 19, 2022https://github.com/microsoft/TypeScript/issues/47151#issuecomment-1015975676
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on May 4, 2022https://github.com/microsoft/TypeScript/issues/47151#event-6545098255
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/47151
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/47151
Design NotesNotes from our design meetingshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Design%20Notes%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.