René's URL Explorer Experiment


Title: Ability to decorate abstract member function · Issue #37067 · microsoft/TypeScript · GitHub

Open Graph Title: Ability to decorate abstract member function · Issue #37067 · microsoft/TypeScript

X Title: Ability to decorate abstract member function · Issue #37067 · microsoft/TypeScript

Description: Search Terms I search "decorate abstract member" in the issues list, and #20887 has memtioned this issue but closed. Suggestion Ability to decorate abstract function and its params. Use Cases To implement a retrofit-like http request lib...

Open Graph Description: Search Terms I search "decorate abstract member" in the issues list, and #20887 has memtioned this issue but closed. Suggestion Ability to decorate abstract function and its params. Use Cases To im...

X Description: Search Terms I search "decorate abstract member" in the issues list, and #20887 has memtioned this issue but closed. Suggestion Ability to decorate abstract function and its params. Use C...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Ability to decorate abstract member function","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\nI search \"decorate abstract member\" in the issues list, and #20887 has memtioned this issue but closed.\r\n\r\n## Suggestion\r\n\r\n\u003c!-- A summary of what you'd like to see added or changed -->\r\nAbility to decorate abstract function and its params.\r\n\r\n## Use Cases\r\nTo implement a [retrofit](https://square.github.io/retrofit/)-like http request library with Typescript.  Examples from retrofit website: \r\n```java\r\npublic interface GitHubService {\r\n  @GET(\"users/{user}/repos\")\r\n  Call\u003cList\u003cRepo>> listRepos(@Path(\"user\") String user);\r\n}\r\n```\r\nWhen translate it into Typescript, we need to decorate an abstract class since interface will be erased after compilation. But,\r\n```typescript\r\n@MyAPI() // Okay, abstract class is decoratable\r\nabstract class GitHubService {\r\n  @GET(\"users/{user}/repos\")  // ERROR: Cannot decorate an abstract class member\r\n  abstract Call\u003cList\u003cRepo>> listRepos(@Path(\"user\") user: string);  // ERROR \r\n}\r\n```\r\n\u003c!--\r\nWhat do you want to use this for?\r\nWhat shortcomings exist with current approaches?\r\n-->\r\nTo workaround such limitation, we cannot use abstract class, so it turns out to be\r\n```typescript\r\n@MyAPI() // Okay, abstract class is decoratable\r\nclass GitHubService {\r\n  @GET(\"users/{user}/repos\") \r\n  Call\u003cList\u003cRepo>> listRepos(@Path(\"user\") user: user) {  \r\n    throw new Error('unimplemented');\r\n  } \r\n}\r\n```\r\nThis is obviousely not elegant.\r\n\r\nI think such ability can be implemented without breaks existing valid code. \r\nDecorator function can determin wheter it's decorating an abstract member by check if value of  property descriptor is undefined.\r\n\r\n```typescript\r\nfunction ClassMemberDecorator(prototype: {}, name: string, pd: PropertyDescriptor) {\r\n  if (typeof pd.value === 'undefined') { // we're decorating abstract member\r\n  }\r\n}\r\n\r\nfunction ClassMemberParamDecorator(prototype: {}, name: string, index: number) {\r\n   if (typeof prototype[name] === 'undefiend') { // we're decorating abstract member param\r\n   }\r\n}\r\n```\r\nSince when targetting ES3, `PropertyDescriptor.value` is always undefined, this feature shall only be supported when targetting ES5-onward. \r\n\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","author":{"url":"https://github.com/thynson","@type":"Person","name":"thynson"},"datePublished":"2020-02-27T03:21:04Z","url":"https://github.com/microsoft/TypeScript/issues/37067"}

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:58e737fc-e6ac-3357-565a-f879213046f0
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB022:27D3AD:6BEF7E:8ADAAE:6B00E138
html-safe-nonce3d1292dcebf0be47220675fbc7d71991a79cf03a12343a773c86b2f9d8e5f1c5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDIyOjI3RDNBRDo2QkVGN0U6OEFEQUFFOjZCMDBFMTM4IiwidmlzaXRvcl9pZCI6IjcxMjcyNjY3MDM5NzcyNzAzMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac2afe339cf952595389c1329437cef144a80a5c049cb5cac5143ed56f527d13bf
hovercard-subject-tagissue:571794127
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/37067/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1ff7e23b89b67bcf31e5bdff81dc31048104123ebd2fa5d8e5371d5006023653/microsoft/TypeScript/issues/37067
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1ff7e23b89b67bcf31e5bdff81dc31048104123ebd2fa5d8e5371d5006023653/microsoft/TypeScript/issues/37067
og:image:altSearch Terms I search "decorate abstract member" in the issues list, and #20887 has memtioned this issue but closed. Suggestion Ability to decorate abstract function and its params. Use Cases To im...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamethynson
hostnamegithub.com
expected-hostnamegithub.com
None043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf
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
release5425dc24e8bd8d6fca9641a12afc984825a43875
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/37067#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F37067
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%2F37067
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/37067
Reloadhttps://github.com/microsoft/TypeScript/issues/37067
Reloadhttps://github.com/microsoft/TypeScript/issues/37067
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests309 (309)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/37067
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/37067
Ability to decorate abstract member functionhttps://github.com/microsoft/TypeScript/issues/37067#top
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featurehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Awaiting%20More%20Feedback%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com/thynson
Xingcan LAN (thynson)https://github.com/thynson
on Feb 27, 2020https://github.com/microsoft/TypeScript/issues/37067#issue-571794127
#20887https://github.com/microsoft/TypeScript/issues/20887
retrofithttps://square.github.io/retrofit/
TypeScript's Design Goalshttps://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featurehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Awaiting%20More%20Feedback%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
on Feb 27, 2020https://github.com/microsoft/TypeScript/issues/37067#event-3079818019
https://github.com/eun-ice
eun-icehttps://github.com/eun-ice
on Jun 22, 2020https://github.com/microsoft/TypeScript/issues/37067#issuecomment-647391563
https://github.com/Hookyns
Roman Jámbor (Hookyns)https://github.com/Hookyns
on Oct 22, 2020https://github.com/microsoft/TypeScript/issues/37067#issuecomment-714386567
TypeScript runtime reflectionhttps://github.com/Hookyns/tst-reflect
https://github.com/ppoulard
Philippe Poulard (ppoulard)https://github.com/ppoulard
on Jan 13, 2022https://github.com/microsoft/TypeScript/issues/37067#issuecomment-1012262627
https://github.com/ppoulard
Philippe Poulard (ppoulard)https://github.com/ppoulard
on Feb 4, 2022https://github.com/microsoft/TypeScript/issues/37067#issuecomment-1030045595
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Feb 4, 2022https://github.com/microsoft/TypeScript/issues/37067#issuecomment-1030146373
Philippe Poulard (@ppoulard)https://github.com/ppoulard
https://github.com/shanwker1223
shanwker1223https://github.com/shanwker1223
on Mar 21, 2022https://github.com/microsoft/TypeScript/issues/37067#issuecomment-1073738847
https://github.com/thynson
Xingcan LAN (thynson)https://github.com/thynson
on Jun 24, 2023https://github.com/microsoft/TypeScript/issues/37067#issuecomment-1605283102
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
https://github.com/dxqshka
dxqshka (dxqshka)https://github.com/dxqshka
on Apr 22, 2024https://github.com/microsoft/TypeScript/issues/37067#issuecomment-2068778411
TS Playgroundhttps://www.typescriptlang.org/play?experimentalDecorators=true&emitDecoratorMetadata=true#code/C4TwDgpgBAwg9gOwM7AE4FcDGw6oDwAqUAvFHAEYBWE2AfCVAhAO5QAUAdFwIaoDmSAFxRuCEAG0AugEoS9AgG4AUKEhQAguRSpu2eMjRYc+IqQrU6DblrS7gjFuy4deA4aIky5URUpXhodTF9bSNcQgZzGmB6UgAfWERQ7HCCegTNbTsQwxSTWmUlTCT7GAAbbiQkABEaXG5jBgiIAA9gCAQAEyQNYJKMPNo2POECWWJ6AG8lKFmoVAhgdFQEKEwKqqhW9q6evKhpuaO1-rDUTh5+IRExKVlD48ekdEhz51ckaULHx+LkODKEA4ZTgfDYAHJ1pUep06jpGphuGVAZ1wV8Zj8AL4Y2bY7FFEpQAC2ECJ5AgqFqxXhuAYbGArkW7jEABooGBUHBXqAANIQEDCbQASwQfDZHK5FNAtSQmFQQrAxgA-MIAAqc7kgGVyhXGcZTHEnf6A4GgiEkskUqCw6kNWmI5EQVHozGFAAC5WhVPqxiU1iy2DWGx61XQRKJIEytj0wYOhol7WwTqgADM4HAAGpI9AQACEwgQYfJqG+cwT0WT-uj9j4iygAH003A2NIC0WKQooAB6LvsjVSkDxzmJ9qdEQ2HSBpB1xvptgAN2zEDbltQX27vYlmqHcBHlYndgb5F4LeE87gQs6nZ7xMWAAs4J0-Ec3Rbi96aah4+hyGUhZgoFrewm1PRh21QOMfnmRZllWYA7yFJAOFnOBlCOfEjhvD87VQPZRAQXcoHJEQwDAP9kxwYl0DKYAFUBQDFi7ad7F0TAICqXAejgFMoHg6AkG4ElGEEoFDRvV9SXfOEcKgRDoM6dBOlEew7wpaAhRY0jyLHSjyF3O8yB45j2lQLsgJM79f3-KBmNTOdFzKHMV2Le5DSOeDEOQpsGAcnM0LmDC5gk1dsN9I4wB-P8AOPc5Wygc9L0gn4FiWFZeIQpD6xilt-NxJR8ShTZQ3DEBPU2bYOm6KBiojKNJ2AMqegeWZyyTMcgIbEC4sLVckseFLYPSzymyzRyIFyqBApa4cKzHWyUIXJdnIpVyoI8pCRqXHylwmqa+13WajxPOKErHZrjj+JAASBEEwXBLLeDWJEUTRXb8r8S77AUkqGCYVgatK4Mcr8b6Iw4bzSAAFgAJmUS7rtNMFQZAcH03RJRkY4bKviAA
https://github.com/maksym-bandurko
maksym.bandurko (maksym-bandurko)https://github.com/maksym-bandurko
on May 19, 2024https://github.com/microsoft/TypeScript/issues/37067#issuecomment-2119375498
#38409https://github.com/microsoft/TypeScript/issues/38409
#19139https://github.com/microsoft/TypeScript/issues/19139
https://github.com/CAVAh
Lucas Cava (CAVAh)https://github.com/CAVAh
on Aug 19, 2024https://github.com/microsoft/TypeScript/issues/37067#issuecomment-2295526798
https://github.com/NicolasThierion
Nicolas THIERION (NicolasThierion)https://github.com/NicolasThierion
on Aug 29, 2024https://github.com/microsoft/TypeScript/issues/37067#issuecomment-2318573388
AspectJShttps://github.com/NicolasThierion/aspectjs
https://github.com/augustobmoura
Augusto Moura (augustobmoura)https://github.com/augustobmoura
on Dec 12, 2024https://github.com/microsoft/TypeScript/issues/37067#issuecomment-2537780691
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
changes to the proposal are not expected (unless absolutely necessary)https://tc39.es/process-document/
calling the decoratorhttps://github.com/tc39/proposal-decorators?tab=readme-ov-file#2-calling-decorators
well specified in ECMAScripthttps://github.com/tc39/proposal-decorators?tab=readme-ov-file#syntax
work in some wayhttps://play.swc.rs/?version=1.10.1&code=H4sIAAAAAAAAAz2MQQqAMAwE73nFHuulDxAqoi%2BJRUshGGl6E%2F9uFXFvs7MsRd2tgo88swgCnPeeS7IOYcAjVVYvmtxbEvFitXCsiMJmmLjgJLSM38cL%2F2pTdV2PRnlPdBHdKaO9KnEAAAA%3D&config=H4sIAAAAAAAAA21QOw6DMAzdOQXy3LUdOnftIaJgUKr8ZBupEerdm0BCQeoWv6%2Fjpet7eLGGe7%2FkZx6iIkba54xw8qLeGQFJEVmTiQKXxg6oAykJxFkhNOPOCBfTqCzjCn02BoSU5zGQO5ZYnJROjxb236hoQimLIF%2FrBmBDYGzyijnjzZiO8Tq4SMh8Fhap8pPFc11XK8GFYV7Jepvy%2F63%2BBj9RK9uDwfCzOctFus8XxO8eNWcBAAA%3D
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/37067
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/37067
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featurehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Awaiting%20More%20Feedback%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.