René's URL Explorer Experiment


Title: Allow JSX intrinsics to have generic call signatures · Issue #42010 · microsoft/TypeScript · GitHub

Open Graph Title: Allow JSX intrinsics to have generic call signatures · Issue #42010 · microsoft/TypeScript

X Title: Allow JSX intrinsics to have generic call signatures · Issue #42010 · microsoft/TypeScript

Description: Search Terms type checking, jsx intrinsics, generic type, signature Suggestion Allow JSX intrinsics defined in IntrinsicElements to support generic call signatures, as is supported for user-defined SFCs. Use Cases Suppose you want to cre...

Open Graph Description: Search Terms type checking, jsx intrinsics, generic type, signature Suggestion Allow JSX intrinsics defined in IntrinsicElements to support generic call signatures, as is supported for user-defined...

X Description: Search Terms type checking, jsx intrinsics, generic type, signature Suggestion Allow JSX intrinsics defined in IntrinsicElements to support generic call signatures, as is supported for user-defined...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow JSX intrinsics to have generic call signatures","articleBody":"\u003c!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨\r\n\r\nHalf of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker.\r\n\r\nPlease help us by doing the following steps before logging an issue:\r\n  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues\r\n  * Read the FAQ, especially the \"Common Feature Requests\" section: https://github.com/Microsoft/TypeScript/wiki/FAQ\r\n\r\n-->\r\n\r\n## Search Terms\r\n\r\ntype checking, jsx intrinsics, generic type, signature\r\n\r\n## Suggestion\r\n\r\nAllow JSX intrinsics defined in IntrinsicElements to support generic call signatures, as is supported for user-defined SFCs.\r\n\r\n## Use Cases\r\n\r\nSuppose you want to create a small DSL using JSX. You would need to model the primitive statements of the DSL. Your options are intrinsics and user-level components.\r\n\r\nIntrinsics are clearly the more natural fit for this use case. Some reasons are:\r\n* they are immediately available without separate import statements,\r\n* the use of lower case makes them visually distinct from user-defined components,\r\n\r\nHowever, intrinsics are not as capable as user-level components (pre-defined or user-defined). Currently they cannot be assigned generic type signatures. This makes them less expressive, and so, less useful.\r\n\r\nThe proposed change will bring parity between intrinsics and user-level components. In short, it will be possible to create a pre-defined set of intrinsics that are just as expressive as user-level SFCs.\r\n\r\n## Examples\r\n\r\nConsider the following hypothetical DSL in JSX:\r\n\r\n```jsx\r\n\u003cfor items={books} with={book => book.genre === 'scifi'}>\r\n{book => (\r\n    \u003cb>{book.title}\u003c/b>\r\n)}\r\n\u003c/for>\r\n```\r\n\r\nCurrently, the `for` intrinsic cannot be generic over the type of the items, unlike user-defined SFCs which may be generic. To bring this capability to intrinsics, we would need to allow JSX.IntrinsicElements to support generic signatures. Here is what it might look like for this example DSL:\r\n\r\n```typescript\r\ndeclare namespace JSX {\r\n    interface IntrinsicElements {\r\n        for: \u003cT>(props: {\r\n            items: T[],\r\n            with?: (item: T) => boolean,\r\n            children?: (item: T) => Element | Element[]\r\n        }) => Element;\r\n\r\n        b: { children: string }\r\n    }\r\n}\r\n```\r\n\r\nThe implementation of this change will require a small number of changes to `src/compiler/checker.ts`. A good starting point is the function `resolveJsxOpeningLikeElement`.\r\n\r\n## Checklist\r\n\r\nMy suggestion meets these guidelines:\r\n\r\n* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code\r\n* [x] This wouldn't change the runtime behavior of existing JavaScript code\r\n* [x] This could be implemented without emitting different JS based on the types of the expressions\r\n* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)\r\n* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).\r\n\r\n## Request to work on this feature\r\n\r\nI would like to work on this feature improvement.\r\n","author":{"url":"https://github.com/kevin-in-code","@type":"Person","name":"kevin-in-code"},"datePublished":"2020-12-17T12:06:48Z","url":"https://github.com/microsoft/TypeScript/issues/42010"}

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:8ae2c9db-d1f2-5817-31ec-ce70e49f36df
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD71E:29AEE8:2714130:3411B3A:6B01AA6B
html-safe-nonce36f5acc8f0512b462f6548e20598f9fd08aa36c9b2b7b6e23754b3913b211538
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENzFFOjI5QUVFODoyNzE0MTMwOjM0MTFCM0E6NkIwMUFBNkIiLCJ2aXNpdG9yX2lkIjoiMTEzMTM5NjY5MzY4MjY2MTk5NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac2319549fd885e199a3abdaea6c694c26f10929d96e450e80f8f912e6d05e3ef5
hovercard-subject-tagissue:769943013
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/42010/issue_layout
twitter:imagehttps://opengraph.githubassets.com/6393af7fb73ee822354c7a03f6d80e4a5b6775250d9d7dfef1a726b00ac50ea9/microsoft/TypeScript/issues/42010
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/6393af7fb73ee822354c7a03f6d80e4a5b6775250d9d7dfef1a726b00ac50ea9/microsoft/TypeScript/issues/42010
og:image:altSearch Terms type checking, jsx intrinsics, generic type, signature Suggestion Allow JSX intrinsics defined in IntrinsicElements to support generic call signatures, as is supported for user-defined...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamekevin-in-code
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/42010#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F42010
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%2F42010
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/42010
Reloadhttps://github.com/microsoft/TypeScript/issues/42010
Reloadhttps://github.com/microsoft/TypeScript/issues/42010
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/42010
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/42010
Allow JSX intrinsics to have generic call signatureshttps://github.com/microsoft/TypeScript/issues/42010#top
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com/kevin-in-code
Kevin A. Naudé (kevin-in-code)https://github.com/kevin-in-code
on Dec 17, 2020https://github.com/microsoft/TypeScript/issues/42010#issue-769943013
TypeScript's Design Goalshttps://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
on Dec 22, 2020https://github.com/microsoft/TypeScript/issues/42010#event-4142047094
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Dec 22, 2020https://github.com/microsoft/TypeScript/issues/42010#issuecomment-749822811
Wesley Wigham (@weswigham)https://github.com/weswigham
https://github.com/kevin-in-code
Kevin A. Naudé (kevin-in-code)https://github.com/kevin-in-code
on Jan 14, 2021https://github.com/microsoft/TypeScript/issues/42010#issuecomment-759881784
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
Wesley Wigham (@weswigham)https://github.com/weswigham
https://github.com/vkbansal-harness
Vivek Kumar Bansal (vkbansal-harness)https://github.com/vkbansal-harness
on Jan 11, 2023https://github.com/microsoft/TypeScript/issues/42010#issuecomment-1378574419
https://github.com/itsdouges
mike douges (itsdouges)https://github.com/itsdouges
on Jan 30, 2024https://github.com/microsoft/TypeScript/issues/42010#issuecomment-1916193450
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/42010
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/42010
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%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.