DEV Community

Discussion on: Hacking the ASP.NET Core React SPA template for Vue.js

Collapse
paulvanbladel profile image
paul van bladel

Nice post.
There are clearly 2 different use cases when it comes to integrating vuejs with asp.net.

  1. (the case you are documenting here) Host a vuejs app inside asp.net in such a way the front-end is vueJs only but you can use asp.net additionally for e.g. serving web api requests. In short vuejs takes over the complete UI machinery, there is no asp.net involved. The same result could be achieved I believe by simply creating 2 separate 'projects', a vue-cli based one and the asp.net web api. In dev some simple proxy setting can make things work smoothly.
  2. 'really' combine both frameworks in the sense that there is still a notion of separate asp.net razor pages (or mvc) who (potentially ad hoc) have some vueJs magic in them to avoid oldschool jquery or to incorporate specific vuejs components. For use case 2 i have not yet seen an elegant solution, but i believe it would add more value than use case 1. Anyhow, happy to see Alexey that you are not only a DDD guru :) Thanks for sharing.
Collapse
alexeyzimarev profile image
Alexey Zimarev Author

Thanks for the feedback Paul :)

I was doing this when I was writing my first UI code for the book, so you can see the article as a side-effect of being involved in writing about DDD :)

I have no clear preference when it comes to choosing where the UI part of the application should live. I think in many cases it makes sense to have the whole app combined together. Speaking from DDD perspective, I'd rather have small apps that encapsulate the whole bounded context and combine such apps if necessary using UI composition in some kind of umbrella app.

The idea of my solution was to use Kestrel to host everything and when I build an app to a container, I just run the container and it all works.

Collapse
paulvanbladel profile image
paul van bladel

Hi Alexey.
I think we share the same spirit about UI: make it possible in the most simple and best maintainable way.
My best bet is currently blazor. Having one code paradigm, being able to use the full refactoring features of a real typed language (typescript still "evaporates", as it is called), etc ... can be a huge benefit.