René's URL Explorer Experiment


Title: Proposal: AOT Compiler instructions · Issue #14128 · angular/angular · GitHub

Open Graph Title: Proposal: AOT Compiler instructions · Issue #14128 · angular/angular

X Title: Proposal: AOT Compiler instructions · Issue #14128 · angular/angular

Description: [ ] bug report => search github for a similar issue or PR before submitting [x] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#...

Open Graph Description: [ ] bug report => search github for a similar issue or PR before submitting [x] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angu...

X Description: [ ] bug report => search github for a similar issue or PR before submitting [x] feature request [ ] support request => Please do not submit support request here, instead see https://github.co...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Proposal: AOT Compiler instructions","articleBody":"```\r\n[ ] bug report => search github for a similar issue or PR before submitting\r\n[x] feature request\r\n[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\r\n```\r\n\r\n**Current behavior**\r\nCurrently, the AOT compiler is very strict and requires every object involved in DI / metadata to resolve to a symbol that the AOT compiler can work with.\r\n\r\nIt is so strict that in some scenarios, even though the symbol information is not required, it will still fail (#12631, #13138)\r\n\r\nIt makes it difficult to write custom decorators to angular component or classes that are `@Injectable`\r\n\r\nIt is clear why all items in `providers` must resolve to a known symbol, but custom decorators for a `@Component` class can fail even though it's not important.\r\n\r\nIt also creates coupling between the compiler and the core. In general it must know about every runtime generated object even if the type is known in design time (via generic).\r\n\r\nTo solve this, the compiler workaround is to import core and register a bypass to all `core` decorators\r\n\r\n```ts\r\n   this._registerDecoratorOrConstructor(this.findDeclaration(diDecorators, 'Host'), Host);\r\n    this._registerDecoratorOrConstructor(\r\n        this.findDeclaration(diDecorators, 'Injectable'), Injectable);\r\n    this._registerDecoratorOrConstructor(this.findDeclaration(diDecorators, 'Self'), Self);\r\n```\r\n\r\nSee [code](https://github.com/angular/angular/blob/master/modules/%40angular/compiler/src/aot/static_reflector.ts#L233-L284)\r\n\r\nThis behaviour make is almost impossible to customise angular, you can customise in JIT but not in AOT.    \r\nSince the compiler can not get instructions how to resolve symbols for dynamic objects the experience between JIT and AOT is different.\r\n\r\n**Expected behavior**\r\nAllow developers to provide instruction to the compiler.\r\n\r\nThe best approach would be to use **design-time decorators**, not yet supported Microsoft/TypeScript#2900\r\n\r\nThis gives the user the ability to provide design time information to the AOT compiler.  \r\n\r\nUntil it lands a workaround to remove it can be using a webpack loader either via [Transformers API](https://github.com/Microsoft/TypeScript/pull/11561) or through a simple loader that removes that code in 2 places.\r\n\r\nA great use case is mixins. Now that Microsoft/TypeScript#13604 is in master, and will be in 2.2 this is really important for implementing the mixin pattern.\r\n\r\n```ts\r\nclass User_ {\r\n}\r\n\r\nexport const User = RestMixin(User);\r\nexport type User = User_ & Mixin\r\n```\r\n\r\nCurrently, this will fail if `User` is included as a provider.  \r\nThere is no actual reason for it to fail since `RestMixin` returns all the type information.  \r\nIt fails because the compiler can't resolve `User` into a symbol since it is dealing with complex function (RestMixin)\r\n\r\nIf I could notify the compiler what to do no compilation error.\r\nIn this case telling the compiler to resolve the symbol of `User_` to `User`\r\n\r\nIn the current code I tried it via this hack, it worked:\r\n\r\n```\r\nif (staticSymbol.name === 'RestMixin') converter = (ctx, args) => { return args[0]};\r\n```\r\n\r\n\r\n@mhevery @tbosch ","author":{"url":"https://github.com/shlomiassaf","@type":"Person","name":"shlomiassaf"},"datePublished":"2017-01-26T23:35:09Z","url":"https://github.com/angular/angular/issues/14128"}

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:d875d6f2-d7f7-7f65-0f2c-8bcfe9793b6d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9E5E:1AE20C:3FFEEC:529A17:6B00D419
html-safe-nonce22ae99a5b07d468dc1f8dc4a9e7f206f6ac5c6c21aaba659976229a08a28a6aa
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTVFOjFBRTIwQzozRkZFRUM6NTI5QTE3OjZCMDBENDE5IiwidmlzaXRvcl9pZCI6IjI1NDIwNzM0MTkyNDQwMzMwNDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac9737b2ea043742b6742e141ee721dff50cb6e062959885bc6f5ec35c87f83d58
hovercard-subject-tagissue:203521095
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/14128/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d34a129e6b066bb4e30a061c2640d10305c794c7848cf4d8f4f2ca8aac6a68fa/angular/angular/issues/14128
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d34a129e6b066bb4e30a061c2640d10305c794c7848cf4d8f4f2ca8aac6a68fa/angular/angular/issues/14128
og:image:alt[ ] bug report => search github for a similar issue or PR before submitting [x] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angu...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameshlomiassaf
hostnamegithub.com
expected-hostnamegithub.com
None85bbdfe2b6ba16e234513bc6ceff5d848ef8449820c900692a2b4e67061931e5
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
release4943239a6d2c591325dad6e5c313e1cafda877f6
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/14128#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F14128
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%2F14128
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/14128
Reloadhttps://github.com/angular/angular/issues/14128
Reloadhttps://github.com/angular/angular/issues/14128
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues835 (835)https://github.com/angular/angular/issues
Pull requests139 (139)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/14128
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/14128
Proposal: AOT Compiler instructionshttps://github.com/angular/angular/issues/14128#top
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
needs reproductionThis issue needs a reproduction in order for the team to investigate furtherhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22needs%20reproduction%22
Backloghttps://github.com/angular/angular/milestone/82
https://github.com/shlomiassaf
shlomiassafhttps://github.com/shlomiassaf
on Jan 26, 2017https://github.com/angular/angular/issues/14128#issue-203521095
#12631https://github.com/angular/angular/issues/12631
#13138https://github.com/angular/angular/issues/13138
codehttps://github.com/angular/angular/blob/master/modules/%40angular/compiler/src/aot/static_reflector.ts#L233-L284
microsoft/TypeScript#2900https://github.com/microsoft/TypeScript/issues/2900
Transformers APIhttps://github.com/Microsoft/TypeScript/pull/11561
microsoft/TypeScript#13604https://github.com/microsoft/TypeScript/pull/13604
@mheveryhttps://github.com/mhevery
@tboschhttps://github.com/tbosch
https://github.com/mhevery
mheveryhttps://github.com/mhevery
on Jan 28, 2017https://github.com/angular/angular/issues/14128#issuecomment-275825862
@chuckjazhttps://github.com/chuckjaz
https://github.com/chuckjaz
chuckjazhttps://github.com/chuckjaz
on Jan 28, 2017https://github.com/angular/angular/issues/14128#issuecomment-275872260
#13605https://github.com/angular/angular/issues/13605
https://github.com/shlomiassaf
shlomiassafhttps://github.com/shlomiassaf
on Jan 30, 2017https://github.com/angular/angular/issues/14128#issuecomment-275965846
@chuckjazhttps://github.com/chuckjaz
codehttps://github.com/angular/angular/blob/master/modules/%40angular/compiler/src/aot/static_reflector.ts#L233-L284
microsoft/TypeScript#13743https://github.com/microsoft/TypeScript/pull/13743
https://github.com/chuckjaz
chuckjazhttps://github.com/chuckjaz
on Jan 30, 2017https://github.com/angular/angular/issues/14128#issuecomment-276142326
#14154https://github.com/angular/angular/issues/14154
microsoft/TypeScript#13743https://github.com/microsoft/TypeScript/pull/13743
https://github.com/shlomiassaf
shlomiassafhttps://github.com/shlomiassaf
on Jan 31, 2017https://github.com/angular/angular/issues/14128#issuecomment-276292781
@chuckjazhttps://github.com/chuckjaz
https://github.com/chuckjaz
chuckjazhttps://github.com/chuckjaz
on Jan 31, 2017https://github.com/angular/angular/issues/14128#issuecomment-276448915
https://github.com/shlomiassaf
shlomiassafhttps://github.com/shlomiassaf
on Feb 6, 2017https://github.com/angular/angular/issues/14128#issuecomment-277751194
@chuckjazhttps://github.com/chuckjaz
https://github.com/chuckjaz
chuckjazhttps://github.com/chuckjaz
on Feb 7, 2017https://github.com/angular/angular/issues/14128#issuecomment-278093776
#14154https://github.com/angular/angular/issues/14154
https://github.com/shlomiassaf
shlomiassafhttps://github.com/shlomiassaf
on Feb 13, 2017https://github.com/angular/angular/issues/14128#issuecomment-279288268
@chuckjazhttps://github.com/chuckjaz
@mheveryhttps://github.com/mhevery
https://github.com/DzmitryShylovich
DzmitryShylovichhttps://github.com/DzmitryShylovich
on Mar 25, 2017https://github.com/angular/angular/issues/14128#issuecomment-289247159
@shlomiassafhttps://github.com/shlomiassaf
#14154https://github.com/angular/angular/issues/14154
https://github.com/tbosch
tboschhttps://github.com/tbosch
on Apr 10, 2017https://github.com/angular/angular/issues/14128#issuecomment-292999184
@shlomiassafhttps://github.com/shlomiassaf
tboschhttps://github.com/tbosch
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
flag: can be closed?https://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22flag%3A%20can%20be%20closed%3F%22
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
on Apr 10, 2017https://github.com/angular/angular/issues/14128#event-1036770672
https://github.com/shlomiassaf
shlomiassafhttps://github.com/shlomiassaf
on Apr 12, 2017https://github.com/angular/angular/issues/14128#issuecomment-293681705
@tboschhttps://github.com/tbosch
@DzmitryShylovichhttps://github.com/DzmitryShylovich
@chuckjazhttps://github.com/chuckjaz
tboschhttps://github.com/tbosch
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Apr 12, 2017https://github.com/angular/angular/issues/14128#event-1040874664
https://github.com/crh225
crh225https://github.com/crh225
on May 12, 2017https://github.com/angular/angular/issues/14128#issuecomment-301189710
@shlomiassafhttps://github.com/shlomiassaf
@tboschhttps://github.com/tbosch
https://github.com/shlomiassaf
shlomiassafhttps://github.com/shlomiassaf
on May 12, 2017https://github.com/angular/angular/issues/14128#issuecomment-301199021
@tboschhttps://github.com/tbosch
https://github.com/tbosch
tboschhttps://github.com/tbosch
on May 12, 2017https://github.com/angular/angular/issues/14128#issuecomment-301205736
@shlomiassafhttps://github.com/shlomiassaf
tboschhttps://github.com/tbosch
needs reproductionThis issue needs a reproduction in order for the team to investigate furtherhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22needs%20reproduction%22
flag: can be closed?https://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22flag%3A%20can%20be%20closed%3F%22
on May 12, 2017https://github.com/angular/angular/issues/14128#event-1080779036
tboschhttps://github.com/tbosch
on May 12, 2017https://github.com/angular/angular/issues/14128#event-1080779240
chuckjazhttps://github.com/chuckjaz
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
on Nov 21, 2017https://github.com/angular/angular/issues/14128#event-1353092731
ngbothttps://github.com/apps/ngbot
Backloghttps://github.com/angular/angular/milestone/82
on Jan 23, 2018https://github.com/angular/angular/issues/14128#event-1437624398
https://github.com/vicb
vicbhttps://github.com/vicb
on May 31, 2018https://github.com/angular/angular/issues/14128#issuecomment-393701628
vicbhttps://github.com/vicb
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on May 31, 2018https://github.com/angular/angular/issues/14128#event-1657119092
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/14128#issuecomment-531312184
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/14128#event-2632958995
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/14128
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/14128
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
needs reproductionThis issue needs a reproduction in order for the team to investigate furtherhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22needs%20reproduction%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.