René's URL Explorer Experiment


Title: Inheritance for Angular decorators is not well-defined · Issue #11606 · angular/angular · GitHub

Open Graph Title: Inheritance for Angular decorators is not well-defined · Issue #11606 · angular/angular

X Title: Inheritance for Angular decorators is not well-defined · Issue #11606 · angular/angular

Description: Currently, when classes with decorators are used in an inheritance chain, the results are undefined. Consider the following two components: @Component({selector: 'a', inputs: ['metaFoo']) class A { @Input() fieldFoo; metaFoo; } @Componen...

Open Graph Description: Currently, when classes with decorators are used in an inheritance chain, the results are undefined. Consider the following two components: @Component({selector: 'a', inputs: ['metaFoo']) class A {...

X Description: Currently, when classes with decorators are used in an inheritance chain, the results are undefined. Consider the following two components: @Component({selector: 'a', inputs: ['metaFoo&...

Opengraph URL: https://github.com/angular/angular/issues/11606

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inheritance for Angular decorators is not well-defined","articleBody":"Currently, when classes with decorators are used in an inheritance chain, the results are undefined.\n\nConsider the following two components:\n\n```\n@Component({selector: 'a', inputs: ['metaFoo'])\nclass A {\n  @Input() fieldFoo;\n  metaFoo;\n}\n\n@Component({selector: 'b', inputs: ['metaBar']}\nclass B extends A {\n  @Input() fieldBar;\n  metaBar;\n}\n```\n\nCurrently, using component `B` in JIT mode does not cause an error, but only inputs `fieldBar` and `metaBar` will be understood by Angular. This is because the decorators result in properties being defined on the class functions, and those properties are subject to shadowing via prototypical inheritance. So `B.annotations` (where the `@Component` metadata lives) shadows `A.annotations`, and `B.propMetadata` (where the `@Input`s live) shadows `A.propMetadata`.\n\nIf the `@Input() fieldBar` from `B` is removed, however, then `B` will have no property metadata, and so the lookup for`B.propMetadata` will reach `A.propMetadata` via the prototype chain and suddenly the `fieldFoo` input will become visible to Angular.\n\nThere is no provision in the spec for inheritance of decorator metadata. However, Angular could be made to support well-defined rules of inheritance for its own decorators.\n\nHere is one set of rules which I believe covers most of the cases where users attempt to inherit components:\n- Class-level decorators (`@Component` and friends) have their metadata merged according to the merge rules:\n  - Metadata objects are merged property by property.\n  - For properties with primitive values, a subclass value, if present, overwrites a superclass value.\n  - For properties with array values, the arrays are concatenated, superclass first.\n  - If the subclass provides no value, the superclass value, if present, is used.\n- Property-level decorators (`@Input`, etc) on superclasses are included in compilation.\n  - `@Input`s with the same name on the superclass and subclass should have the same behavior as two `@Input`s with the same name on the same class.\n\nApplying these rules would change the behavior of the above example, so component `B` would have all 4 defined inputs recognized.\n\nFor JIT mode, this requires two changes to Angular.\n\nFirst, the class-level decorators would be changed to check for metadata on the superclass, and perform the merging operation if present.\n\nSecondly, the runtime compiler would need to consider superclass metadata when checking for property annotations.\n\nFor the AOT compiler, the semantics would have to be built into the compiler itself as the decorators don't execute during AOT compilation.\n","author":{"url":"https://github.com/alxhub","@type":"Person","name":"alxhub"},"datePublished":"2016-09-14T16:10:13Z","url":"https://github.com/angular/angular/issues/11606"}

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:e8cc39d8-28c6-a6af-2e64-dbe1c82978e2
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8FC0:2AAD2E:72C551:9B27EC:6B00DC28
html-safe-nonce1db00bc550159437090527899a165a0886f9d1b36ee19dc4f78db82a2e880423
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RkMwOjJBQUQyRTo3MkM1NTE6OUIyN0VDOjZCMDBEQzI4IiwidmlzaXRvcl9pZCI6IjI1MDc4OTM0MzExODUzMDk2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac1599072a0af321ada631705397dc86239378d52d5790b461cc8122f42f26d033
hovercard-subject-tagissue:176950677
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/angular/angular/11606/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b50097f4d84b66803e15ac337c34c1346a66925cc9ccb8fe957cc45d02b5f342/angular/angular/issues/11606
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b50097f4d84b66803e15ac337c34c1346a66925cc9ccb8fe957cc45d02b5f342/angular/angular/issues/11606
og:image:altCurrently, when classes with decorators are used in an inheritance chain, the results are undefined. Consider the following two components: @Component({selector: 'a', inputs: ['metaFoo']) class A {...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamealxhub
hostnamegithub.com
expected-hostnamegithub.com
None043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf
turbo-cache-controlno-preview
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
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/angular/angular/issues/11606#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F11606
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%2Fangular%2Fangular%2Fissues%2F11606
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=angular%2Fangular
Reloadhttps://github.com/angular/angular/issues/11606
Reloadhttps://github.com/angular/angular/issues/11606
Reloadhttps://github.com/angular/angular/issues/11606
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues835 (835)https://github.com/angular/angular/issues
Pull requests140 (140)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/11606
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/11606
Inheritance for Angular decorators is not well-definedhttps://github.com/angular/angular/issues/11606#top
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
freq3: highhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22freq3%3A%20high%22
type: bug/fixhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
https://github.com/alxhub
alxhubhttps://github.com/alxhub
on Sep 14, 2016https://github.com/angular/angular/issues/11606#issue-176950677
Nexthttps://github.com/angular/angular/issues/11606?timeline_page=1
https://github.com/vicb
vicbhttps://github.com/vicb
on Sep 14, 2016https://github.com/angular/angular/issues/11606#issuecomment-247067132
https://github.com/zoechi
zoechihttps://github.com/zoechi
on Sep 15, 2016https://github.com/angular/angular/issues/11606#issuecomment-247243994
@Input and @Output annotations are not carried from subclasses #5415https://github.com/angular/angular/issues/5415
Overridden component classes and @Input() properties #5794https://github.com/angular/angular/issues/5794
OnInit is not respecting inheritance #6781https://github.com/angular/angular/issues/6781
Support @Input(), @Output(), @HostBinding() defined in superclasses and mixins #6953https://github.com/angular/angular/issues/6953
@Output attributes not emitting events if subclass has any @Input defined. #7191https://github.com/angular/angular/issues/7191
Support of abstract components #8333https://github.com/angular/angular/issues/8333
Dependency Injection not working for Components/Directives inherited from Angular2 Components/Directives. #8700https://github.com/angular/angular/issues/8700
ViewChild in a subclass kills ViewChild in an abstract superclass #10461https://github.com/angular/angular/issues/10461
The AoT compiler should support @Input or @Output from base classes #11060https://github.com/angular/angular/issues/11060
[feature] variants: overriding components & routes (aka experiments support) #11151https://github.com/angular/angular/issues/11151
Angular2 Final : Component with class inheritance  #12063https://github.com/angular/angular/issues/12063
Extending pipes cause template parse errors #8694https://github.com/angular/angular/issues/8694
@vicbhttps://github.com/vicb
https://github.com/vicb
vicbhttps://github.com/vicb
on Sep 15, 2016https://github.com/angular/angular/issues/11606#issuecomment-247455323
@zoechihttps://github.com/zoechi
https://github.com/fernandocode
fernandocodehttps://github.com/fernandocode
on Sep 26, 2016https://github.com/angular/angular/issues/11606#issuecomment-249640904
@zoechihttps://github.com/zoechi
Extend/Inherit angular2 components annotations #7968https://github.com/angular/angular/issues/7968
Overriding templates/templateUrls of components #11144https://github.com/angular/angular/issues/11144
https://github.com/fernandocode
fernandocodehttps://github.com/fernandocode
on Sep 26, 2016https://github.com/angular/angular/issues/11606#issuecomment-249642477
@alxhubhttps://github.com/alxhub
https://github.com/noemi-salaun
noemi-salaunhttps://github.com/noemi-salaun
on Sep 30, 2016https://github.com/angular/angular/issues/11606#issuecomment-250724886
@alxhubhttps://github.com/alxhub
https://github.com/h2qutc
h2qutchttps://github.com/h2qutc
on Oct 4, 2016https://github.com/angular/angular/issues/11606#issuecomment-251337340
http://stackoverflow.com/questions/36063627/angular2-and-class-inheritance-supporthttp://stackoverflow.com/questions/36063627/angular2-and-class-inheritance-support
https://github.com/lacolaco
lacolacohttps://github.com/lacolaco
on Oct 4, 2016https://github.com/angular/angular/issues/11606#issuecomment-251347778
https://github.com/fkolar
fkolarhttps://github.com/fkolar
on Oct 4, 2016https://github.com/angular/angular/issues/11606#issuecomment-251479378
#8272https://github.com/angular/angular/issues/8272
chuckjazhttps://github.com/chuckjaz
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
on Oct 4, 2016https://github.com/angular/angular/issues/11606#event-812507690
https://github.com/lacolaco
lacolacohttps://github.com/lacolaco
on Oct 5, 2016https://github.com/angular/angular/issues/11606#issuecomment-251637089
https://github.com/zoechi
zoechihttps://github.com/zoechi
on Oct 5, 2016https://github.com/angular/angular/issues/11606#issuecomment-251641704
https://github.com/tehkyle
tehkylehttps://github.com/tehkyle
on Oct 6, 2016https://github.com/angular/angular/issues/11606#issuecomment-252115211
https://github.com/lacolaco
lacolacohttps://github.com/lacolaco
on Oct 7, 2016https://github.com/angular/angular/issues/11606#issuecomment-252127922
@zoechihttps://github.com/zoechi
marclavalhttps://github.com/marclaval
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
on Oct 12, 2016https://github.com/angular/angular/issues/11606#event-820999315
https://github.com/Gustav0ar
Gustav0arhttps://github.com/Gustav0ar
on Aug 31, 2017https://github.com/angular/angular/issues/11606#issuecomment-326173465
https://github.com/zoechi
zoechihttps://github.com/zoechi
on Aug 31, 2017https://github.com/angular/angular/issues/11606#issuecomment-326219572
@Gustav0arhttps://github.com/Gustav0ar
https://github.com/insidewhy
insidewhyhttps://github.com/insidewhy
on Sep 25, 2017https://github.com/angular/angular/issues/11606#issuecomment-331991813
#12922https://github.com/angular/angular/issues/12922
https://github.com/ytilis
ytilishttps://github.com/ytilis
on Feb 23, 2018https://github.com/angular/angular/issues/11606#issuecomment-368038345
@dmitrysteblyukhttps://github.com/dmitrysteblyuk
@zoechihttps://github.com/zoechi
#6781https://github.com/angular/angular/issues/6781
#12922https://github.com/angular/angular/issues/12922
https://github.com/benelliott
benelliotthttps://github.com/benelliott
on Feb 23, 2018https://github.com/angular/angular/issues/11606#issuecomment-368041181
@ytilishttps://github.com/ytilis
#16335https://github.com/angular/angular/issues/16335
https://github.com/ytilis
ytilishttps://github.com/ytilis
on Feb 23, 2018https://github.com/angular/angular/issues/11606#issuecomment-368066760
@benelliotthttps://github.com/benelliott
https://github.com/benelliott
benelliotthttps://github.com/benelliott
on Feb 23, 2018https://github.com/angular/angular/issues/11606#issuecomment-368069668
@ytilishttps://github.com/ytilis
https://github.com/ytilis
ytilishttps://github.com/ytilis
on Feb 23, 2018https://github.com/angular/angular/issues/11606#issuecomment-368073674
https://github.com/insidewhy
insidewhyhttps://github.com/insidewhy
on Feb 24, 2018https://github.com/angular/angular/issues/11606#issuecomment-368222272
https://github.com/nhducseuit
nhducseuithttps://github.com/nhducseuit
on Jun 18, 2018https://github.com/angular/angular/issues/11606#issuecomment-397997140
#12920https://github.com/angular/angular/issues/12920
nhducseuithttps://github.com/nhducseuit
tboschhttps://github.com/tbosch
on Jun 18, 2018https://github.com/angular/angular/issues/11606#event-1685731383
https://github.com/sir-captainmorgan21
sir-captainmorgan21https://github.com/sir-captainmorgan21
on Aug 1, 2018https://github.com/angular/angular/issues/11606#issuecomment-409662375
@zoechihttps://github.com/zoechi
#25249https://github.com/angular/angular/issues/25249
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Sep 13, 2019https://github.com/angular/angular/issues/11606#issuecomment-531402382
automatic conversation locking policyhttps://github.com/angular/angular/blob/67d80f/docs/GITHUB_PROCESS.md#conversation-locking
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Sep 13, 2019https://github.com/angular/angular/issues/11606#event-2633650029
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/11606
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/11606
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
freq3: highhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22freq3%3A%20high%22
type: bug/fixhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%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.