René's URL Explorer Experiment


Title: Design Meeting Notes, 2/14/2020 · Issue #36877 · microsoft/TypeScript · GitHub

Open Graph Title: Design Meeting Notes, 2/14/2020 · Issue #36877 · microsoft/TypeScript

X Title: Design Meeting Notes, 2/14/2020 · Issue #36877 · microsoft/TypeScript

Description: Touched-up edits from me on Ben Lichtman (@uniqueiniquity)'s notes Discriminated Narrowing with typeof #32399 Today we do checks to narrow types depending on specific checks on literal types But using typeof doesn't narrow in the same wa...

Open Graph Description: Touched-up edits from me on Ben Lichtman (@uniqueiniquity)'s notes Discriminated Narrowing with typeof #32399 Today we do checks to narrow types depending on specific checks on literal types But us...

X Description: Touched-up edits from me on Ben Lichtman (@uniqueiniquity)'s notes Discriminated Narrowing with typeof #32399 Today we do checks to narrow types depending on specific checks on literal types Bu...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Design Meeting Notes, 2/14/2020","articleBody":"Touched-up edits from me on @uniqueiniquity's notes\r\n\r\n## Discriminated Narrowing with `typeof`\r\n\r\nhttps://github.com/microsoft/TypeScript/issues/32399\r\n\r\n- Today we do checks to narrow types depending on specific checks on literal types\r\n- But using typeof doesn't narrow in the same way when checking against primitive types\r\n- in the checking process order, we check for discriminated properties very early\r\n- Brian's example would work easier than the original example\r\n- Once there is an object in a property, that makes it no longer possibly discriminating\r\n    - null/undefined are different\r\n- two separate features:\r\n    - discriminate inside of typeof test (make typeof apply discriminate narrowing)\r\n        - this is the one azure sdk wants\r\n    - discriminate when something _is_ an object (as opposed to _is not_ null or undefined)\r\n- We should do the former, probably not the latter\r\n\r\n## Non-null assertions `!` with Optional Chaining `?.`\r\n\r\nhttps://github.com/microsoft/TypeScript/issues/36031\r\n\r\n- Revisiting issue from a month ago\r\n- The bang breaks the chain, thereby causing unexpected accesses on `undefined`\r\n- After exploring a solution, the problem is that `a?.b.c!` can still be undefined\r\n- Option A: Can we special case that example?\r\n- Option B: Can we say that the bang is part of a chain only when it's in the middle?\r\n- C# has similar struggles with this example\r\n- Our parsing strategy caused this issue - _technically_ postfix bang shouldn't be allowed to be mixed\r\n    - let's keep it allowed, too awkward to disallow\r\n- why would you have a trailing bang?\r\n    - defend against incorrect library types, so we do care\r\n- Option B is definitely preferred - seems straightforward and understandable\r\n- concern about breaking change if we do option B\r\n- Option C: we could require parens\r\n- How bad is this problem?\r\n    - Unintuitive for users\r\n    - It has 4 upvotes\r\n- Conclusion: Option B!\r\n- Do we want it for 3.8.2? No, wait for 3.9.\r\n\r\n## Can appending `.js` in Auto-Imports make sense?\r\n\r\nhttps://github.com/microsoft/TypeScript/pull/36725\r\n\r\n- An extension (e.g. `.js`) is required in Node ESM and Browser ESM for ESM imports\r\n- Add another option? Actually, we already have it...\r\n    - `importModuleSpecifierEnding` for editor options\r\n- should it just be determined by emit? no, might be using a bundler\r\n- Do we need to support export maps to do this correctly?\r\n    - as part of full Node ESM support, but not piecemeal \r\n- VS Code just wants the option\r\n- Also we've gotten requests for it to be an error to leave off the extension, but that's a separate issue\r\n- Now that browsers support import maps, classic resolution is not the best mode anymore, might need a third that supersedes these fixes\r\n- Should we give the option to VS Code now or say we'll get this done as part of future resolver work?\r\n    - worried that customers don't use what this is for, but we should really just have it\r\n- Let's ship the auto-import option for 3.9, it's already there.\r\n\r\n## Making Impossible Intersections of Discriminated Unions Produce `never`\r\n\r\nhttps://github.com/microsoft/TypeScript/pull/36696\r\n\r\n- Our type rewriting rules often create types that don't make sense\r\n- Originally didn't resolve this because we thought it was expensive and would cause circularities\r\n- Now, once we're about resolve the members of the union, we reduce, instead of reducing up front\r\n- you can view this as detecting the intersection version of discriminants\r\n- note that if one has an explicitly designated never type, we allow this\r\n\r\n  ```ts\r\n  type A = { kind: 'a', foo: string};\r\n  type B = { kind: 'b', foo: number};\r\n  type C = { kind: 'c', foo: number };\r\n  ```\r\n\r\n  ```ts\r\n  declare let x: A | (B & C);\r\n  let a: A = x; // previously error, now the same\r\n  ```\r\n\r\n- Originally motivated because we can't run the compiler with unions in our perf suites because of #31838 making types more inclusive caused Node's `parent` property to be massive\r\n- Now by reducing when the parent property is accessed, it greatly helped the problem\r\n- 10% speedup for material-ui, will help styled-components as well, and React's ref property\r\n- Key insight is that the only way to solve this problem is to not do it when constructing the intersection, but instead defer until a member is resolved\r\n- This is a breaking change: we will explore more members than we have before\r\n- We found two bugs in the current compiler, found bugs in DT\r\n- Not going to detect doubly nested discriminants at the outer level, so that won't break\r\n\r\n  ```ts\r\n  declare let xx: B & C;\r\n  xx.foo // today you get number, with this change its an error\r\n  ```\r\n\r\n- Willing to take the breaking change nature of this because we found errors and the perf benefits are a clear win\r\n","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2020-02-19T18:53:50Z","url":"https://github.com/microsoft/TypeScript/issues/36877"}

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:83a35a69-2074-32f1-c5aa-c745927a2dea
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8C6C:205334:5DCB55:843773:6B047588
html-safe-nonce9e3516e6789b6724613b925e62bd3175f042b486ec4af0c2bad3011780f89fdc
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzZDOjIwNTMzNDo1RENCNTU6ODQzNzczOjZCMDQ3NTg4IiwidmlzaXRvcl9pZCI6IjM0NDcyNzYzNjcxNTc0MjU1NDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaceb9b3c512f3d8a5259fa0d0bc1fbadd15287598344dc6ca889c59890a66dfec9
hovercard-subject-tagissue:567772194
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/36877/issue_layout
twitter:imagehttps://opengraph.githubassets.com/6b9e6f6f4754665382a3537c9a7f4d4598936c19ae809f2e0a15869ec8bab1a5/microsoft/TypeScript/issues/36877
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/6b9e6f6f4754665382a3537c9a7f4d4598936c19ae809f2e0a15869ec8bab1a5/microsoft/TypeScript/issues/36877
og:image:altTouched-up edits from me on Ben Lichtman (@uniqueiniquity)'s notes Discriminated Narrowing with typeof #32399 Today we do checks to narrow types depending on specific checks on literal types But us...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameDanielRosenwasser
hostnamegithub.com
expected-hostnamegithub.com
None9c099f1b85def81ca352464c276510dfef32deaf3c305404e65b8d270284a58b
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
releasecf73f57448d52b3a7b619195e182b33d3b3454ca
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/36877#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F36877
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%2F36877
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/36877
Reloadhttps://github.com/microsoft/TypeScript/issues/36877
Reloadhttps://github.com/microsoft/TypeScript/issues/36877
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests320 (320)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/36877
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/36877
Design Meeting Notes, 2/14/2020https://github.com/microsoft/TypeScript/issues/36877#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 Feb 19, 2020https://github.com/microsoft/TypeScript/issues/36877#issue-567772194
Ben Lichtman (@uniqueiniquity)https://github.com/uniqueiniquity
#32399https://github.com/microsoft/TypeScript/issues/32399
#36031https://github.com/microsoft/TypeScript/issues/36031
#36725https://github.com/microsoft/TypeScript/pull/36725
#36696https://github.com/microsoft/TypeScript/pull/36696
Empty intersection reduction #31838https://github.com/microsoft/TypeScript/pull/31838
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 Feb 19, 2020https://github.com/microsoft/TypeScript/issues/36877#event-3052960058
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 17, 2020https://github.com/microsoft/TypeScript/issues/36877#event-3560013781
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/36877
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/36877
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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.