I suggest you ...

Support a JavaScript Project type in Visual Studio

Please provide a new project type in Visual Studio for developing JavaScript components.

The new project type could have the following features:

- Contains .js, .css, and .html files.
- Represents a complete UI component - i.e. a module or widget.
- Runs JSLint or JSHint on build and reports any errors and violations.
- The build ouput is minified JavaScript and CSS; there should be options for specifying a minifier.
- The build output should also output any HTML files (as ASP.Net partial views).
- The new project type permits adding references to other JavaScript projects.
- Intellisense is provided based on the referenced projects.
- ASP.Net MVC projects should also permit referencing of these new JavaScript projects.
- ASP.Net MVC should provide razor @Script/@Style syntax to include the minified bundles with reference to their project names.
- ASP.Net MVC should permit referencing the partial views from the build output.
- Similarly a JavaScript test project should also be provided; this project type permits referencing the new JavaScript projects.
- Test methods in the test projects are picked up and displayed in the Test Runner - the same as any C# test method.
- The test projects include a built-in assertion library, or permit external libraries, such as QUnit.
- The JavaScript project should be viewable in Page Inspector, since it includes HTML, CSS and JavaScript.
- It should also be possible to debug the project via Page Inspector.

460 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Noel AbrahamsNoel Abrahams shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →
    ericbericb shared a merged idea: JavaScript Project Template  ·   · 

    8 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Konstantin TarkusKonstantin Tarkus commented  ·   ·  Flag as inappropriate

        I'd really like to see a JavaScript project type which would NOT contain 'bin' / 'obj' folders and similar artefacts. Plus I need a command window with Node.js tools enabled in it. So you could use Grunt (or Gulp.js) to compile your JavaScript projects. Also developers without Visual Studio, could work on the same project as well (with WebStrom for example).

      • Noel AbrahamsNoel Abrahams commented  ·   ·  Flag as inappropriate

        Thanks for considering this idea for review.

        Since this idea was floated, the biggest change that has occurred in the JavaScript world is TypeScript.

        There is already a TypeScript project type in VS whose output is compiled JavaScript. Furthermore the TypeScript language service provides excellent intellisense.

        What is currently lacking there is the integration with ASP.Net. TypeScript approaches the problem from a purely JavaScript perspective.

        It would be great if we are able to reference a TypeScript project file (that has HTML and CSS as well) from an ASP.Net Web Application and use it to render a website.

        Here are a couple of related discussions from the TypeScript codeplex site:

        http://typescript.codeplex.com/discussions/404012
        http://typescript.codeplex.com/workitem/571

      • AdminAdmin commented  ·   ·  Flag as inappropriate

        Chris Ammerman commented · December 19, 2012 8:14 p.m

        The node.js community is currently offering up the only mature toolsets for JavaScript projects. It would be fantastic to be able to have JavaScript projects in VS and TFS with support for a "JavaScript build" that can merge and minify, and kick off automated tests.

        Noel Abrahams commented · November 22, 2012 2:11 p.m.

        With the advent of TypeScript, the major change in the above is from "Runs JSLint or JSHint on build and reports any errors and violations" to using the TypeScript compiler instead.

        There is now a TypeScript project type and this suggestion is to develop that project type so that it can be referenced from an ASP.Net Web Application.

      • Jordan MatthiesenJordan Matthiesen commented  ·   ·  Flag as inappropriate

        @ericb - Would it be fair to change the title of this idea to "JavaScript Library Project Template" to remove some ambiguity?

        Jordan Matthiesen
        Program Manager, Microsoft Visual Studio

      • ericbericb commented  ·   ·  Flag as inappropriate

        If you could provide a "Visual Studio-ified" version of Grunt (http://gruntjs.com/), I think this would be 90% there.

        I've seen quite a few (including myself) creating W8 apps using the JavaScript App Project Template, and then adding a grunt.js file to it in order to handle their JS build process.

        Using Grunt in a JavaScript App Project works, but it still doesn't allow me to easily build re-usable JavaScript libs (or allow me to have a JavaScript project like a "MyApp.Core" that is separate from my actual "MyApp.UI" project.)

      • Borek BernardBorek Bernard commented  ·   ·  Flag as inappropriate

        Fully agree, sometimes JS library needs to be shared amongst more projects in a solution and currently, there is no straightforward way to do it. Also, you may want to compile it using Closure, minify, obfuscate etc. and this all could be built-in.

        In VS 11, JavaScript is supposed to be a first-class language so it should have a first-class support on the project level I believe.

      Feedback and Knowledge Base