René's URL Explorer Experiment


Title: Design Meeting Notes, 11/2/2018 · Issue #28326 · microsoft/TypeScript · GitHub

Open Graph Title: Design Meeting Notes, 11/2/2018 · Issue #28326 · microsoft/TypeScript

X Title: Design Meeting Notes, 11/2/2018 · Issue #28326 · microsoft/TypeScript

Description: Generic object spread and spread types (continued) #10727 #21316 (comment) #28234 Back in #10727, we speculated that we could have a new kind of type to describe the behavior of spread on generic types. Seemed pretty complicated to come ...

Open Graph Description: Generic object spread and spread types (continued) #10727 #21316 (comment) #28234 Back in #10727, we speculated that we could have a new kind of type to describe the behavior of spread on generic t...

X Description: Generic object spread and spread types (continued) #10727 #21316 (comment) #28234 Back in #10727, we speculated that we could have a new kind of type to describe the behavior of spread on generic t...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Design Meeting Notes, 11/2/2018","articleBody":"# Generic object spread and spread types (continued)\r\n\r\n#10727\r\n\r\nhttps://github.com/Microsoft/TypeScript/pull/21316#issuecomment-359574388\r\n\r\nhttps://github.com/Microsoft/TypeScript/pull/28234\r\n\r\n* Back in #10727, we speculated that we could have a new kind of type to describe the behavior of spread on generic types.\r\n* Seemed pretty complicated to come up with a new rules on higher order spread types so we waited on it.\r\n* Now that our type system has become pretty rich, we started wondering whether we could start to describe spread types in terms of conditional types and mapped types.\r\n* We can kind of do that, but there are certain caveats: our spread functionality tries to guess the \"right\" behavior to reflect the runtime.\r\n* We don't copy methods, we avoid set-only accessors, whatever.\r\n* Now if we want to do this in a higher-order sense (i.e. on generics), you need a way to select the keys that spread would actually copy those over.\r\n* So we thought about an `own` operator, but then you get into some unintuitive cases. For example, you'd think that for the following:\r\n\r\n  ```ts\r\n  function foo\u003cT>(obj1: T, obj2: T) {\r\n      return { ...obj1, ...obj2 };\r\n  }\r\n  ```\r\n\r\n  you'd get something assignable to a `T`. But no, instead you'd get something like a `Spread\u003cOwn\u003cT>, Own\u003cT>>` - which is not a `T`, and is not even an `Own\u003cT>` without some extra work. So this is not great.\r\n* Up until now, `Object.assign` just returned intersections.\r\n    * But spreads have almost identical semantics to `Object.assign`!\r\n    * While it's not correct to return intersections, by and large it's been good enough.\r\n    * So what we do now is that when you have a \"zero-order\" type (i.e. a non-generic type), we just do what we do today by constructing a new object type; but if you have a generic type, we'll stop and intersect with the current run of spreads.\r\n    * So `...{ x: 100}, ...{ y: \"hello\" }, ...z` where `z` has type `T` is `{ x: number, y: string } & T`.\r\n\r\n# Generic object rest\r\n\r\n* The natural question arises: what about object rest.\r\n* With #28312, if `obj` has type `T extends { foo: string }`, for the following code:\r\n\r\n  ```ts\r\n  function f\u003cT extends { foo: string }>(obj: T) {\r\n      let { foo, ...rest } = obj;\r\n      return rest;\r\n  }\r\n  ```\r\n\r\n  now `f` returns the type `Pick\u003cT, Exclude\u003ckeyof T, \"foo\">>`.\r\n* There was some work that needed to be done with symbols.\r\n    * Wait, symbols aren't enumerable.\r\n    * Does that matter?\r\n    * \\[\\[Discussion]]\r\n* What about the higher order components which are one of the most in-demand use-cases here?\r\n    * Doesn't seem to \"work\" right\r\n\r\n      ```ts\r\n      function excludeTag\u003c\r\n        T extends { tag: string } & U,\r\n        U extends>(\r\n            obj: T) {\r\n                let { foo, ...rest } = obj;\r\n                let blah: U = rest; // error!\r\n            }\r\n      ```\r\n* People might try to use `Pick\u003cT, Exclude\u003ckeyof T, keyof U>>` and it still won't work.\r\n* Sounds like we need subtraction types!\r\n    * Even though we kind of sort of have them with `Exclude`.\r\n* \\[\\[Discussion about subtraction types and negated types]]\r\n\r\n# Partial Type Argument Inference (revisited)\r\n\r\n#26349\r\n\r\n* We put out #26349 back in August\r\n* ~6 weeks ago when we last talked about partial type argument inference, we decided not to do anything since we couldn't pick a sigil.\r\n* Recently Flow implemented the feature and picked the `_` character.\r\n* This is the second-most voted PR on our repo.\r\n* Seems like there are legitimate use-cases and C# is looking at this; so what's the sigil?\r\n* Problem with `_` is that it's a legitimate use-case\r\n    * BigTSQuery says that there are a couple of uses of `_` but explicit type arguments are rare; so contextually reserving it is definitely overkill.\r\n* Conclusion: \r\n\r\n# Structurally identical-looking `Derived\u003cT>` not assignable to `Base\u003cT>`\r\n\r\nhttps://github.com/Microsoft/TypeScript/issues/27984\r\n\r\n* We fixed the specific issue, but there are other issues here.\r\n\r\n# Built-in base configs\r\n\r\nhttps://github.com/Microsoft/TypeScript/issues/28147\r\n\r\n* Do we want to ship any default configs ourselves.\r\n    * We can ship a set of defaults for well-known workloads (e.g. mixed JS & TS)\r\n* But your defaults for Babel aren't related to defaults for strictness.\r\n    * So now you need multiple inheritance to combine multiple tsconfigs!?\r\n* Lots of potential to break.\r\n* Scaffolding tools already do it all for you anyway.\r\n* Not clear if it's any more discoverable than the options themselves.","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2018-11-03T01:00:37Z","url":"https://github.com/microsoft/TypeScript/issues/28326"}

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:d663b1de-faf9-e2d7-cb08-32f7fc2ea189
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC718:291B58:23B42D9:2D4DF4D:6B01BD35
html-safe-nonce25b95ae02b798c448419882a0c8366ff2b6860677e97a472b9fa5b65f23f6cfd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzE4OjI5MUI1ODoyM0I0MkQ5OjJENERGNEQ6NkIwMUJEMzUiLCJ2aXNpdG9yX2lkIjoiODA3MjI0ODc4NTMxMDQzMjU2NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac2f0e71e36f0ee56f79fd9bbaa027dff59047f54a20a1fcf7eaf22a585aa85f40
hovercard-subject-tagissue:377008872
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/28326/issue_layout
twitter:imagehttps://opengraph.githubassets.com/9a37593cae928bccaab9011316c8c0cb6fc6873eeec1b59b83849e85deaeb738/microsoft/TypeScript/issues/28326
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/9a37593cae928bccaab9011316c8c0cb6fc6873eeec1b59b83849e85deaeb738/microsoft/TypeScript/issues/28326
og:image:altGeneric object spread and spread types (continued) #10727 #21316 (comment) #28234 Back in #10727, we speculated that we could have a new kind of type to describe the behavior of spread on generic t...
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/28326#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F28326
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%2F28326
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/28326
Reloadhttps://github.com/microsoft/TypeScript/issues/28326
Reloadhttps://github.com/microsoft/TypeScript/issues/28326
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/28326
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/28326
Design Meeting Notes, 11/2/2018https://github.com/microsoft/TypeScript/issues/28326#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 Nov 3, 2018https://github.com/microsoft/TypeScript/issues/28326#issue-377008872
#10727https://github.com/microsoft/TypeScript/issues/10727
#21316 (comment)https://github.com/microsoft/TypeScript/pull/21316#issuecomment-359574388
#28234https://github.com/microsoft/TypeScript/pull/28234
Add spread/rest higher-order types operator #10727https://github.com/microsoft/TypeScript/issues/10727
Generic object rest variables and parameters #28312https://github.com/microsoft/TypeScript/pull/28312
#26349https://github.com/microsoft/TypeScript/pull/26349
Implement partial type argument inference using the _ sigil #26349https://github.com/microsoft/TypeScript/pull/26349
#27984https://github.com/microsoft/TypeScript/issues/27984
#28147https://github.com/microsoft/TypeScript/issues/28147
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 Nov 3, 2018https://github.com/microsoft/TypeScript/issues/28326#event-1944169914
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Nov 3, 2018https://github.com/microsoft/TypeScript/issues/28326#event-1944170234
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/28326
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/28326
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.