The need to stabilise the Project XML in Visual Studio

Topics: General
Jan 22, 2013 at 5:46 PM

Hi, 

Firstly, many thanks for this release. We picked up a couple of dormant bugs in our code-base - mostly as a result of the nested function compilation bug. Also the build looks a bit more sleek, because I think the compiler is not redundantly processing files that had already been processed.

Now for a minor reservation:

According to the new instructions for Visual Studio projects, the following project settings are required:

 

  <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
        <TypeScriptTarget>ES3</TypeScriptTarget>
        <TypeScriptIncludeComments>true</TypeScriptIncludeComments>
        <TypeScriptSourceMap>true</TypeScriptSourceMap>
    </PropertyGroup>
    <PropertyGroup Condition="'$(Configuration)' == 'Release'">
        <TypeScriptTarget>ES3</TypeScriptTarget>
        <TypeScriptIncludeComments>false</TypeScriptIncludeComments>
        <TypeScriptSourceMap>false</TypeScriptSourceMap>
    </PropertyGroup>
    <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" />

 

A couple of questions:

1. Why is the ES3 and other options in here and not in Tools >> Options?

2. How does one specify that declarations be emitted (i.e. the --declaration option)? I tried the following but it did not work:

<TypeScriptDeclaration>true</TypeScriptDeclaration>

 

I'd just like to point out that this is the third release and also the third time we've had to update all our TypeScript projects in Visual Studio.

It's okay when you have only 5 projects, but the exercise stops being funny after you've unloaded and edited the 22nd project!

We need to have settled on the project XML by now, but if we are going to keep putting options like ES3 in there then surely that is not going to happen any time soon?

Have I missed something?

 

Thanks.

Noel

Coordinator
Jan 22, 2013 at 6:58 PM

ES3/ES5 targeting is a per-project setting. It wouldn't make sense to have it be a per-user setting (as everything in Tools/Options is).

For declarations, use <TypeScriptGeneratesDeclarations>true</TypeScriptGeneratesDeclarations> (see lower, around line 66, for the options).

You should expect that the default project file will change more in the future as we iterate on this (it's 0.8 after all), but your old projects (made with 0.8.1.0 or later) should still work at this point without needing any editing now that the project file doesn't hardcode the tsc.exe location. If you're seeing 0.8.1.0-made projects not build with 0.8.2.0, please file a bug so we can investigate. Thanks!