dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.37k stars 9.99k forks source link

Add scaffolding for Vue.js SPA #6762

Closed livarcocc closed 5 years ago

livarcocc commented 5 years ago

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

awulkan commented 5 years ago

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.

jmazouri commented 5 years ago

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.

snobu commented 5 years ago

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

awulkan commented 5 years ago

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.

alexeyzimarev commented 5 years ago

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.

alexeyzimarev commented 5 years ago

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.

mkArtakMSFT commented 5 years ago

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.