René's URL Explorer Experiment


Title: Slow Performance with Type Inference on JSX Element · Issue #43717 · microsoft/TypeScript · GitHub

Open Graph Title: Slow Performance with Type Inference on JSX Element · Issue #43717 · microsoft/TypeScript

X Title: Slow Performance with Type Inference on JSX Element · Issue #43717 · microsoft/TypeScript

Description: Version TypeScript 4.2.4 TypeScript 4.3.0-dev.20210417 Expected Behaviour Any changes made to the Box component have fast validation and auto-completion for associated attributes. Actual Behaviour TypeScript validation and auto-completio...

Open Graph Description: Version TypeScript 4.2.4 TypeScript 4.3.0-dev.20210417 Expected Behaviour Any changes made to the Box component have fast validation and auto-completion for associated attributes. Actual Behaviour ...

X Description: Version TypeScript 4.2.4 TypeScript 4.3.0-dev.20210417 Expected Behaviour Any changes made to the Box component have fast validation and auto-completion for associated attributes. Actual Behaviour ...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Slow Performance with Type Inference on JSX Element","articleBody":"**Version**\r\nTypeScript 4.2.4\r\nTypeScript 4.3.0-dev.20210417\r\n\r\n**Expected Behaviour**\r\nAny changes made to the `Box` component have fast validation and auto-completion for associated attributes.\r\n\r\n**Actual Behaviour**\r\nTypeScript validation and auto-completion is slow.\r\n\r\n**Description**\r\nI have been investigating the current trend to create a generic React element which will pass through an `element` property and  associated attributes and call `React.createElement`. An approach similar to this is used by several prominent projects such as [Material UI](https://github.com/mui-org/material-ui) and [Github Primer](https://github.com/primer/components). I wanted to ensure that TypeScript will infer the correct attributes from the given `element` property. The code I wrote does work, however it does appear to have a significant performance impact.\r\n\r\n**Related**\r\nThis issue may be related to these issues: #34801, #43485, #42010, #14729, #38583.\r\n\r\n**Example**\r\nA small, reproducible example can be found at: https://github.com/scottwillmoore/react-box. You can also experiment with it in [CodeSandbox](https://codesandbox.io/s/react-with-typescript-inferred-properties-8h2jo?file=/src/App.tsx). The CodeSandbox version has some differences.\r\n\r\nThe meat of the TypeScript can be seen below:\r\n\r\n````tsx\r\nimport React from \"react\";\r\n\r\ntype ElementType = keyof JSX.IntrinsicElements;\r\n\r\ntype ElementProperties\u003cT extends ElementType> = JSX.IntrinsicElements[T];\r\n\r\ntype WithElement\u003cT extends ElementType> = {\r\n    element: T;\r\n} & ElementProperties\u003cT>;\r\n\r\ntype WithChildren = {\r\n    children?: React.ReactNode;\r\n};\r\n\r\ntype BoxProperties\u003cT extends ElementType> = WithElement\u003cT> & WithChildren;\r\n\r\nfunction Box\u003cT extends ElementType>({ element, children, ...properties }: BoxProperties\u003cT>) {\r\n    return React.createElement(element, properties, children);\r\n}\r\n\r\nexport default function App() {\r\n    return (\r\n        \u003cBox element=\"a\" href=\"#\">\r\n            Hello, world!\r\n        \u003c/Box>\r\n    );\r\n}\r\n````","author":{"url":"https://github.com/scottwillmoore","@type":"Person","name":"scottwillmoore"},"datePublished":"2021-04-17T12:26:13Z","url":"https://github.com/microsoft/TypeScript/issues/43717"}

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:30a661b8-d595-4f49-1165-82dd9841a73d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9776:14F601:2D2C0D5:3950965:6B019DE9
html-safe-nonce1fb6cca17ced100cc5255da0255f09a918197ac0055300dc398f681533121766
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Nzc2OjE0RjYwMToyRDJDMEQ1OjM5NTA5NjU6NkIwMTlERTkiLCJ2aXNpdG9yX2lkIjoiNjU3OTc5MTE4ODAzMzkwNDEwNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac45f8c9b0dfd3c2d98a77ba4578bd31215fae75c5bb3ceed4c0d5fc980fe45499
hovercard-subject-tagissue:860399254
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/43717/issue_layout
twitter:imagehttps://opengraph.githubassets.com/422189447c28bac90f7dad8bb2ea97511f4b6ff1a52ec9b9e55c013c30cfa677/microsoft/TypeScript/issues/43717
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/422189447c28bac90f7dad8bb2ea97511f4b6ff1a52ec9b9e55c013c30cfa677/microsoft/TypeScript/issues/43717
og:image:altVersion TypeScript 4.2.4 TypeScript 4.3.0-dev.20210417 Expected Behaviour Any changes made to the Box component have fast validation and auto-completion for associated attributes. Actual Behaviour ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamescottwillmoore
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/43717#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F43717
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%2F43717
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/43717
Reloadhttps://github.com/microsoft/TypeScript/issues/43717
Reloadhttps://github.com/microsoft/TypeScript/issues/43717
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/43717
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/43717
Slow Performance with Type Inference on JSX Elementhttps://github.com/microsoft/TypeScript/issues/43717#top
Not a DefectThis behavior is one of several equally-correct optionshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Not%20a%20Defect%22
Backloghttps://github.com/microsoft/TypeScript/milestone/29
https://github.com/scottwillmoore
Scott Moore (scottwillmoore)https://github.com/scottwillmoore
on Apr 17, 2021https://github.com/microsoft/TypeScript/issues/43717#issue-860399254
Material UIhttps://github.com/mui-org/material-ui
Github Primerhttps://github.com/primer/components
#34801https://github.com/microsoft/TypeScript/issues/34801
#43485https://github.com/microsoft/TypeScript/issues/43485
#42010https://github.com/microsoft/TypeScript/issues/42010
#14729https://github.com/microsoft/TypeScript/issues/14729
#38583https://github.com/microsoft/TypeScript/issues/38583
https://github.com/scottwillmoore/react-boxhttps://github.com/scottwillmoore/react-box
CodeSandboxhttps://codesandbox.io/s/react-with-typescript-inferred-properties-8h2jo?file=/src/App.tsx
https://github.com/scottwillmoore
Scott Moore (scottwillmoore)https://github.com/scottwillmoore
on Apr 18, 2021https://github.com/microsoft/TypeScript/issues/43717#issuecomment-821942083
Chakra UI implementationhttps://github.com/chakra-ui/chakra-ui/blob/main/packages/system/src/system.types.tsx
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Needs InvestigationThis issue needs a team member to investigate its status.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Investigation%22
on Apr 20, 2021https://github.com/microsoft/TypeScript/issues/43717#event-4620260647
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Backloghttps://github.com/microsoft/TypeScript/milestone/29
on Apr 20, 2021https://github.com/microsoft/TypeScript/issues/43717#event-4620261102
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Andrew Casey (amcasey)https://github.com/amcasey
on Apr 20, 2021https://github.com/microsoft/TypeScript/issues/43717#event-4620261720
https://github.com/amcasey
Andrew Casey (amcasey)https://github.com/amcasey
on Apr 20, 2021https://github.com/microsoft/TypeScript/issues/43717#issuecomment-823570113
https://github.com/amcasey
Andrew Casey (amcasey)https://github.com/amcasey
on Apr 20, 2021https://github.com/microsoft/TypeScript/issues/43717#issuecomment-823571321
#41821https://github.com/microsoft/TypeScript/pull/41821
https://github.com/scottwillmoore
Scott Moore (scottwillmoore)https://github.com/scottwillmoore
on Apr 21, 2021https://github.com/microsoft/TypeScript/issues/43717#issuecomment-824017951
#41821https://github.com/microsoft/TypeScript/pull/41821
https://github.com/amcasey
Andrew Casey (amcasey)https://github.com/amcasey
on Apr 21, 2021https://github.com/microsoft/TypeScript/issues/43717#issuecomment-824439510
https://github.com/amcasey
Andrew Casey (amcasey)https://github.com/amcasey
on Apr 22, 2021https://github.com/microsoft/TypeScript/issues/43717#issuecomment-824456194
https://github.com/amcasey
Andrew Casey (amcasey)https://github.com/amcasey
on Apr 22, 2021https://github.com/microsoft/TypeScript/issues/43717#issuecomment-825071339
https://github.com/scottwillmoore
Scott Moore (scottwillmoore)https://github.com/scottwillmoore
on Apr 25, 2021https://github.com/microsoft/TypeScript/issues/43717#issuecomment-826305886
#36981https://github.com/microsoft/TypeScript/issues/36981
#42524https://github.com/microsoft/TypeScript/pull/42524
Andrew Casey (amcasey)https://github.com/amcasey
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Andrew Casey (amcasey)https://github.com/amcasey
on Nov 17, 2022https://github.com/microsoft/TypeScript/issues/43717#event-7838480305
https://github.com/audunolsen
Audun Meek Olsen (audunolsen)https://github.com/audunolsen
on Feb 8, 2024https://github.com/microsoft/TypeScript/issues/43717#issuecomment-1934413026
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Feb 8, 2024https://github.com/microsoft/TypeScript/issues/43717#event-11749024582
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Not a DefectThis behavior is one of several equally-correct optionshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Not%20a%20Defect%22
Needs InvestigationThis issue needs a team member to investigate its status.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Investigation%22
on Feb 8, 2024https://github.com/microsoft/TypeScript/issues/43717#event-11749025582
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Feb 8, 2024https://github.com/microsoft/TypeScript/issues/43717#issuecomment-1934598940
https://github.com/typescript-bot
TypeScript Bot (typescript-bot)https://github.com/typescript-bot
on Feb 11, 2024https://github.com/microsoft/TypeScript/issues/43717#issuecomment-1937384048
TypeScript Bot (typescript-bot)https://github.com/typescript-bot
not plannedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Anot-planned
on Feb 11, 2024https://github.com/microsoft/TypeScript/issues/43717#event-11766032419
microsofthttps://github.com/microsoft
on Oct 21, 2025https://github.com/microsoft/TypeScript/issues/43717#event-20417396644
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/43717
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/43717
Not a DefectThis behavior is one of several equally-correct optionshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Not%20a%20Defect%22
BacklogNo due datehttps://github.com/microsoft/TypeScript/milestone/29
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.