microsoft / nodejstools

Node.js Tools for Visual Studio
http://aka.ms/explorentvs
Apache License 2.0
1.79k stars 359 forks source link

Feedback on attempted migration to Visual Studio Professional 2015 + nodejstools #1079

Closed alexmcmillan closed 7 years ago

alexmcmillan commented 8 years ago

I am writing this because the article ES6 IntelliSense Preview in NTVS 1.1 politely asked for feedback of any kind. This is my experience attempting to move my javascript development to a Visual Studio 2015 environment using nodejstools. I hope it is valuable feedback.

For many years I have used Sublime Text for developing front- and back-end Javascript applications. I also use Visual Studio 2015 Professional (R2) for developing Windows services and ASP.Net websites and services, primarily in C#.

With Sublime, NodeJS and NPM I can create a simple package.json file and begin npm installing packages to my hearts content. With webpack and babel, I can take advantage of modern Javascript features and syntax to build software, usually transpiling to bundles I then dish up to the client.

This approach is simple and clean, with the only "boilerplate" being a couple of simple config files, and a node_modules directory containing dependencies. With watch tools and react-hot-loader, I can save a file and within seconds, see the changes in my browser on another screen - without it reloading the page. This is the absolute ideal development environment when it comes to both productivity and pleasure.

But I am the lowly Javascript dev on a team of Visual-Studio-addicted dotnet developers.

We host all our dotnet production applications on Azure and I have a big NodeJS project coming up. Combining this fact with internet-rumour that VS2015 supports NodeJS, JSX, ES6/ES7, Git, TeamCity and integration with Azure, I decided to investigate it as a possible alternative development environment.

Unfortunately, the experience has been... less than encouraging.

Upon a clean, full installation of Visual Studio 2015 Professional R2, I attempted to create a NodeJS application. There were no NodeJS templates available. Some googling lead me to nodejstools, which I installed and which provided some templates. Awesome.

I created a "Basic Azure Node.js Express 4 Application" project, because it had a few of the right buzzwords and the highest number. After some time, I was presented with an app.js file, containing some archaic-looking javascript. I thought "Righty-oh.. let's see about this ES6 support" and changed the line var express = require('express'); to import express from 'express';. Nope - red squigglys. Okay - perhaps I need to add ES6 support somehow.

Looking into the ES6 Intellisense Preview document I briefed over earlier, I noticed the phrase

This option will only be enabled if TypeScript 1.6 is installed for VS 2013 or VS 2015

What madness is this!?, I wondered, having never wanted to add strong typing to a dynamically-typed language. Oh well, I guess Microsoft are trying to push their agenda or something... so I begrudgingly installed TypeScript via the link provided, set the "ES6 Intellisense Preview" option and attempted to make the require -> import change again.

Lo and behold! No red squigglys! "We're off to the races!" I thought. I made a few more changes and hit F5 to see what would happen if I tried to run this thing.

I was presented with a command prompt showing an Unexpected token error on the first import statement. Bah!

It takes about 15 minutes to get a boilerplate express server up and running from scratch with nothing more than a command prompt and a text editor. Using Visual Studio, it being a much bigger (and presumably more powerful) beast, I was literally incapable of doing it. And this was vanilla ES6! I hadn't even tried JSX, hot-reloading or any kind of build tools (Babel, anyone?).

After spending about 3 hours working through all this, reading readmes and faqs, downloading plugins and waiting for VS to restart, I'm not quite ready to give up completely but the whole process has been an absolute nightmare.

I don't think the pattern of using modern JS syntax to build an express backend and a react/redux frontend is unique/uncommon enough for this to be so difficult.

mjbvz commented 8 years ago

Thank you for this detailed feedback. We're always trying to improve NTVS, and knowing some of the sticking points and frustrations you ran into really helps us understand how we can make things better.

It sounds like you've already tried a lot to get NTVS working as expected, but I have one more thing that you can try: upgrade to NTVS 1.2 Beta on Visual Studio 2015 Update 2 or later. NTVS 1.2 brings a number of improvements to IntelliSense and the product in general, and may help resolve many of the annoyances you ran into. More specifically, it offers better ES6 support by default.

You're completely right that the main selling points of NTVS is integration with the Visual Studio ecosystem. We also need to support core Node experiences like you were running through, but things could be better. We're trying to make these experiences better with NTVS 1.2 and future NTVS releases.

If you could try out NTVS 1.2 and share any feedback, we'd greatly appreciate it. Also, please let me know if you have any specific questions or could use any pointers on getting setup.


Another thing to consider if you're coming from Sublime and just looking for a lighter weight, but still full featured, Node editor and debugger: try VSCode. It's very easy to install and get started with. VSCode does not support nearly all the features and extensions of regular VS, and cannot open Visual Studio project or solution files directly, but I do recommend trying it out to see if it offers an experience that is more what you are looking for.

Hope that helps. Thanks again for the feedback.

paulvanbrenk commented 7 years ago

Thanks again for the feedback. Closing this as we've made huge improvements since 2016.