Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Ember-cli in Visual Studio #3746

Closed
edson- opened this issue Apr 1, 2015 · 55 comments
Closed

Using Ember-cli in Visual Studio #3746

edson- opened this issue Apr 1, 2015 · 55 comments
Assignees

Comments

@edson-
Copy link

edson- commented Apr 1, 2015

I am happily using Ember inside of Visual Studio with the help of Gulp and Task Runner Explorer. I'm in VS because my back end is C#/.NET. Also, I'm using TFS rather than Git, but that is another story.

See: https://visualstudiogallery.msdn.microsoft.com/8e1b4368-4afb-467a-bc13-9650572db708

It is unclear how I should migrate to Ember-cli while maintaining an equivalent productive experience in Visual Studio. Is there anyone out there who has solved this issue?

Looks like I can stay with Gulp for the time being - a HTMLBars Gulp plugin is available. However, I'm concerned that I'll be stranded if I don't switch to Ember-cli eventually.

@wayne-o
Copy link

wayne-o commented Apr 1, 2015

You're working against the grain here and it's going to burn imo

Sent from my iPhone

On 1 Apr 2015, at 16:17, Mike notifications@github.com wrote:

I am happily using Ember inside of Visual Studio with the help of Gulp and Task Runner Explorer. I'm in VS because my back end is C#/.NET. Also, I'm using TFS rather than Git, but that is another story.

See: https://visualstudiogallery.msdn.microsoft.com/8e1b4368-4afb-467a-bc13-9650572db708

It is unclear how I should migrate to Ember-cli while maintaining an equivalent productive experience in Visual Studio. Is there anyone out there who has solved this issue?

Looks like I can stay with Gulp for the time being - a HTMLBars Gulp plugin is available. However, I'm concerned that I'll be stranded if I don't switch to Ember-cli eventually.


Reply to this email directly or view it on GitHub.

@Dhaulagiri
Copy link
Contributor

You could certainly use visual studio as your editor, but are you wanting to find a way to avoid using the command line in any way?

@kellyselden
Copy link
Member

@edson- I have used VS for my REST api and web server, while ember-cli and (insert js editor here) for my ember client. Then I use scripts to copy my /dist folder to a folder under my web server so it can serve it up. Hopefully this can give you some ideas of how the two can co-exist.

@e00dan
Copy link

e00dan commented Apr 1, 2015

VS already has 1.0 tools for node.js and AFAIK Angular support. Ember CLI should be integrated in future with VS. Maybe some community suggestion to VS team should be created somewhere?

@ultimatemonty
Copy link

I'd follow @kellyselden's advice and use VS for the API and Sublime/Vim/Atom/whatever for ember.

I'm in the same boat (C# API, ember client) and that's what I'm doing and I don't have any real issues (other than general ember-cli on Windows slowness).

I have a config environment setup so that I can run my client against the local debug instance of my API using ember server --environment local.

FWIW rumor mill has it that MS is working on first-class support for ember-cli in VS 2015.

@Kilowhisky
Copy link

I've been tackling this pony for the last few hours and had some success with custom build events inside a heavily modified .csproj file but it does really seem like a square peg in a round hole. I tried taking a nodejs project from here (https://nodejstools.codeplex.com/) and modifying it but it appears that one or more of the node_modules/ember modules have file names that are too long and cause Visual Studio to crash.

Also it appears ES6 intellisense is not there yet for plain old JS files.

One can only hope that VS2015 has better support. That or the community needs to create some custom project templates or build tools.

@BryanCrotaz
Copy link

I would love ember + resharper!!
I'm a VS programmer (8+ years), but I'm coping with Sublime. Boy do I miss resharper though.

@kellyselden
Copy link
Member

@Twinkletoes Atom has javascript autocomplete (intellisense) I think.

Anyways, since this is not a bug in ember-cli, I'm going to close this issue. You may want to continue the discussion at discuss.emberjs.com or stackoverflow.

@stefanpenner stefanpenner reopened this Apr 2, 2015
@stefanpenner stefanpenner self-assigned this Apr 2, 2015
@stefanpenner
Copy link
Contributor

So we have been exploring deeper visual studio integration. cc @felixrieseberg

We can use this as a tracking issue

@wayne-o
Copy link

wayne-o commented Apr 2, 2015

I've ditched visual studio in favor of atom and its lead me to look into other back end tech such as Go and Node

I'm loving the lightweightness of it all and couldn't care less about my loss of Resharper

Put it this way. Builds are sub 1 second with my node and ember setup

C# can be anything from 1 minute to 15 minutes depending on what level of hell I've been assigned to.

NOT having all that intellisense and refactoring bloat has made me think about the design of my code more up front, before I put hand to keyboard. It's lightweight, fast and you never find yourself sat there gormlessly staring at your monitor while visual studio is busy doing something you certainly didn't ask it to do and you're contemplating what the next level of hell feels like because this ones pretty ripe.

My ide spins up in about 1 second and doesn't have any bullshit sln or csproj files and my source control certainly IS NOT hard linked to my build definition, bug tracker or anything else that desperately screams "we're integrated, you can't split us, you have to pay for all or nothing" - for those happily unaware, I'm talking about TFS - the single major cause of aneurisms, mad cow disease, high blood pressure and rainy days throughout this planet*.

Now do not get me wrong, I don't see the 12 years I spent with c# as any kind of waste. But I am wiser now to what is essentially gimic, bloat, over complexity and I really do know when I'm being fenced in. Script# looked interesting but I'm not sure it has the velocity it needs to make c# truly lightweight.

I tried keeping our backend stack c# until I was blue in the face. Tried running it under mono: create Vagrant box, compile Mono inside it, compile MonoDevelop inside it, install all the other deps and it was buggy as f*^%k, slow, complicated and an all round headache.

Anyway, my point being that you'd be better off just going with it. If you find keeping the back end and front end dev experience so different a ball ache I'd ask yourself "what does c# give me that is worth working against the grain" because I promise ember gives you a whole lot and c# is replaceable and you'd not regret swapping out c#. Not one bit.

W://

*slightly exaggerated but if MS were responsible citizens they would take it out back and hit it over the head with a baseball bat - they'd also actually make an MS version of Linux. Why not?! It'd be a great idea And we'd all love them for it. The msdos phone should stay an April 1st thing though.

Sent from my iPhone

On 2 Apr 2015, at 00:33, Bryan notifications@github.com wrote:

I would love ember + resharper!!
I'm a VS programmer (8+ years), bu I'm coping with Sublime. Boy do I miss resharper though.


Reply to this email directly or view it on GitHub.

@wayne-o
Copy link

wayne-o commented Apr 2, 2015

If you're doing this you'll need to get ember on NuGet, big enterprise (like the one I 9-5 for) wouldn't even consider pulling in deps over NPM, they kind of understand NuGet but NPM would be a step too far.

Maybe a vsix like SpecFlow provides? Thing is VS has it's own templating engine for code generation (T4) so there will likely be a lot of duplication and working outside of the norm. Which means lots of moving parts. Meh

If MS can get behind you on this you'd be in with a good chance but I don't see how VS will be able to keep up with the way things are going in "real" web dev land. Esp WRT NPM/Nuget - that's the big hurdle I think.

W://

Sent from my iPhone

On 2 Apr 2015, at 02:23, Stefan Penner notifications@github.com wrote:

So we have been exploring deeper visual studio integration. Cc felix


Reply to this email directly or view it on GitHub.

@edson-
Copy link
Author

edson- commented Apr 2, 2015

With such an awesomely active community, I can see I made the right choice with Ember! Thanks for the input and its reassuring to know I'm not the only MS shop guy out there doing Ember. Generally C# & .NET is a great back end technology (maybe best thing at Microsoft - so watch them change it). Being full stack, I can really make it sing with Ember/Ember-Data. Of course the MS territory comes with the 'gorilla' argument to smash all rationality, perception, and rigor. You should see some otherwise respectable developers here transform into Bill Gates on the golf course with your CEO when discussing Angular. "Google is biggest, and so Angular will win". (Ah, patronage with all it's pros and cons. What did Google say about not doing evil?). So I'm continually fighting the good fight here. Been experimenting and will report back when I have my new cli setup worked out.

@felixrieseberg
Copy link
Contributor

Good to see that there's some interest regarding Ember Cli and Visual Studio! We at Microsoft have been thinking about doing something like this. I don't think that this is about reinventing the wheel, since most tools we need are already there.

We already have awesome support for npm, bower, grunt and gulp - so I'm thinking more about bundling the right "configuration" rather then re-implementing work that has already been done.

Initially, all I want is to be able to run the Ember cli from Visual Studio, as well as to hook up serve and build. I just have to get around to it - anybody interested in helping a Microsoft Open Source guy out?

@BryanCrotaz
Copy link

BryanCrotaz commented Apr 2, 2015 via email

@wayne-o
Copy link

wayne-o commented Apr 2, 2015

I would be well up for this. My concerns are that where I work (major finance (read paranoid) co. so not really the norm) they just won't be down with NPM so if there was a way to NuGet it, it might be better but then again what's the point of just having CLI as a Nuget and no access to the rest of the community and resources...

If I can help I'd love to. Probably won't be much use outside of testing and maybe a bit of dev because I've got exactly zero experience of doing VS extension type work! But I have a lot of exp with MVC/WebApi/c# etc

In sailsjs we have some blueprints that output the JSON in the preferred format (side loading, links etc). Having something like that in WebApi would be very cool. Maybe not enough to blag me back from sails on my project but it would path the way for a lot of people.

What sort of integration are we thinking?

Sent from my iPhone

On 2 Apr 2015, at 17:45, Felix Rieseberg notifications@github.com wrote:

Good to see that there's some interest regarding Ember Cli and Visual Studio! We at Microsoft have been thinking about doing something like this. I don't think that this is about reinventing the wheel, since most tools we need are already there.

We already have awesome support for npm, bower, grunt and gulp - so I'm thinking more about bundling the right "configuration" rather then re-implementing work that has already been done.

Initially, all I want is to be able to run the Ember cli from Visual Studio, as well as to hook up serve and build. I just have to get around to it - anybody interested in helping a Microsoft Open Source guy out?


Reply to this email directly or view it on GitHub.

@BryanCrotaz
Copy link

BryanCrotaz commented Apr 2, 2015 via email

@wayne-o
Copy link

wayne-o commented Apr 2, 2015

Like I said though, there's no point really having cli as a nuget when every addon needs npm and we can't realistically expect every addon to publish a nuget

Sent from my iPhone

On 2 Apr 2015, at 19:29, Bryan notifications@github.com wrote:

Maybe we need an automated service that turns each cli release into a nuget
package?

Reply to this email directly or view it on GitHub.

@felixrieseberg
Copy link
Contributor

Just to be clear, we (as Microsoft) won't engage in any silly businuess turning any npm packages into nuget packages. From a Microsoft point of view, npm is kinda nice. We integrated it well, there's autocomplete, graphing and a bunch of features supporting it. There are also neat integration features for grunt, gulp and other task runners.

If we're doing any work on this as Microsoft, we'll make sure that Ember Cli runs well on Visual Studio the way it's supposed to run.

Also, just speaking as a Microsoft engineer - there's no reason to trust nuget more than npm, really ;-)

@wayne-o
Copy link

wayne-o commented Apr 2, 2015

Totally! And tell me about it, but getting any library (open or closed source) available to the team has to go through a horrific amount of internal testing and vetting.

All that aside, what's the order of the day? What would be required to improve the workflow for a standard user with unrestricted access?

Sent from my iPhone

On 2 Apr 2015, at 19:47, Felix Rieseberg notifications@github.com wrote:

Just to be clear, we (as Microsoft) won't engage in any silly businuess turning any npm packages into nuget packages. From a Microsoft point of view, npm is kinda nice. We integrated it well, there's autocomplete, graphing and a bunch of features. There are also neat features for grunt, gulp and other task runners.

If we're doing any work on this as Microsoft, we'll make sure that Ember Cli runs well on Visual Studio the way it's supposed to run.

Also, just speaking as a Microsoft engineer - there's no reason to trust nuget more than npm, really ;-)


Reply to this email directly or view it on GitHub.

@BryanCrotaz
Copy link

BryanCrotaz commented Apr 2, 2015 via email

@felixrieseberg
Copy link
Contributor

Priority 1: I want ember serve and ember build launched from Visual Studio. Priority 2: I want all Ember Cli commands to run from Visual Studio.

Since the integration of Grunt & Gulp is awesome and available for some of the older VS versions too, I think that Grunt might be able to help us out here. An ember addon and grunt-exec could make Ember Cli quite accessible to anyone coding in VS.

@Kilowhisky
Copy link

Are you planning on something built into VS or an addon like the current nodejs support? Got a link to what its going to take to write this? I'm willing to throw in a little bit if its something i understand. There are a great many similarities between ember-cli and features in VS.

@joshross4
Copy link

If you look where TypeScript is heading in version 1.5 with support for more ES6 feature like modules, let/const, sublime text support, and @wycats influenced decorators, it wouldn't surprise me if TypeScript gets integrated into Ember in the near future. Once that is in place, things will really start to get interesting.

@stefanpenner
Copy link
Contributor

Priority 1: I want ember serve and ember build launched from Visual Studio. Priority 2: I want all Ember Cli commands to run from Visual Studio.

@felixrieseberg got time to chat about this later this week? I would like to see if i can help move this forward

@felixrieseberg
Copy link
Contributor

@stefanpenner: Hangout on Friday? Totally flexible from 10am on.

@stefanpenner
Copy link
Contributor

@felixrieseberg lets do 10am then

@felixrieseberg
Copy link
Contributor

I'll find you on Hangouts then ☎️

@andrantis
Copy link

I'm very interested in this. I've been working with ember for 6 months, so given my limited experience, how I can help?

@Kilowhisky
Copy link

Well while a proper plugin is being produced you can use these little hacks to get some tighter integration with visual studio.

You can get the debug play button to run ember serve by doing the following.

  1. Create an empty solution
  2. Create a new ember app with "ember new" (or move the .sln files to an existing app)
  3. Add the folder into the solution via right click -> "Add existing web site"
  4. Right click the website and go to properties/start options
  5. Configure "Start Action" with the following (assuming you installed ember-cli with -g option)
  • Start external program: "C:\windows\System32\cmd.exe"
  • Command line arguments: /K "%appdata%\npm\ember" serve
  • Working directory: (click the "..." and select your website folder. I assume there is some short hand for the solution directory but $(SolutionDir) wasn't working.

Then under Server set the following.

If you really wanted to get fancy with it you could create a batch file that also opened your browser.

As for getting the rest of the commands to work a simple workaround is to use the TOOLS/External Tools wizard to add menu items for things like "ember test", "ember build", etc... I'm not going to explain exactly how to do it since its almost exactly the same process i described above.

EDIT: FYI here are the arguments available for cmd.exe. You can also substitude /K with /C if you wish. http://ss64.com/nt/cmd.html

@stefanpenner
Copy link
Contributor

@Kilowhisky nice!

@CuriousCain
Copy link

If you want intellisense, then add an _references.js file to your project and add any javascript files from your node/bower directories. eg:

/// <autosync enabled="true" />
/// <reference path="bower_components/ember/ember.debug.js" />

And then in

Tools -> Options -> Text Editor -> Javascript -> Intellisense -> References
add the _references file in there.
Example:

@pedropaf
Copy link

@felixrieseberg any updates on how to integrate ember-cli with Visual Studio? I have an ember project with WebAPI back-end and it would be nice to integrate CI properly. Thanks!

@xandervdm
Copy link

We would also like integrate ember-cli with VS2015 so following this with interest... Thanks.

@kellyselden
Copy link
Member

There is some work going on in #4576 that will help with this effort.

@PhilippRoessner
Copy link

+1 here. We are now migrating from ember 1.9.0 to the current version and it is so frustrating that they changed from a "Javascript Framework" to a "node based Javascript Framework". It is kind of a big project we have built on Ember and WebApi and it's very hard to get this together with all the changes they made.

@stefanpenner
Copy link
Contributor

@PhilippRoessner just so you know, we made sure ember continues to work without ember-cli. For exactly this usecase, and will continue to make sure it does.

CLI is merely an opt-in, it is worth noting, that using cli does reduce the friction of using ember addons.

@PhilippRoessner
Copy link

@stefanpenner yeah, it is possible, but not as easy as it was in the past. Especially to follow the guide on emberjs.com and getting started.

We used a few ember plugins like Addepar Ember, They don't work anymore and I want to switch to an ember addon. I have no Idea how to do that. Implementing template precompilation was a big change for our Dev Environment. Now we need Node.js, Grunt and so on.

So, not using ember-cli makes this more complicated or you have to face many disadvantages like, pre-compiling on client. I think the biggest problem with "Not using ember-cli" is that all the automatic build magic it does, is hard to understand for someone who has no clue about node.js. And in the past, it wasn't even necessary.

@stefanpenner
Copy link
Contributor

So what your saying is. Ember-cli saves you time, and solves existing problems so you don't have to? Of course with some trade offs, but what you describe appears net positive.

Obviously the cost of the features is transitioning of a more legacy setup.

In the past you where still compiling templates on your clients. Which was likely causing perf grief.

We do plan vs integration I hope that will aide you when it lands.

@PhilippRoessner
Copy link

What I describe is that updating to newer versions of ember, to have the benefits of the new Version, requires you to change completely the development ecosystem when u r working with Visual Studio. It is not even possible to get a EmberApp into the TFS when it was created with ember-cli see this node-based problem

Don't get me wrong, ember-cli is a great tool when working with ember. But getting both together, "ember without ember-cli" and Visual Studio, is complicated, "ember with ember-cli" with Visual Studio is not possible.

@stefanpenner
Copy link
Contributor

But nothing is stopping you from using ember without ember-cli. Except the new things ember-cli adds, like a rich addon ecosystem.

Re: the issue you linked, npm v3 can help a lot. And ember-cli itself has been made to work correctly with v3.(I have been working with npm folk close to ensure this to be the case)

I am actually aware of quite afew people who use ember-cli on windows and even with vs, the only issues they have (after follows the instructions) is slower build times then there posix counterparts.

In-fact our CI also runs on windows to confirm the system works.

The integration we speak of here. Is really, improved getting started experience and tooling integration.

@BryanCrotaz
Copy link

Re Addepar, take a look at shaunc/ember-grid that Shaun and I have been
working on. It's alpha and buggy, but implements a table that will handle
millions of rows or columns efficiently and we've built it in around 15
man-days. It's intended to replace ember-table for Ember 2.0.

I use ember-cli on windows and in a windows CI system and don't see any
path length issues.

Bryan Crotaz
Silver Curve

On 1 Sep 2015, at 15:16, PhilippRoessner notifications@github.com wrote:

@stefanpenner https://github.com/stefanpenner yeah, it is possible, but
not as easy as it was in the past. Especially to follow the guide on
emberjs.com http://guides.emberjs.com/v2.0.0/getting-started/ and getting
started.

We used a few ember plugins like Addepar Ember
http://addepar.github.io/ember-widgets/#/ember-widgets/select, They don't
work anymore and I want to switch to an ember addon. I have no Idea how to
do that. Implementing template precompilation was a big change for our Dev
Environment. Now we need Node.js, Grunt and so on.

So, not using ember-cli makes this more complicated or you have to face
many disadvantages like, pre-compiling on client. I think the biggest
problem with "Not using ember-cli" is that all the automatic build magic it
does, is hard to understand for someone who has no clue about node.js. And
in the past, it wasn't even necessary.


Reply to this email directly or view it on GitHub
#3746 (comment).

@stefanpenner
Copy link
Contributor

Re Addepar, take a look at shaunc/ember-grid that Shaun and I have been
working on. It's alpha and buggy, but implements a table that will handle
millions of rows or columns efficiently and we've built it in around 15
man-days. It's intended to replace ember-table for Ember 2.0.

@BryanCrotaz awesome! Is this using ember-collection under the hood?

@stefanpenner
Copy link
Contributor

@CuriousCain i suspect we can actually produce a pretty great references.js file automatically, is there a way to have VS pick it up automatically?

@felixrieseberg
Copy link
Contributor

@PhilippRoessner: Just a quick FYI, Visual Studio and Ember Cli totally work together. We're using it at Microsoft for a bunch of projects.

@CuriousCain
Copy link

@stefanpenner It looks like, now, by default VS2015 automatically creates a _references in the wwwroot.
To add another _references file (and have it picked up by VS), you need to reference the newly created one in the original. After this, you can add any references you like in the new file and they will be picked up. Like so:

No special settings need to be altered (like in my previous post)

@stefanpenner
Copy link
Contributor

@PhilippRoessner: Just a quick FYI, Visual Studio and Ember Cli totally work together. We're using it at Microsoft for a bunch of projects.

@simonc
Copy link

simonc commented Jan 26, 2016

@PhilippRoessner: Just a quick FYI, Visual Studio and Ember Cli totally work together. We're using it at Microsoft for a bunch of projects.

@felixrieseberg Is there any documentation on how ? :-)

@felixrieseberg
Copy link
Contributor

In short: Use the nodejstools, npm@3, ember-cli-windows, PowerShell as Administrator, and you'll have a good time.

@simonc
Copy link

simonc commented Jan 27, 2016

@felixrieseberg Ok, Thanks 😄

@areaintel
Copy link

Had a hell of a time getting ember-cli and visual studio to play together.

  • The nodejstools enabled VS to know about long file names ( vs will break on ember-cli-babel if not )
  • Wasn't able to add ember-cli in in the same mvc5 solution, seems so far to be only as another project but can be in the same solution.
  • Thinking you'd want to git ignore the node modules on checkin to TFS ( am sure it will break ). - Then for another dev to get latest would have to run npm update to restore the missing packages.
  • Make sure to use the beta npm for better handling of flat files.

You’ll need to first get https://www.visualstudio.com/features/node-js-vs from nugget installed and make sure this is checked:

node-js-vs

Then create a new project, I chose MVC5 web api.

After this in elevated powershell navigate into the solution folder and run which will make a new ember app named "fire":

ember new fire

Get a coffee or a beer or both...

Next right click the solution > add existing website > choose fire folder

Back in powershell run:

ember server

Pat yourself on the back and don’t tell M$, they don’t know this yet. If you tell M$ they may not have any reason to fix an ongoing file name length issue but likely won't matter as it seems they have zero interest.

Am using the very latest versions of everything.
versions

ember-cli-vs

If you made it this far take the rest of the day off!!

@stefanpenner
Copy link
Contributor

@areaintel sounds like a good potential contribution to the website, so future travelers also find this.

cc @felixrieseberg any thoughts?

@felixrieseberg
Copy link
Contributor

+1, we should probably have a guide. I'll put it on top of the todo list ;-)

@AmrEldib
Copy link

AmrEldib commented Feb 9, 2016

For me, I mark the node_modules and bower_components folders as hidden in Windows Explorer, and this gets Visual Studio to not load them when the folder is opened as a Web Site.
However, this breaks the auto update feature of _references.js file and misses with intellisense. To resolve this, I make a symbolic link to the .debug.js and save it into the .vs folder which VS creates.
mklink /H \node_modules\somepackage\code.debug.js \.vs\code.debug.js
I maintain the _references.js file under the .vs folder rather than the Scripts folder like VS defaults to. This helps avoid adding a folder that might be already used. This change is done in the Options dialog.
It's not the best workflow (it needs an extra step after every package install), but it works without any installs.
This works for my not very demanding requirements (one person projects so far). Let me know if you think there's a problem with it.

@XaserAcheron
Copy link

A proper how-to would certainly help. I found it easy enough to get a project started and load the code into VS for editing; it's the integration with ember-cli for things like Build, Run, etc. that's elusive.

In the interests of disclosure, I'm not a VS power user so I'm likely missing something very obvious for setting up the above. :P

At any rate, I'm bookmarking this thread in case some folks drop any further details (or to do so myself if I manage to figure it out at a later date). The bigger priority at present is actually using Ember to make a cool thing. ;)

@ohcibi
Copy link
Contributor

ohcibi commented Nov 13, 2017

Any updates on this @felixrieseberg ? One link you posted is dead, the other links to a 3 year old repository. What about that guide that was on top of the Todo list?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests