aspnetcore-Vue-starter
aspnetcore-Vue-starter copied to clipboard
Proposal: Typescript support
Are there any plans for Typescript support? It would be great, to have static type checking, while working on complex projects with this template.
Hey there, so Steve Sanderson from the ASPNet team has actually taken this exact project here and added TypeScript to it. 🎁
https://github.com/aspnet/templating/tree/dev/src/Microsoft.AspNetCore.SpaTemplates/content/Vue-CSharp
The goal here was to keep it in ES6+ for the time being, especially since TypeScript hasn't been fully adopted by the Vue community yet.
Me personally, I only use TypeScript :)
I saw that project, the problem in it, is dividing Vue components into multiple files, so e.g. Vetur, doesn't handle this situation. So, I want best solutions, from both the projects.
Here is an example where TypeScript is very well integrated to Single File Components: https://github.com/DanielRosenwasser/typescript-vue-todomvc
The tutorial for integrating TypeScript into Vue by the same author: https://github.com/DanielRosenwasser/typescript-vue-tutorial
Here is an example how current template could be integrated with TypeScript: https://github.com/vipetrul/aspnetcore-Vue-starter/tree/type-script-support
Things to do:
- git-ignore js files that were generated by ts
- I was not able to augment $http service, VS Code still doesn't recognize it
I hope you will find this example useful.
Hi, I have been trying to find a way to, using Visual Studio 2017, Vue 2.x, .Net Core 2.1 and TypeScript to be able to have a NON-SPA type application. Meaning each View (or Razor Page) would have a script tag to load its own transpiled .js file. If it has to also load Vue.js, that is fine. If it gets merged into the MyPage1.js and MyPage2.js then that is fine as well.
Seems like most out there are geared towards SPA but that is overkill for this project. Just trying to find the simplest way to use ES6 coding in TypeScript but having it be able to work in IE 11 (project requirement.)
Thanks in advance.
@Grandizer , in webpack.config.js there a line entry: { 'main': './ClientApp/boot-app.js' },
You can add more entries for each root page, which will produce a separate <pageName>.js file which then can be manually referenced in each razor page.
+1 for support for Typescript. I'm running into several errors when trying to implement it. @vipetrul thanks for including a fork with Typescript, although I'd also like the updates in this project that happened since you forked it.
Yes I believe once I can get things updated to utilize the CLI, I'll release both ES2015 & TypeScript versions of the template to Nuget 👍 Hopefully in time for Christmas 🎄 🎅
@MarkPieszak Really curious about TS support. Wondering if there has been any updates. Thanks!
Apologies on the delay a lot of things happening lately :)
With Vue 3.0 coming out soon I think it's finally a great time to start working on this and getting this out! I'll post here when I have a working branch that hopefully everyone can test locally as well to make sure it works perfectly!