René's URL Explorer Experiment


Title: Partial Types · Issue #11233 · microsoft/TypeScript · GitHub

Open Graph Title: Partial Types · Issue #11233 · microsoft/TypeScript

X Title: Partial Types · Issue #11233 · microsoft/TypeScript

Description: This is a proposal for #4889 and a variety of other issues. Use Cases Many libraries, notably React, have a method which takes an object and updates corresponding fields on some other object on a per-key basis. It looks like this functio...

Open Graph Description: This is a proposal for #4889 and a variety of other issues. Use Cases Many libraries, notably React, have a method which takes an object and updates corresponding fields on some other object on a p...

X Description: This is a proposal for #4889 and a variety of other issues. Use Cases Many libraries, notably React, have a method which takes an object and updates corresponding fields on some other object on a p...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Partial Types","articleBody":"This is a proposal for #4889 and a variety of other issues.\n## Use Cases\n\nMany libraries, notably React, have a method which takes an object and updates corresponding fields on some other object on a per-key basis. It looks like this\n\n``` ts\nfunction setState\u003cT>(target: T, settings: ??T??) {\n  // ...\n}\nlet obj = { a: 2, b: \"ok\", c: [1] };\nsetState(obj, { a: 4 }); // Desired OK\nsetState(obj, { a: \"nope\"}); // Desired error\nsetState(obj, { b: \"OK\", c: [] }); // Desired OK\nsetState(obj, { a: 1, d: 100 }); // Desired error\nsetState(obj, window); // Desired error\n```\n## Observations\n- The update is rarely recursive (an exception is Mongo's `query`); this is a \"shallow\" operation\n- It's not desirable to allow \"new\" properties to appear\n- We're not looking for a _supertype_ of some type (due to the non-recursive nature)\n## Unary `partial T` operator\n\nA type `partial T` behaves as follows:\n1. Its properties are the same as the properties of `T`, except that those properties are now optional\n2. A `S` type is only assignable to type `partial T` if `S` has at least one property in common with `T`\n   - Otherwise regular structural subtype/assignability rules apply\n3. The type `partial (T | U)` is equivalent to `(partial T) | (partial U)`\n4. The type `partial (T & U)` does not expand (this would interact poorly with rule 2)\n5. Any type `T` is always a subtype of `partial T`\n6. The type `partial T` is equivalent to `T` if `T` is `any`, `never`, `null`, or `undefined`\n\nMore thoughts to come later, likely\n","author":{"url":"https://github.com/RyanCavanaugh","@type":"Person","name":"RyanCavanaugh"},"datePublished":"2016-09-28T23:53:24Z","url":"https://github.com/microsoft/TypeScript/issues/11233"}

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:9d7c5714-6cea-afe0-4531-02b07fecc3b6
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8CC6:15BA57:E161C:13B4EA:6AFBDA99
html-safe-nonce2635969bf12e3c73e0c8843ccffe7864e47a87430b5137e28a9c7d799af6df3b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Q0M2OjE1QkE1NzpFMTYxQzoxM0I0RUE6NkFGQkRBOTkiLCJ2aXNpdG9yX2lkIjoiMTExMjY3ODMzNzE0ODA4Mjg0MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac22bcf2765e8458eee864050251edf63b67faf917856a259ad5fec0902fbdec08
hovercard-subject-tagissue:179920279
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/11233/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2fa0d1af1aa7a455cb15584b3b5f725ba46dd2a384e463115b84452282c19830/microsoft/TypeScript/issues/11233
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2fa0d1af1aa7a455cb15584b3b5f725ba46dd2a384e463115b84452282c19830/microsoft/TypeScript/issues/11233
og:image:altThis is a proposal for #4889 and a variety of other issues. Use Cases Many libraries, notably React, have a method which takes an object and updates corresponding fields on some other object on a p...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameRyanCavanaugh
hostnamegithub.com
expected-hostnamegithub.com
None18742cb872ec73544356e60359266b67aafece70c4ce008042e06227924cdd07
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
release820be804f18e1ef3940bd74a00d41d73d02e2b91
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/11233#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F11233
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%2F11233
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/11233
Reloadhttps://github.com/microsoft/TypeScript/issues/11233
Reloadhttps://github.com/microsoft/TypeScript/issues/11233
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests334 (334)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/pulse
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/11233
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/11233
Partial Typeshttps://github.com/microsoft/TypeScript/issues/11233#top
https://github.com/RyanCavanaugh
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
TypeScript 2.1.4https://github.com/microsoft/TypeScript/milestone/31
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Sep 28, 2016https://github.com/microsoft/TypeScript/issues/11233#issue-179920279
#4889https://github.com/microsoft/TypeScript/issues/4889
Nexthttps://github.com/microsoft/TypeScript/issues/11233?timeline_page=1
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Sep 28, 2016https://github.com/microsoft/TypeScript/issues/11233#event-806275970
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Sep 28, 2016https://github.com/microsoft/TypeScript/issues/11233#issuecomment-250335456
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Sep 28, 2016https://github.com/microsoft/TypeScript/issues/11233#issuecomment-250335619
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Sep 29, 2016https://github.com/microsoft/TypeScript/issues/11233#issuecomment-250336552
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Sep 29, 2016https://github.com/microsoft/TypeScript/issues/11233#issuecomment-250336565
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
on Sep 29, 2016https://github.com/microsoft/TypeScript/issues/11233#event-806447450
https://github.com/tinganho
Tingan Ho (tinganho)https://github.com/tinganho
on Sep 29, 2016https://github.com/microsoft/TypeScript/issues/11233#issuecomment-250413341
#1394https://github.com/microsoft/TypeScript/issues/1394
https://github.com/kitsonk
Kitson Kelly (kitsonk)https://github.com/kitsonk
on Sep 29, 2016https://github.com/microsoft/TypeScript/issues/11233#issuecomment-250420990
https://github.com/kitsonk
Kitson Kelly (kitsonk)https://github.com/kitsonk
on Sep 29, 2016https://github.com/microsoft/TypeScript/issues/11233#issuecomment-250424376
https://github.com/yortus
Troy Gerwien (yortus)https://github.com/yortus
on Sep 29, 2016https://github.com/microsoft/TypeScript/issues/11233#issuecomment-250424841
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Sep 29, 2016https://github.com/microsoft/TypeScript/issues/11233#issuecomment-250565739
https://github.com/Igorbek
Igor Oleinikov (Igorbek)https://github.com/Igorbek
on Sep 29, 2016https://github.com/microsoft/TypeScript/issues/11233#issuecomment-250589766
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Oct 3, 2016https://github.com/microsoft/TypeScript/issues/11233#issuecomment-251256486
https://cloud.githubusercontent.com/assets/6685088/19057697/a8eb5122-8986-11e6-90d9-406107d82eeb.png
https://github.com/kitsonk
Kitson Kelly (kitsonk)https://github.com/kitsonk
on Oct 4, 2016https://github.com/microsoft/TypeScript/issues/11233#issuecomment-251303837
https://github.com/tinganho
Tingan Ho (tinganho)https://github.com/tinganho
on Oct 4, 2016https://github.com/microsoft/TypeScript/issues/11233#issuecomment-251307839
Troy Gerwien (@yortus)https://github.com/yortus
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
https://github.com/rozzzly
Patrick Lienau (rozzzly)https://github.com/rozzzly
on Nov 7, 2016https://github.com/microsoft/TypeScript/issues/11233#issuecomment-258881561
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Nov 9, 2016https://github.com/microsoft/TypeScript/issues/11233#issuecomment-259306050
Jason Killian (@jkillian)https://github.com/jkillian
#12114https://github.com/microsoft/TypeScript/pull/12114
https://github.com/AlexGalays
Alexandre Galays (AlexGalays)https://github.com/AlexGalays
on Nov 9, 2016https://github.com/microsoft/TypeScript/issues/11233#issuecomment-259359888
https://github.com/saschanaz
Kagami Sascha Rosylight (saschanaz)https://github.com/saschanaz
on Nov 9, 2016https://github.com/microsoft/TypeScript/issues/11233#issuecomment-259372642
Alexandre Galays (@AlexGalays)https://github.com/AlexGalays
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Nov 14, 2016https://github.com/microsoft/TypeScript/issues/11233#issuecomment-260456923
#12114https://github.com/microsoft/TypeScript/pull/12114
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Nov 14, 2016https://github.com/microsoft/TypeScript/issues/11233#event-858419417
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Nov 14, 2016https://github.com/microsoft/TypeScript/issues/11233#event-858427500
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
on Nov 14, 2016https://github.com/microsoft/TypeScript/issues/11233#event-858427704
https://github.com/connor4312
Connor Peet (connor4312)https://github.com/connor4312
on Sep 29, 2017https://github.com/microsoft/TypeScript/issues/11233#issuecomment-333217612
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
dirty solutionshttps://stackoverflow.com/questions/45372227/how-to-implement-typescript-deep-partial-mapped-type-not-breaking-array-properti
https://github.com/Igorbek
Igor Oleinikov (Igorbek)https://github.com/Igorbek
on Sep 29, 2017https://github.com/microsoft/TypeScript/issues/11233#issuecomment-333255187
Connor Peet (@connor4312)https://github.com/connor4312
https://github.com/AlexGalays
Alexandre Galays (AlexGalays)https://github.com/AlexGalays
on Sep 29, 2017https://github.com/microsoft/TypeScript/issues/11233#issuecomment-333260576
Igor Oleinikov (@Igorbek)https://github.com/Igorbek
https://github.com/Igorbek
Igor Oleinikov (Igorbek)https://github.com/Igorbek
on Sep 30, 2017https://github.com/microsoft/TypeScript/issues/11233#issuecomment-333265667
#6606https://github.com/microsoft/TypeScript/issues/6606
https://github.com/alvis
Alvis Tang (alvis)https://github.com/alvis
on Oct 12, 2017https://github.com/microsoft/TypeScript/issues/11233#issuecomment-336126656
#17961https://github.com/microsoft/TypeScript/pull/17961
microsofthttps://github.com/microsoft
on Jun 19, 2018https://github.com/microsoft/TypeScript/issues/11233#event-1689915020
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/11233
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/11233
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
TypeScript 2.1.4https://github.com/microsoft/TypeScript/milestone/31
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.