René's URL Explorer Experiment


Title: Libraries sometimes depend on tsickle decorator downleveling · Issue #30586 · angular/angular · GitHub

Open Graph Title: Libraries sometimes depend on tsickle decorator downleveling · Issue #30586 · angular/angular

X Title: Libraries sometimes depend on tsickle decorator downleveling · Issue #30586 · angular/angular

Description: 🐞 bug report Affected Package The issue is caused by package @angular/.... @angular/compiler-cli / @angular/bazel Is this a regression? No Description Angular applications which are built with NGC but aren't setting up tsickle for decora...

Open Graph Description: 🐞 bug report Affected Package The issue is caused by package @angular/.... @angular/compiler-cli / @angular/bazel Is this a regression? No Description Angular applications which are built with NGC ...

X Description: 🐞 bug report Affected Package The issue is caused by package @angular/.... @angular/compiler-cli / @angular/bazel Is this a regression? No Description Angular applications which are built with NGC ...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Libraries sometimes depend on tsickle decorator downleveling","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/....\r\n\r\n`@angular/compiler-cli` / `@angular/bazel`\r\n\r\n### Is this a regression?\r\n\r\nNo\r\n\r\n### Description\r\n\r\nAngular applications which are built with NGC but aren't setting up `tsickle` for decorator downleveling (e.g. don't set the `annotationsAs: \"static fields\"`), can't be rendered on the server if DOM-specific types are referenced on class members which are decorated.\r\n\r\ne.g.\r\n\r\n```ts\r\n@Directive(...)\r\nexport class MyDirective {\r\n  @Input() triggerElement: HTMLElement;\r\n}\r\n```\r\n\r\nThis results in the following ES5 JavaScript output if `tsickle` is **not enabled**\r\n\r\n```js\r\n    __decorate([\r\n        core_1.Input(),\r\n        __metadata(\"design:type\", HTMLElement)\r\n    ], MyDirective.prototype, \"triggerElement\");\r\n```\r\nNotice how the `__decorate` call tries to access `HTMLELement` from a global context. This causes an exception when the following file is executed in NodeJS since DOM APIs are not available. We mock most of the DOM APIs with `domino` but providing these mocks globally so that such failures can be avoided is not common right now.\r\n\r\nBuilding the project **with tsickle** fixes the problem automatically as decorators are downleveled into a static field while `tsickle` also discards the type reference to `HTMLElement` (as it is not relevant for Angular).\r\n\r\n```js\r\nMyDirective.propDecorators = {\r\n  triggerElement: [{ type: core_1.Input }]\r\n};\r\n```\r\n\r\nTL;DR: \r\n\r\n1) Everything currently works as expected within the CLI since it provides optimizations that removes the decorators anyway when using AOT mode or build-optimizer.\r\n2) It becomes an issue if a project is not built with the CLI / and does not use build-optimizer. Previously tsickle was part of the NGC workflow **by default**.. so it now causes unexpected failures. Needs documentation? See: https://github.com/angular/angular/commit/29761ea5f8e4bae68442236f4a0abc1666487a35\r\n\r\n**How is Angular Bazel affected?**\r\n\r\nWith Bazel it is not possible to opt-in for tsickle's decorator downleveling. Tsickle can be enabled by passing the `bazelOptions: {tsickle: true}`, but that comes with more tsickle transformations which aren't desired. e.g. type imports are rewritten to `goog.requireType`.\r\n\r\n## 🔬 Minimal Reproduction\r\n\r\nhttps://github.com/devversion/ngc-without-tsickle\r\n\r\n## 🔥 Exception or Error\r\n\u003cpre>\u003ccode>__metadata(\"design:type\", HTMLElement)\r\n                                  ^\r\nReferenceError: HTMLElement is not defined\r\n\u003c/code>\u003c/pre>\r\n\r\n\r\n## 🌍  Your Environment\r\n\r\n**Angular Version:**\r\n\u003cpre>\u003ccode>Latest: 8.0.0-rc.4\u003c/code>\u003c/pre>\r\n\r\n**Anything else relevant?**\r\n\r\n","author":{"url":"https://github.com/devversion","@type":"Person","name":"devversion"},"datePublished":"2019-05-21T09:26:26Z","url":"https://github.com/angular/angular/issues/30586"}

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:45bf4c4e-b73a-0099-93af-0f04d43d8865
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDF72:8AE25:1D242B:26504A:6B018A09
html-safe-nonce528dc6a06b5e97a0b84fea4f756e9ba1a6ccf084981fb29d71ed8e44f8dcff5e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjcyOjhBRTI1OjFEMjQyQjoyNjUwNEE6NkIwMThBMDkiLCJ2aXNpdG9yX2lkIjoiNjAwMTk3ODIyOTcwMTgzOTM2OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac9fe98537a9ad5de44700471635bf0f2eaf2eb7ec383d3b5918473a27b6d40459
hovercard-subject-tagissue:446511402
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/30586/issue_layout
twitter:imagehttps://opengraph.githubassets.com/14ad1e77623ab50c7e43aca4bb87873006586413276f9d640f85e5e75ee35097/angular/angular/issues/30586
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/14ad1e77623ab50c7e43aca4bb87873006586413276f9d640f85e5e75ee35097/angular/angular/issues/30586
og:image:alt🐞 bug report Affected Package The issue is caused by package @angular/.... @angular/compiler-cli / @angular/bazel Is this a regression? No Description Angular applications which are built with NGC ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedevversion
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/30586#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F30586
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%2F30586
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/30586
Reloadhttps://github.com/angular/angular/issues/30586
Reloadhttps://github.com/angular/angular/issues/30586
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues836 (836)https://github.com/angular/angular/issues
Pull requests142 (142)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/30586
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/30586
Libraries sometimes depend on tsickle decorator downlevelinghttps://github.com/angular/angular/issues/30586#top
https://github.com/devversion
area: bazelIssues related to the published `@angular/bazel` build ruleshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20bazel%22
area: compilerIssues related to `ngc`, Angular's template compilerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20compiler%22
freq3: highhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22freq3%3A%20high%22
hotlist: components teamRelated to Angular CDK or Angular Materialhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22hotlist%3A%20components%20team%22
type: bug/fixhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
Backloghttps://github.com/angular/angular/milestone/82
https://github.com/devversion
devversionhttps://github.com/devversion
on May 21, 2019https://github.com/angular/angular/issues/30586#issue-446511402
29761eahttps://github.com/angular/angular/commit/29761ea5f8e4bae68442236f4a0abc1666487a35
https://github.com/devversion/ngc-without-tsicklehttps://github.com/devversion/ngc-without-tsickle
Nexthttps://github.com/angular/angular/issues/30586?timeline_page=1
devversionhttps://github.com/devversion
on May 21, 2019https://github.com/angular/angular/issues/30586#event-2355519698
devversionhttps://github.com/devversion
fixed by Ivyhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22fixed%20by%20Ivy%22
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
on May 21, 2019https://github.com/angular/angular/issues/30586#event-2355520300
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
on May 21, 2019https://github.com/angular/angular/issues/30586#event-2355520772
devversionhttps://github.com/devversion
hotlist: components teamRelated to Angular CDK or Angular Materialhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22hotlist%3A%20components%20team%22
area: bazelIssues related to the published `@angular/bazel` build ruleshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20bazel%22
on May 21, 2019https://github.com/angular/angular/issues/30586#event-2355520956
https://github.com/Splaktar
Splaktarhttps://github.com/Splaktar
on May 21, 2019https://github.com/angular/angular/issues/30586#issuecomment-494575339
angular/angular-cli#14473https://github.com/angular/angular-cli/pull/14473
https://github.com/alan-agius4
alan-agius4https://github.com/alan-agius4
on May 22, 2019https://github.com/angular/angular/issues/30586#issuecomment-494735538
@alexeaglehttps://github.com/alexeagle
@vikermanhttps://github.com/vikerman
angular/angular-cli#14473https://github.com/angular/angular-cli/pull/14473
angular/tsickle#922https://github.com/angular/tsickle/pull/922
https://github.com/devversion
devversionhttps://github.com/devversion
on May 22, 2019https://github.com/angular/angular/issues/30586#issuecomment-494741290
https://github.com/alexeagle
alexeaglehttps://github.com/alexeagle
on May 22, 2019https://github.com/angular/angular/issues/30586#issuecomment-494846937
angular/angular-cli#14473https://github.com/angular/angular-cli/pull/14473
https://github.com/devversion
devversionhttps://github.com/devversion
on May 22, 2019https://github.com/angular/angular/issues/30586#issuecomment-494865009
https://github.com/clydin
clydinhttps://github.com/clydin
on May 22, 2019https://github.com/angular/angular/issues/30586#issuecomment-494898597
relevant TS codehttps://github.com/microsoft/TypeScript/blob/master/src/compiler/transformers/ts.ts#L1668
https://github.com/clydin
clydinhttps://github.com/clydin
on May 22, 2019https://github.com/angular/angular/issues/30586#issuecomment-494900133
https://github.com/microsoft/TypeScript/blob/master/src/compiler/transformers/ts.ts#L1659https://github.com/microsoft/TypeScript/blob/master/src/compiler/transformers/ts.ts#L1659
https://github.com/trotyl
trotylhttps://github.com/trotyl
on May 23, 2019https://github.com/angular/angular/issues/30586#issuecomment-495111952
@clydinhttps://github.com/clydin
angular/tsickle#635https://github.com/angular/tsickle/issues/635
https://github.com/clydin
clydinhttps://github.com/clydin
on May 23, 2019https://github.com/angular/angular/issues/30586#issuecomment-495223759
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/30586#event-3430478359
atscotthttps://github.com/atscott
on Jun 10, 2020https://github.com/angular/angular/issues/30586#event-3430478844
fix(compiler-cli): downlevel angular decorators to static properties (#…https://github.com/angular/angular/commit/323651bd38909b0f4226bcb6c8f5abafa91cf9d9
#…https://github.com/angular/angular/pull/37382
323651bhttps://github.com/angular/angular/commit/323651bd38909b0f4226bcb6c8f5abafa91cf9d9
ngwattcoshttps://github.com/ngwattcos
on Jun 25, 2020https://github.com/angular/angular/issues/30586#event-3483789997
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
0e102c6https://github.com/ngwattcos/angular/commit/0e102c674b35ed80bcb590f9457dc946a89c4911
profanishttps://github.com/profanis
on Sep 5, 2020https://github.com/angular/angular/issues/30586#event-3732916044
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
fa320afhttps://github.com/profanis/angular/commit/fa320af64cd7fb594f9e9b452599f6a65476376b
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/30586
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/30586
devversionhttps://github.com/devversion
area: bazelIssues related to the published `@angular/bazel` build ruleshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20bazel%22
area: compilerIssues related to `ngc`, Angular's template compilerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20compiler%22
freq3: highhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22freq3%3A%20high%22
hotlist: components teamRelated to Angular CDK or Angular Materialhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22hotlist%3A%20components%20team%22
type: bug/fixhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%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.