Title: Regression - Decorators · Issue #37068 · angular/angular · GitHub
Open Graph Title: Regression - Decorators · Issue #37068 · angular/angular
X Title: Regression - Decorators · Issue #37068 · angular/angular
Description: Currently, we cannot upgrade to Angular 9.0 Ivy because of the regressions introduced by the Ivy compiler. If #35464 is not merged, we will have to stop upgrading Angular and leave it at version 9.0 indefinitely. I am sharing this issue ...
Open Graph Description: Currently, we cannot upgrade to Angular 9.0 Ivy because of the regressions introduced by the Ivy compiler. If #35464 is not merged, we will have to stop upgrading Angular and leave it at version 9....
X Description: Currently, we cannot upgrade to Angular 9.0 Ivy because of the regressions introduced by the Ivy compiler. If #35464 is not merged, we will have to stop upgrading Angular and leave it at version 9....
Opengraph URL: https://github.com/angular/angular/issues/37068
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Regression - Decorators","articleBody":"Currently, we cannot upgrade to Angular 9.0 Ivy because of the regressions introduced by the Ivy compiler. If #35464 is not merged, we will have to stop upgrading Angular and leave it at version 9.0 indefinitely.\r\n\r\nI am sharing this issue primarily so the Angular team can see how users are using Custom Decorators in the wild. I suspect I'm not the only one doing something like this.\r\n\r\n### Description\r\n\r\nWe develop an `Nx` workspace app, with multiple shared libraries powering both a Desktop, and Mobile application - responsive design doesn't cut it for our use case. In addition, we also have separate administrator views, and client libraries which are all generated from the same source code.\r\n\r\nAs such, dependency injection doesn't always meet our use case, even with the `@Optonal` decorator. Many of our components end up being shared between Mobile and Desktop, User and Administrator contexts, and as much as we can simplify their logic, we try to do so.\r\n\r\nCurrently, we use custom decorators to wire components in to pieces of the application which may, or may not be present. A great example is how we integrate with the map; In the Desktop application, a large on-screen map is available to most components. When users are entering addresses, they can click on the map, drag the pin around, etc. When on the Mobile application, this is not available.\r\n\r\nThe following code is how we connect the pin to the map in our application:\r\n\r\n````ts\r\n\r\n@Component({\r\n selector: 'app-foo',\r\n template: `\r\nThe origin pin is at {{orig?.lat}}, {{orig?.lng}}.\r\n\u003cbutton (click)=\"centerOnEmpireStateBuilding()\">Center\u003c/button>\r\n\u003cbutton (click)=\"removePin()\">Hide Pin\u003c/button>\r\n`\r\n})\r\n// Wires up necesary parts, Object.defineProperty etc. on `ngOnInit`\r\n@MapConnectedComponent()\r\nexport class FooComponent {\r\n \r\n // Actually connects this property to the map in a two-way databinding\r\n @MapConnectedAddress('orig')\r\n pin: {lat:number; lng: number;}\r\n\r\n centerOnEmpireStateBuilding() {\r\n // This will move the pin on the map to the appropriate location as well.\r\n this.pin = {lat: 40.7484, lng:-73.9857};\r\n }\r\n\r\n removePin() {\r\n // This will remove the pin\r\n this.pin = null;\r\n }\r\n}\r\n\r\n````\r\n\r\nBecause we have a small team of mostly junior developers, we try to focus on our developer experience heavily. Custom Decorators like this provide many benefits, chiefly among them:\r\n\r\n 1. Declarative vs. Imperative programming\r\n 2. Easy instruction for Jr developers - practically self documenting code.\r\n 3. Free adherence to the Open / Closed principle, without need for inheritence.\r\n\r\n\r\n### Conclusion\r\n\r\n#35464 is a blocker for us; We really don't want to unravel all the custom decorators we've developed (this is just one of the examples) just so that Angular can have a minuscule benefit in start up performance. \r\n\r\nWith Angular 8.0 I was able to achieve a very concise, easy to explain process. Before the decorators, each address which needed to be connected to the map, required 8 - 10 lines of code, not to mention injecting the right service, etc. Now, it's two decorators.\r\n\r\nI hope this has been illuminating in how Metaprogramming is used in the wild, and helps you understand the user base better.\r\n\r\n","author":{"url":"https://github.com/bryanrideshark","@type":"Person","name":"bryanrideshark"},"datePublished":"2020-05-12T14:06:59Z","url":"https://github.com/angular/angular/issues/37068"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:80a9e7a5-0ded-022b-7aec-028234e90d2e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EBA2:1F4E:20A051:2B0FA3:6B01451B |
| html-safe-nonce | ede4deb7440a1da7e5628de0dab4c45d3974763e630f78c853dab180e2e83350 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQkEyOjFGNEU6MjBBMDUxOjJCMEZBMzo2QjAxNDUxQiIsInZpc2l0b3JfaWQiOiI4NjA0MjI5NjQwODIwNzA0NTM5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 58f7d9fe0450d403f0430bcd7ab7f48e9a23104e5c5741d15a4c3ef8a16bef7a |
| hovercard-subject-tag | issue:616686232 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/37068/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e3c6d34d167de850cfa9c26e718b3b62357da905341a65260e23baa40ab1a36a/angular/angular/issues/37068 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e3c6d34d167de850cfa9c26e718b3b62357da905341a65260e23baa40ab1a36a/angular/angular/issues/37068 |
| og:image:alt | Currently, we cannot upgrade to Angular 9.0 Ivy because of the regressions introduced by the Ivy compiler. If #35464 is not merged, we will have to stop upgrading Angular and leave it at version 9.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bryanrideshark |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width