Skip to content

Expose new compiler flags in the .targets file #3034

Closed

Description

We have added a set of new flags over the course of this release, we need to add MSBuild properties for them in VS 2013 and VS 2015 in .target files as well as in the project properties.

VS 2013

VS 2015

Note: separateCompilation flag name could change based on the design meeting discussion for #2499

Activity

  1. added this to the milestone on May 5, 2015
  2. mhegazy commented on May 5, 2015

    @mhegazy
    ContributorAuthor

    Paul van Brenk (@paulvanbrenk), i do not know if any of these need to be in the UI as well.

  3. mhegazy commented on May 5, 2015

    @mhegazy
    ContributorAuthor

    Updates to the new module targets tracked by #3033

  4. danquirk commented on May 7, 2015

    @danquirk
    Member

    Include emitDecoratorMetadata too (see #3061)?

  5. mhegazy commented on May 7, 2015

    @mhegazy
    ContributorAuthor

    updated to include emitDecoratorMetaData.

  6. cmichaelgraham commented on May 7, 2015

    @cmichaelgraham

    is there a way to know when this becomes available in the beta install for vs 2013? i'm working on some aurelia samples for the typescript samples repo 👍

  7. mhegazy commented on May 7, 2015

    @mhegazy
    ContributorAuthor

    it is going to be in the next public VS release. for now you can set these in TypeScriptAdditionalFlags:

    <TypeScriptAdditionalFlags> $(TypeScriptAdditionalFlags) --emitDecoratorMetaData </TypeScriptAdditionalFlags>
  8. cmichaelgraham commented on May 7, 2015

    @cmichaelgraham

    Mohamed Hegazy (@mhegazy) oh that is soooooo cool !!!

  9. cmichaelgraham commented on May 7, 2015

    @cmichaelgraham

    Mohamed Hegazy (@mhegazy) it works as you say, but there is a very small typo in the compiler flag:

    this: emitDecoratorMetaData should be this: emitDecoratorMetadata

    so the entire tag looks like this:

      <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
        <TypeScriptRemoveComments>false</TypeScriptRemoveComments>
        <TypeScriptSourceMap>true</TypeScriptSourceMap>
        <TypeScriptModuleKind>amd</TypeScriptModuleKind>
        <TypeScriptAdditionalFlags> $(TypeScriptAdditionalFlags) --emitDecoratorMetadata </TypeScriptAdditionalFlags>
      </PropertyGroup>
      <PropertyGroup Condition="'$(Configuration)' == 'Release'">
        <TypeScriptRemoveComments>true</TypeScriptRemoveComments>
        <TypeScriptSourceMap>false</TypeScriptSourceMap>
        <TypeScriptAdditionalFlags> $(TypeScriptAdditionalFlags) --emitDecoratorMetadata </TypeScriptAdditionalFlags>
      </PropertyGroup>
  10. mhegazy commented on May 7, 2015

    @mhegazy
    ContributorAuthor

    thanks Mike Graham (@cmichaelgraham) for the correction.

  11. paulvanbrenk commented on May 7, 2015

    @paulvanbrenk
    Contributor

    edit: made 2 lists

  12. added
    FixedA PR has been merged for this issue
    and removed
    FixedA PR has been merged for this issue
    on May 12, 2015
  13. mhegazy commented on May 19, 2015

    @mhegazy
    ContributorAuthor

    PR #3208 updates the remaining flag (--isolatedModules)

  14. paulvanbrenk commented on May 19, 2015

    @paulvanbrenk
    Contributor

    This should be in 1.5 RTM for both VS 2013 and VS 2015

  15. atsu85 commented on Jun 6, 2015

    @atsu85

    Hi,
    Everything works as expected when i do "Build" or "Rebuild" on the project,
    but when i just save typescript file, then during compilation decorator metadata is not added to the js file as if "--emitDecoratorMetadata" compiler flag isn't taken into account.

    Expected:
    SomeClassWithAutoinject = decorate([
    aurelia_framework_1.autoinject, metadata('design:paramtypes', [aurelia_router_1.Router, app_state_1.AppState])
    ], SomeClassWithAutoinject );

    Actual:
    SomeClassWithAutoinject = __decorate([
    aurelia_framework_1.autoinject
    ], SomeClassWithAutoinject );

    I can reproduce this issue with Mike Graham (@cmichaelgraham) sample project without any modifications:

    1. open https://github.com/cmichaelgraham/aurelia-typescript/blob/typescript-1-5-port/skel-nav-esri-vs-ts/skel-nav-esri-vs-ts.sln
      with Visual Studio (same problem with 2015 and 2013) with TS 1.5 plugin
    2. change (i.e. adding a space) https://github.com/cmichaelgraham/aurelia-typescript/blob/typescript-1-5-port/skel-nav-esri-vs-ts/skel-nav-esri-vs-ts/views/flickr.js
    3. save

    Any ideas what do I have to configure to make it work on save just as it is working on manual build/rebuild?

    I haven't found a way through VS settings dialogs to tell VS2015 compiler to use "--emitDecoratorMetadata", but this flag is added to the Debug and Release configurations:
    https://github.com/cmichaelgraham/aurelia-typescript/blob/typescript-1-5-port/skel-nav-esri-vs-ts/skel-nav-esri-vs-ts/skel-nav-esri-vs-ts.csproj#L129
    as described above.

  16. rsnider19 commented on Nov 16, 2015

    @rsnider19

    I am seeing the same problem as Ats Uiboupin (@atsu85) where the metadata won't get created with a simple save. Any updates on that?

  17. atsu85 commented on Nov 16, 2015

    @atsu85

    Hint: Atom editor works really well, much better than i expected ;)

  18. billti commented on Nov 16, 2015

    @billti
    Member

    Reopening this for investigation. Paul van Brenk (@paulvanbrenk) , can you verify if the compiler options in question are being honored when using compile-on-save? Thanks.

  19. paulvanbrenk commented on Nov 17, 2015

    @paulvanbrenk
    Contributor

    This happens because, in the project Ats Uiboupin (@atsu85) refers to, the compiler flags for the metadata are specified as part of the <TypeScriptAdditionalFlags> element in the project file. If you replace that element with the following:

        <TypeScriptExperimentalDecorators>true</TypeScriptExperimentalDecorators>
        <TypeScriptEmitDecoratorMetadata>true</TypeScriptEmitDecoratorMetadata>

    Compile on save will work as expected.

    Rob (@rsnider19) The same should apply to your project, if it doesn't can you share your project file?

  20. rsnider19 commented on Nov 18, 2015

    @rsnider19

    Thanks Paul van Brenk (@paulvanbrenk) that works perfectly. Now I don't have to rebuild every time I make a change which means that I can just leave the project debugging and open in my browser.

  21. mhegazy commented on Nov 19, 2015

    @mhegazy
    ContributorAuthor

    for future searches, MSBuild properties mapping to compiler flags are documented in https://github.com/Microsoft/TypeScript/wiki/Setting-Compiler-Options-in-MSBuild-projects

  22. locked and limited conversation to collaborators on Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions