• 0

Vue.Js 2.0 + TypeScript 2.0 + VS2015


Question

I do not use node or anything that complicated - before hand I just used boostrap and jquery. It is just that the code is getting to complicated.

 

Objective,

Setup project to easy develop a simple single page application using vuejs library (seems simple compared to angular - only one file).

 

Current setup,

  1. ASP.MET MVC 4 Project (.NET 4.5.2)
  2. TypeScript 2.0 installed (before today I was on 1.8) and configured in the csproj file (JSON configuration errored out when trying to publish - granted might be fixed in 2.0?)
  3. Typings for bootstrap, jquery, and a few others installed via NuGet
  4. TypeScript code goes to /src/ and outputs JS to /Scripts/
  5. Definition files (d.ts) files go to /Scripts/typings/
  6. vue and other libraries references in script tag in _Layout.cshtml

Here is the configuration file,

    <TypeScriptToolsVersion>2.0</TypeScriptToolsVersion>
    <TypeScriptRemoveComments>true</TypeScriptRemoveComments>
    <TypeScriptTarget>ES6</TypeScriptTarget>
    <TypeScriptSourceMap>true</TypeScriptSourceMap>
    <TypeScriptOutDir>./Scripts</TypeScriptOutDir>
    <TypeScriptNoEmitOnError>true</TypeScriptNoEmitOnError>
    <TypeScriptSourceMap>true</TypeScriptSourceMap>
    <TypeScriptNoImplicitAny>true</TypeScriptNoImplicitAny>
    <TypeScriptExperimentalDecorators>true</TypeScriptExperimentalDecorators>
    <TypeScriptModuleKind>CommonJs</TypeScriptModuleKind>

I actually need ES5 but...

 

Issue,

vue.TypeScript.DefinatelyTyped is outdated so I decided to see if there are newer definitions somewhere

So I used node package manager to pull down vue and found some seemingly up to date ones in /node_modules/vue/types and copied them to my project

 

These ones are a lot better. They are more complete and more complex. Intellisense by TS provider for VS15 does a much better job here.

There is one snag though - they are in a module. So the only way to use them in the TypeScript file is via import statement.

They don't work like the stuff in the /typings/ folder which just work implicitly or with a comment import.

 

TypeScript transpiles the import statement - doesn't get rid of it. Depending on the settings of the csproj file it is either an "import" statement or a "require" statement.

So obviously I am doing something wrong here - d.ts files do not have definitons.

 

I also need to the e6-promise package if I am going to target ES5, right?

 

How would you get TS type checking to work for this JS library in VS2015?

Link to comment
https://www.neowin.net/forum/topic/1311710-vuejs-20-typescript-20-vs2015/
Share on other sites

1 answer to this question

Recommended Posts

  • 0

I don't work with TypeScript enough to know the answer to this (sorry) but one thing you should look at if you haven't already is Yarn for package management. It's a product of Facebook and a much better approach to package managing.

 

Best of luck with your project though and good call with Vue, I use it daily and I absolutely love it.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Looks like the 7.1 is fake effects, can it at least do real 5.1? It says 'virtual 7.1' in all descriptions.
    • You can't, if you didn't notice, it doesn't support surround at all, it's right in the spec list.
    • Hi — I’m always interested in soundcards. Like displays, I just want to know I’m getting as much clean “sonic juice” into my brain as possible as the years take their toll. I’m not entirely sure what to take away from this review, though. It doesn’t really tell me whether the AE‑X is a good product or who it’s actually for. Most of what I’m getting is: there’s a driver to install, here’s what it looks like, and here’s what’s in the box. There’s a lot of emphasis on the SPDIF input. When you mention not needing to switch headphones between console and PC — does that mean the PC has to be powered on just to pass audio through? That seems like a fairly big waste of energy. Is this more something a streamer would use alongside a capture card? How are you testing the sound? (Also, you might want to clarify that you’re using the headphones in wired mode when you mention they’re wireless.) You mention the lack of EMI shielding — how much real‑world difference does that make compared with typical motherboard audio? On multi‑channel: what exactly isn’t supported? Does this mean Windows spatial audio (Dolby Atmos for Headphones, DTS Headphone:X, etc.) won’t work, or just that the card itself doesn’t decode surround formats? And are there any true multi‑driver “surround” headphones left that would even use that? You also highlight support for high‑impedance headphones — but what does that translate to in practice? How does it compare to driving the same headphones from a normal device, and does it make any difference for everyday, lower‑impedance models? In short, who is this card actually targeted at?
    • Yes, THIS is wordart, not the styling that can now be done. Wordart was all about those curvy words, that you could change the path of, like making words go around a circle. I don't think it can be done now, right?
    • Just saw a news report of a Waymo driving into a flooded road.
  • Recent Achievements

    • Dedicated
      Almohandis earned a badge
      Dedicated
    • Dedicated
      JuvenileDelinquent earned a badge
      Dedicated
    • First Post
      DrWankel earned a badge
      First Post
    • Reacting Well
      DrWankel earned a badge
      Reacting Well
    • Week One Done
      Supreme Spray LV earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      503
    2. 2
      +Edouard
      170
    3. 3
      PsYcHoKiLLa
      88
    4. 4
      Steven P.
      76
    5. 5
      Michael Scrip
      74
  • Tell a friend

    Love Neowin? Tell a friend!