0

We have a mid size SPA that started as Vue, but we want to migrate to Angular because it's more mature and more intuitive for .NET developers. The problem is that the app is too big to just re-write it, so the goal would be to implement any new pages in Angular, and slowly convert page by page to Angular.

Also did anyone had a chance to run Angular component as part of Vue page? The Vue is in pure JavaScript and Angular must be in TypeScript for us to make sense.

Answers with code examples will be strongly appreciated.

Pawel Cioch
  • 2,895
  • 1
  • 30
  • 29
  • I doubt there are too many resources on the subject, so you need a good expertise with both to make it work. Can be done with any pair of frameworks. Here's an example with V2 and V3 https://stackoverflow.com/a/73547129/3731501 , since the apps are bundled separately there's not much difference if this were not Vue but something else. Another way are web components that both A and V support but due to their limitations I'd expect the problems to appear. – Estus Flask Mar 15 '23 at 15:54
  • Btw the decision is doubtful at least because Vue 3 has got some evolutional advantages and better DX, including reactivity. You can still benefit from A experience and enterprise patterns if you have to. A's DI is available via injection-js – Estus Flask Mar 15 '23 at 15:56
  • @EstusFlask seems like you may be related to Vue, maybe you are main dev... sorry I don't know but without hurting your feelings Vue way of thinking, execution, reactivity, magic, mixins, inheritance, etc, all that doesn't fit the way of thinking of .NET dev, at least not mine :) 1. Is it possible to run Vue using TS, and 2. Separate HTML from code, so page.vue would contain only the template and page.js the JS (ideally TS)? – Pawel Cioch Mar 21 '23 at 14:12
  • Went all the way from Angular 1 and 2 to Vue so I can understand why A2 seems more comfortable to C# and Java devs. I don't think this will really give a productivity boost in practice. There's still JS under the hood and everything including classes is very different from those langs. A2 is just quite verbose and opinionated, some of the design moves felt right in 2015 but inefficient in 23. A2 to V3 transition is much more common than the opposite. There may be reasons to stick to the former but they can be firmly deduced, and DX is certainly not one of them. – Estus Flask Mar 21 '23 at 14:38
  • 1. Totally, with Vue composition api only. Component classes are legacy because they never had proper type support in TS. Same problem for A2 btw, it heavily relies on class decorators, while they have always been type-unsafe in TS and this hasn't changed until now, was just a bad decision in hindsight . 2. Should be possible https://vuejs.org/api/sfc-spec.html#src-imports Though it's a wrong POV to keep them separated because they are parts of the same unit, a component. Btw it's the same in A2. And this is orthogonal to now-preferred "script setup" syntax in Vue – Estus Flask Mar 21 '23 at 14:47

0 Answers0