Aspnetcore: Add scaffolding for Vue.js SPA

Created on 16 Jan 2019  路  7Comments  路  Source: dotnet/aspnetcore

_From @snobu on January 16, 2019 11:40_

Please consider adding Vue.js SPA scaffolding. Vue is popular enough to deserve its own scaffolding entry in the dotnet CLI. Right now only React and Angular SPAs are being generated.

$ dotnet new | grep SPA
ASP.NET Core with Angular                      angular            [C#]          Web/MVC/SPA
ASP.NET Core with React.js                     react              [C#]          Web/MVC/SPA
ASP.NET Core with React.js and Redux           reactredux         [C#]          Web/MVC/SPA

_Copied from original issue: dotnet/cli#10615_

area-mvc

Most helpful comment

Not that stars on GitHub matter a lot, but Vue has surpassed both React and Angular now. And with the upcoming Vue 3 I think it will only keep on rising.

If I remember correctly they removed he Vue template due to lack of time for maintaining it. It would be awesome if it was available though since it would help a lot of people getting started! I hope it will at least be considered as a possibility.

With Vue CLI 3 it is now super easy to maintain Vue projects. So as long as there was a minimal .NET Core + Vue template, developers could add on custom parts to it themselves, such as scss, test frameworks, typescript, Vuex, etc. Which means it wouldn't have to be a very complex template at all. I think most developers are familiar with Vue, they just need help getting it hooked up correctly with .NET Core.

All 7 comments

Not that stars on GitHub matter a lot, but Vue has surpassed both React and Angular now. And with the upcoming Vue 3 I think it will only keep on rising.

If I remember correctly they removed he Vue template due to lack of time for maintaining it. It would be awesome if it was available though since it would help a lot of people getting started! I hope it will at least be considered as a possibility.

With Vue CLI 3 it is now super easy to maintain Vue projects. So as long as there was a minimal .NET Core + Vue template, developers could add on custom parts to it themselves, such as scss, test frameworks, typescript, Vuex, etc. Which means it wouldn't have to be a very complex template at all. I think most developers are familiar with Vue, they just need help getting it hooked up correctly with .NET Core.

Templates for Vue (as well as Aurelia and Knockout) exist as part of the Microsoft.AspNetCore.SpaTemplates package - which is still available on Nuget, though it is unmaintained, and thus out of date. They were deprecated back in February , with the stipulation that

In the long term, if another JavaScript SPA framework becomes dominant, we will of course consider adding a template for it to the SDK templates package.

I hope the team reconsiders their position, at least for Vue, as it has grown in popularity considerably since the decision was made to remove it.

@sdras, can you maintain this if it gets greenlight?

I think the are a lot of people that would help maintaining it. I could probably dedicate some of my time to it as well.

It is better to do it either as a part of the core template pack or as a separate template. The old SpaTemplates package contains templates that are conflicting with the standard templates (Angular and React).

I managed to make my Vue app work based on the React template, but it involves changing the serve command code. A good start would be at least to have the development server mddleware available, so hacking Vue CLI node modules won't be required (https://github.com/aspnet/AspNetCore/issues/5214). It could've been easily done as a separate package, but lots of the classes that the React middleware uses are internal, so such a package would need to include all that code.

We need #7046 to get through to have a proper Vue CLI support for development. The template itself will become rather trivial since the differences with the React template would be marginal.

Thanks for contacting us, folks.
We have no plans to add Vue.js template. But, we're interested enabling the Vue.js community to build and maintain a template as a package so that other members can use that for creating new Vue.js apps hosted on ASP.NET Core.
As part of this effort we're working on making an experience for using templates acquired from NuGet in VS better. Also, we're considering looking at making some improvements in the SPA services area to enable better integration with any JS based frameworks - including Vue.js.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

UweKeim picture UweKeim  路  3Comments

farhadibehnam picture farhadibehnam  路  3Comments

FourLeafClover picture FourLeafClover  路  3Comments

rynowak picture rynowak  路  3Comments

markrendle picture markrendle  路  3Comments