René's URL Explorer Experiment


Title: Design Meeting Notes, 12/8/2017 · Issue #20724 · microsoft/TypeScript · GitHub

Open Graph Title: Design Meeting Notes, 12/8/2017 · Issue #20724 · microsoft/TypeScript

X Title: Design Meeting Notes, 12/8/2017 · Issue #20724 · microsoft/TypeScript

Description: in operators as a type guard interface Foo { abc: number; } interface Bar { def: string; } declare let x: Foo | Bar; if ("abc" in x) { x // Foo } else { x // Bar } Since types are open, in the true branch/then branch of the if, it"s not ...

Open Graph Description: in operators as a type guard interface Foo { abc: number; } interface Bar { def: string; } declare let x: Foo | Bar; if ("abc" in x) { x // Foo } else { x // Bar } Since types are open, in the true...

X Description: in operators as a type guard interface Foo { abc: number; } interface Bar { def: string; } declare let x: Foo | Bar; if ("abc" in x) { x // Foo } else { x // Bar } Since types are open, i...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Design Meeting Notes, 12/8/2017","articleBody":"# `in` operators as a type guard\r\n\r\n```ts\r\ninterface Foo {\r\n    abc: number;\r\n}\r\n\r\ninterface Bar {\r\n    def: string;\r\n}\r\n\r\ndeclare let x: Foo | Bar;\r\n\r\nif (\"abc\" in x) {\r\n    x // Foo\r\n}\r\nelse {\r\n    x // Bar\r\n}\r\n```\r\n\r\n\r\n* Since types are open, in the true branch/then branch of the `if`, it\"s not appropriate to say that the `x` *couldn't* be a `Bar`.\r\n    * But we already have this behavior for property access expressions, and most of the time these things are intent-based.\r\n* Introduces a break to RxJS\r\n    * https://github.com/ReactiveX/rxjs/blob/efcd922384116b2a45e7d7859e09cf6da34d7371/src/observable/dom/AjaxObservable.ts#L464-L474\r\n    * Narrows value to `never` in the false branch/else branch of the conditional.\r\n    * Declaration doesn't match reality on IE, but IE isn't following standard.\r\n    * Technically should have a different declaration for IE.\r\n    * Could introduce a type assertion/cast to get around this.\r\n    * Should we only do this on unions?\r\n        * No, need to be consistent with our narrowing behavior.\r\n* Conclusion\r\n    * :+1:\r\n    * Document that it's a breaking change.\r\n\r\n# The `override` keyword\r\n\r\n#2000\r\n#13217\r\n\r\n* Without flag, feature is not extremely useful.\r\n* What about `.d.ts` files?\r\n    * Would users need `overrride`\r\n* Allow users to use `override` when flag is off.\r\n* With a flag, it's an error to not use `override`.\r\n* Would it go in `--strict`?\r\n    * Not certain if it feels appropriate.\r\n* Generally, team feels ambivalent about whether the feature pays for its own complexity.\r\n    * We're fans of being able to add extra enforcement, but this is extremely tied to inheritance.\r\n    * Design time decorators? (#2900)\r\n        * One day?\r\n* Marked as `Accepting PRs` last year.\r\n    * Need to be discuss things more in depth before we decide these things.\r\n* Conclusion: can't accept at this time, would like to think more about annotations after decorators reach stage 3.\r\n\r\n# Conditional Types\r\n\r\n#12424\r\n\r\n* New type operator: `T extends U ? X : Y`\r\n    * Breaks `T` does to its union constituents (or `T` itself if not a union), checks if each of those types is assignable to `U`.\r\n        * When assignable, you get `X`, otherwise `Y`.\r\n    * If `T` is not known, the type remains unevaluated.\r\n    * Have been back and forth as to whether if `T` is a union, this distributes over the union.\r\n        * In general, distributing over `T`seems to make the most sense.\r\n\r\n* Can make some handy types!\r\n\r\n  ```ts\r\n  type Diff\u003cT, U> = T extends U ? never : T;\r\n  \r\n  type TypeName\u003cT> = \r\n      T extends string ? \"string\" :\r\n      T extends number ? \"number\" :\r\n      T extends boolean ? \"boolean\" :\r\n      T extends undefined ? \"undefined\" :\r\n      T extends Function ? \"function\" :\r\n      T extends string ? \"string\" :\r\n      \"object\";\r\n  \r\n  type NonNullable\u003cT> = Diff\u003cT, null | undefined>;\r\n  \r\n  type DeepReadonly\u003cT> = T extends object ?\r\n      { readonly [P in keyof T]: DeepReadonly\u003cT[P]> } :\r\n      T;\r\n  \r\n  // Type: \"a\" | \"d\"\r\n  type T0 = Diff\u003c\"a\" | \"b\" | \"c\" | \"d\", \"b\" | \"c\">;\r\n  \r\n  // Type: \"string\" | \"function\"\r\n  type T1 = TypeName\u003cstring | (() => void)>;\r\n  \r\n  // Type: string | number\r\n  type T2 = Diff\u003cstring | number | (() => void), Function>;\r\n  \r\n  \r\n  function f1\u003cT>(x: T, y: NonNullable\u003cT>) {\r\n      x = y;\r\n      y = x;\r\n  }\r\n  ```\r\n\r\n* How do these interact with `any` and `never`?\r\n    * `any` gives both branches of the conditional.\r\n    * `never` gives never.\r\n* Question: Should `T extends U` be a separate type operator from `X ? Y : Z`?\r\n* Should we have `&&` operators as well?`\r\n* If we did that, it introduces some more syntactical ambiguity.\r\n    * Currently we deal with this by saying \"the ambiguities are rare for any useful code.\r\n    * But `f\u003cT && U>(5)`, while a strange way to write `f \u003c T && U > 5`, feels odd.\r\n    * `f\u003cT && U>`\r\n* What about inference for a given branch?\r\n    * A new `infer` operator?\r\n    * Maybe something like `type ReturnTypeOf\u003cT> = from T infer R in (...args: any[]) => R: R`\r\n        * Note: would need a constraint on `T` like `(...args: any[]) => R`.\r\n    * Then could deconstruct types anywhere?\r\n* Why did we move away from thinking about `match` types?\r\n    * Kind of a \"Swiss army knife\" that does many things.\r\n    * Has curlies which can confuse folks that might think it ends up being an object type.\r\n    * Evaluation order might not be totally obvious to users, whereas conditionals are more explicit about order.\r\n* Does this give you the `awaited` type?\r\n    * No.\r\n        * Why not?\r\n            * Evaluation of type aliases is eager, making them lazy would be difficult.\r\n            * But if the type acted on isn't concrete, aren't we deferring evaluation anyway?\r\n            * Maybe it does.","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2017-12-15T20:04:30Z","url":"https://github.com/microsoft/TypeScript/issues/20724"}

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:a139f86b-d7b4-18b3-fd9f-24afe321edc5
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA446:2564D8:8DF7EC:BDF540:6B00E149
html-safe-nonce870f3263c357ed4fce96ed955ab51dfbad543bb2f27fa2940d4daff1bb89d50f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDQ2OjI1NjREODo4REY3RUM6QkRGNTQwOjZCMDBFMTQ5IiwidmlzaXRvcl9pZCI6Ijc3OTIzOTUwODU3Mzk1MTYyMzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac597669fad4cab84686f557de00e7d2896e2ef698936e611579ff23de18713d76
hovercard-subject-tagissue:282533656
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/20724/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c73db0e3becdf84d340fda0767480bbe46e0e89d426e5a94c8bec5957d11fd94/microsoft/TypeScript/issues/20724
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c73db0e3becdf84d340fda0767480bbe46e0e89d426e5a94c8bec5957d11fd94/microsoft/TypeScript/issues/20724
og:image:altin operators as a type guard interface Foo { abc: number; } interface Bar { def: string; } declare let x: Foo | Bar; if ("abc" in x) { x // Foo } else { x // Bar } Since types are open, in the true...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameDanielRosenwasser
hostnamegithub.com
expected-hostnamegithub.com
None043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf
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
release5425dc24e8bd8d6fca9641a12afc984825a43875
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/20724#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F20724
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%2F20724
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/20724
Reloadhttps://github.com/microsoft/TypeScript/issues/20724
Reloadhttps://github.com/microsoft/TypeScript/issues/20724
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests309 (309)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/20724
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/20724
Design Meeting Notes, 12/8/2017https://github.com/microsoft/TypeScript/issues/20724#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 15, 2017https://github.com/microsoft/TypeScript/issues/20724#issue-282533656
https://github.com/ReactiveX/rxjs/blob/efcd922384116b2a45e7d7859e09cf6da34d7371/src/observable/dom/AjaxObservable.ts#L464-L474https://github.com/ReactiveX/rxjs/blob/efcd922384116b2a45e7d7859e09cf6da34d7371/src/observable/dom/AjaxObservable.ts#L464-L474
#2000https://github.com/microsoft/TypeScript/issues/2000
#13217https://github.com/microsoft/TypeScript/pull/13217
Add Support for design-time decorators #2900https://github.com/microsoft/TypeScript/issues/2900
#12424https://github.com/microsoft/TypeScript/issues/12424
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 15, 2017https://github.com/microsoft/TypeScript/issues/20724#event-1390247253
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Dec 15, 2017https://github.com/microsoft/TypeScript/issues/20724#event-1390281389
microsofthttps://github.com/microsoft
on Jun 14, 2018https://github.com/microsoft/TypeScript/issues/20724#event-1682087177
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/20724
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/20724
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.