René's URL Explorer Experiment


Title: property decorators break at runtime with ES2015 and circular deps · Issue #30141 · angular/angular · GitHub

Open Graph Title: property decorators break at runtime with ES2015 and circular deps · Issue #30141 · angular/angular

X Title: property decorators break at runtime with ES2015 and circular deps · Issue #30141 · angular/angular

Description: 🐞 bug report Affected Package The issue is caused by package @angular/core Is this a regression? No Description Using the `@Input()` property decorator (or any other property decorators I imagine) targetting ES2015 with a circular depend...

Open Graph Description: 🐞 bug report Affected Package The issue is caused by package @angular/core Is this a regression? No Description Using the `@Input()` property decorator (or any other property decorators I imagine) ...

X Description: 🐞 bug report Affected Package The issue is caused by package @angular/core Is this a regression? No Description Using the `@Input()` property decorator (or any other property decorators I imagine) ...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"property decorators break at runtime with ES2015 and circular deps","articleBody":"\u003c!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅\r\n\r\nOh hi there! 😄\r\n\r\nTo expedite issue processing please search open and closed issues before submitting a new one.\r\nExisting issues often contain information about workarounds, resolution, or progress updates.\r\n\r\n🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->\r\n\r\n\r\n# 🐞 bug report\r\n\r\n### Affected Package\r\n\u003c!-- Can you pin-point one or more @angular/* packages as the source of the bug? -->\r\n\u003c!-- ✍️edit: --> The issue is caused by package @angular/core\r\n\r\n\r\n### Is this a regression?\r\n\r\n\u003c!-- Did this behavior use to work in the previous version? -->\r\n\u003c!-- ✍️--> No\r\n\r\n\r\n### Description\r\n\r\n\u003c!-- ✍️--> Using the `@Input()` property decorator (or any other property decorators I imagine) targetting ES2015 with a circular dependency on a type will cause a `Uncaught ReferenceError` at runtime.\r\n\r\n\r\n## 🔬 Minimal Reproduction\r\n```\r\ngit clone https://github.com/filipesilva/istiti-circular-deps-es2015\r\ncd istiti-circular-deps-es2015\r\nng serve\r\n# src/app/autocomplete.directive.ts contains the problematic decorator and circular dep\r\n```\r\n\r\n## 🔥 Exception or Error\r\n\u003cpre>\u003ccode>\r\nmain.js:9545 Uncaught ReferenceError: Cannot access 'AutocompleteAbstract' before initialization\r\n    at Module.AutocompleteAbstract (main.js:9545)\r\n    at Module../src/app/autocomplete.directive.ts (main.js:9580)\r\n    at __webpack_require__ (runtime.js:79)\r\n    at Module../src/app/autocomplete.abstract.ts (main.js:9546)\r\n    at __webpack_require__ (runtime.js:79)\r\n    at Module../src/app/parent.component.ts (main.js:9605)\r\n    at __webpack_require__ (runtime.js:79)\r\n    at Module../src/app/app.module.ts (main.js:9507)\r\n    at __webpack_require__ (runtime.js:79)\r\n    at Module../src/main.ts (main.js:9666)\r\n\u003c/code>\u003c/pre>\r\n\r\n\r\n## 🌍  Your Environment\r\n\r\n**Angular Version:**\r\n\u003cpre>\u003ccode>\r\nAngular CLI: 8.0.0-beta.16\r\nNode: 10.10.0\r\nOS: win32 x64\r\nAngular: 8.0.0-beta.13\r\n... animations, common, compiler, compiler-cli, core, forms\r\n... language-service, platform-browser, platform-browser-dynamic\r\n... router\r\n\r\nPackage                           Version\r\n-----------------------------------------------------------\r\n@angular-devkit/architect         0.800.0-beta.16\r\n@angular-devkit/build-angular     0.800.0-beta.16\r\n@angular-devkit/build-optimizer   0.800.0-beta.16\r\n@angular-devkit/build-webpack     0.800.0-beta.16\r\n@angular-devkit/core              8.0.0-beta.16\r\n@angular-devkit/schematics        8.0.0-beta.16\r\n@angular/cli                      8.0.0-beta.16\r\n@ngtools/webpack                  8.0.0-beta.16\r\n@schematics/angular               8.0.0-beta.16\r\n@schematics/update                0.800.0-beta.16\r\nrxjs                              6.4.0\r\ntypescript                        3.4.4\r\nwebpack                           4.30.0\r\n\u003c/code>\u003c/pre>\r\n\r\n**Anything else relevant?**\r\n\r\ncc @istiti\r\n\r\nThis is similar to https://github.com/angular/angular/issues/30106. In this case it is not a constructor parameter type, but rather a class property type.\r\n\r\nA class property by itself doesn't need metadata with a type reference:\r\n```\r\n// transpiled src/app/autocomplete.directive.ts without Input() decorator\r\nimport * as tslib_1 from \"tslib\";\r\nimport { Directive } from '@angular/core';\r\nlet AutocompleteDirective = class AutocompleteDirective {\r\n    constructor() { }\r\n};\r\n// this is used in autocomplete.abstract.ts\r\nAutocompleteDirective.EMPTYLIST_ELEMENT = \"_EMPTYLIST_\";\r\nAutocompleteDirective = tslib_1.__decorate([\r\n    Directive({\r\n        selector: '[appAutocomplete]'\r\n    }),\r\n    tslib_1.__metadata(\"design:paramtypes\", [])\r\n], AutocompleteDirective);\r\nexport { AutocompleteDirective };\r\n```\r\n\r\nBut when the property is decorated, the metadata will contain a reference to the type:\r\n```\r\n// transpiled src/app/autocomplete.directive.ts with Input() decorator\r\nimport * as tslib_1 from \"tslib\";\r\nimport { Directive, Input } from '@angular/core';\r\nimport { AutocompleteAbstract } from './autocomplete.abstract';\r\nlet AutocompleteDirective = class AutocompleteDirective {\r\n    constructor() { }\r\n};\r\n// this is used in autocomplete.abstract.ts\r\nAutocompleteDirective.EMPTYLIST_ELEMENT = \"_EMPTYLIST_\";\r\ntslib_1.__decorate([\r\n    Input('appAutocomplete'),\r\n    tslib_1.__metadata(\"design:type\", AutocompleteAbstract)\r\n], AutocompleteDirective.prototype, \"autocomplete\", void 0);\r\nAutocompleteDirective = tslib_1.__decorate([\r\n    Directive({\r\n        selector: '[appAutocomplete]'\r\n    }),\r\n    tslib_1.__metadata(\"design:paramtypes\", [])\r\n], AutocompleteDirective);\r\nexport { AutocompleteDirective };\r\n```\r\n\r\nIn ES5 there are no `class` declarations, so TS instead uses a `var`. One important different between `var` and `class/let/const` is that the latter are all subject to the [Temporal Dead Zone](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let#Temporal_dead_zone). \r\n\r\nWithout the `Input()` decorator this isn't a problem because there is no circular dependency on the type.\r\n\r\n\r\n","author":{"url":"https://github.com/filipesilva","@type":"Person","name":"filipesilva"},"datePublished":"2019-04-26T10:03:37Z","url":"https://github.com/angular/angular/issues/30141"}

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:a18d30d5-4878-6182-7efa-1abf6d1ed09d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD0CA:1F65:174F8D8:1D9CA8F:6B0196CC
html-safe-nonce1281530b5d7a964ecd97f12a6a5ad0ff39dc5db798d8c3d2f95dc3a8e24166e2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMENBOjFGNjU6MTc0RjhEODoxRDlDQThGOjZCMDE5NkNDIiwidmlzaXRvcl9pZCI6IjQ3ODM4MjM4OTQyMTk5NTM4NjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaca764d76cd0a3942566864914eda508b5cb7ec3e9dd490695a598c8d6fa9054dd
hovercard-subject-tagissue:437598233
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/30141/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3db8c3519ac6ed3527ec55cb801f6b0cdbd3caa837b32e3184f1635d4d461e17/angular/angular/issues/30141
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3db8c3519ac6ed3527ec55cb801f6b0cdbd3caa837b32e3184f1635d4d461e17/angular/angular/issues/30141
og:image:alt🐞 bug report Affected Package The issue is caused by package @angular/core Is this a regression? No Description Using the `@Input()` property decorator (or any other property decorators I imagine) ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamefilipesilva
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/30141#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F30141
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%2F30141
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/30141
Reloadhttps://github.com/angular/angular/issues/30141
Reloadhttps://github.com/angular/angular/issues/30141
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues836 (836)https://github.com/angular/angular/issues
Pull requests143 (143)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/30141
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/30141
property decorators break at runtime with ES2015 and circular depshttps://github.com/angular/angular/issues/30141#top
https://github.com/devversion
area: compilerIssues related to `ngc`, Angular's template compilerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20compiler%22
design complexity: majorhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22design%20complexity%3A%20major%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
type: use-casehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20use-case%22
Backloghttps://github.com/angular/angular/milestone/82
https://github.com/filipesilva
filipesilvahttps://github.com/filipesilva
on Apr 26, 2019https://github.com/angular/angular/issues/30141#issue-437598233
@istitihttps://github.com/istiti
#30106https://github.com/angular/angular/issues/30106
Temporal Dead Zonehttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let#Temporal_dead_zone
Nexthttps://github.com/angular/angular/issues/30141?timeline_page=1
AndrewKushnirhttps://github.com/AndrewKushnir
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
on Apr 26, 2019https://github.com/angular/angular/issues/30141#event-2303889730
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
on Apr 26, 2019https://github.com/angular/angular/issues/30141#event-2303889768
alxhubhttps://github.com/alxhub
freq3: highhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22freq3%3A%20high%22
severity3: brokenhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22severity3%3A%20broken%22
on May 7, 2019https://github.com/angular/angular/issues/30141#event-2325716834
https://github.com/alxhub
alxhubhttps://github.com/alxhub
on May 7, 2019https://github.com/angular/angular/issues/30141#issuecomment-490283046
alxhubhttps://github.com/alxhub
type: bug/fixhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
on May 7, 2019https://github.com/angular/angular/issues/30141#event-2325718479
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
Backloghttps://github.com/angular/angular/milestone/82
on May 7, 2019https://github.com/angular/angular/issues/30141#event-2325718501
https://github.com/Alv3s
Alv3shttps://github.com/Alv3s
on Jan 8, 2020https://github.com/angular/angular/issues/30141#issuecomment-571992469
https://github.com/Venipa
Venipahttps://github.com/Venipa
on Feb 13, 2020https://github.com/angular/angular/issues/30141#issuecomment-585773592
pkozlowski-opensourcehttps://github.com/pkozlowski-opensource
area: compilerIssues related to `ngc`, Angular's template compilerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20compiler%22
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
on Mar 17, 2020https://github.com/angular/angular/issues/30141#event-3136866218
alxhubhttps://github.com/alxhub
design complexity: majorhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22design%20complexity%3A%20major%22
state: Blockedhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20Blocked%22
triage #1https://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22triage%20%231%22
on May 27, 2020https://github.com/angular/angular/issues/30141#event-3380373600
atscotthttps://github.com/atscott
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
401ef71https://github.com/angular/angular/commit/401ef71ae5b01be95d124184a0b6936fc453a5d4
on Jun 10, 2020https://github.com/angular/angular/issues/30141#event-3430478445
atscotthttps://github.com/atscott
on Jun 10, 2020https://github.com/angular/angular/issues/30141#event-3430478859
fix(compiler-cli): downlevel angular decorators to static properties (#…https://github.com/angular/angular/commit/323651bd38909b0f4226bcb6c8f5abafa91cf9d9
#…https://github.com/angular/angular/pull/37382
https://docs.github.com/articles/closing-issues-via-commit-messages
323651bhttps://github.com/angular/angular/commit/323651bd38909b0f4226bcb6c8f5abafa91cf9d9
ngwattcoshttps://github.com/ngwattcos
on Jun 25, 2020https://github.com/angular/angular/issues/30141#event-3483790000
fix(compiler-cli): downlevel angular decorators to static properties (a…https://github.com/ngwattcos/angular/commit/0e102c674b35ed80bcb590f9457dc946a89c4911
a…https://github.com/angular/angular/pull/37382
https://docs.github.com/articles/closing-issues-via-commit-messages
0e102c6https://github.com/ngwattcos/angular/commit/0e102c674b35ed80bcb590f9457dc946a89c4911
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Jul 11, 2020https://github.com/angular/angular/issues/30141#issuecomment-657088077
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 Jul 11, 2020https://github.com/angular/angular/issues/30141#event-3536405016
profanishttps://github.com/profanis
on Sep 5, 2020https://github.com/angular/angular/issues/30141#event-3732916046
fix(compiler-cli): downlevel angular decorators to static properties (a…https://github.com/profanis/angular/commit/fa320af64cd7fb594f9e9b452599f6a65476376b
a…https://github.com/angular/angular/pull/37382
https://docs.github.com/articles/closing-issues-via-commit-messages
fa320afhttps://github.com/profanis/angular/commit/fa320af64cd7fb594f9e9b452599f6a65476376b
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/30141
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/30141
devversionhttps://github.com/devversion
area: compilerIssues related to `ngc`, Angular's template compilerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20compiler%22
design complexity: majorhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22design%20complexity%3A%20major%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
type: use-casehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20use-case%22
BacklogNo due datehttps://github.com/angular/angular/milestone/82
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.