TypeScript-Handbook
TypeScript-Handbook copied to clipboard
Feedback about the ASP.NET Core tutorial
I started to look at TypeScript for a few days core. I do develop applications in ASP.NET Core. I mostly use JavaScript to manipulate the DOM and using Ajax, nothing complicated.
It was way harder than I thought it to be :-( There is a couple of things I’m missing in the current tutorial (https://www.typescriptlang.org/docs/handbook/asp-net-core.html ):
- How to use a common library (like jQuery).
- How to communicate with a web service.
- How to share code if you are using several TypeScript files.
- How to use the debugger.
- How to deal with library that doesn’t have a definition file. This is a problem I have when using signalR. If I add import * as signalR from '@aspnet/signalr' on the top of my file but then the browser complains about export etc isn’t defined. I could define that and some more stuff, but it feels like a strange solution. Another options I found is to add declare var signalR: any; instead. But then Intellisense doesn’t work properly. The is some instructions here about TypeScript and signalR but that also feels awkward: https://docs.microsoft.com/en-us/aspnet/core/tutorials/signalr-typescript-webpack?view=aspnetcore-2.1&tabs=visual-studio
These a probably basic things, but if you are a beginner like me that’s what you want :-) I have spent a lot of hours searching and guessing just to get something useful running :-(
To be fair, I haven’t used neither npm or gulp before and that also took a lot of me to get a grasp on. In the current tutorial gulp is used to copy files to wwwroot, and I don’t understand why. Can’t the files be added in wwwroot from the beginning? Then gulp won’t be needed at all, at least not for that part. The current tutorial also references and old version of “del” in packages.json, which I was stuck on for some time (it couldn’t be downloaded or something like that).
To summarize I’m asking for better tutorial for basic ASP.NET Core developers like me. It’s a bit overwhelming to get a decent start right now I think.
@DanielRosenwasser https://www.typescriptlang.org/docs/handbook/asp-net-core.html is in need of a rewrite. It references old / obsolete tech such as ASP.NET 5, Angular 2, and VS 2015. Let me know how I can help. Maybe this could be relocated to docs.asp.net and maintained there. Thoughts?
Alternative suggestion, since there hasn't been any visible movement on this one: Before doing these things, just fix the existing one so that its code actually works as advertised at the end. That should be a smaller task; maybe one that that a competent contributor might have the time to take on, but very different than what has been requested here, so I'm opening it as a separate issue: ASP.NET Core tutorial - working source code please #1012