You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose new compiler flags in the .targets file #3034
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.
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 👍
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.
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.
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:
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.
Activity
mhegazy commentedon May 5, 2015
Paul van Brenk (@paulvanbrenk), i do not know if any of these need to be in the UI as well.
mhegazy commentedon May 5, 2015
Updates to the new module targets tracked by #3033
danquirk commentedon May 7, 2015
Include emitDecoratorMetadata too (see #3061)?
mhegazy commentedon May 7, 2015
updated to include emitDecoratorMetaData.
cmichaelgraham commentedon May 7, 2015
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 👍
mhegazy commentedon May 7, 2015
it is going to be in the next public VS release. for now you can set these in TypeScriptAdditionalFlags:
cmichaelgraham commentedon May 7, 2015
Mohamed Hegazy (@mhegazy) oh that is soooooo cool !!!
cmichaelgraham commentedon May 7, 2015
Mohamed Hegazy (@mhegazy) it works as you say, but there is a very small typo in the compiler flag:
this:
emitDecoratorMetaDatashould be this:emitDecoratorMetadataso the entire tag looks like this:
autoinject working in skel-nav-require-vs-ts
mhegazy commentedon May 7, 2015
thanks Mike Graham (@cmichaelgraham) for the correction.
paulvanbrenk commentedon May 7, 2015
edit: made 2 lists
mhegazy commentedon May 19, 2015
PR #3208 updates the remaining flag (--isolatedModules)
paulvanbrenk commentedon May 19, 2015
This should be in 1.5 RTM for both VS 2013 and VS 2015
atsu85 commentedon Jun 6, 2015
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:
with Visual Studio (same problem with 2015 and 2013) with TS 1.5 plugin
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.
rsnider19 commentedon Nov 16, 2015
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?
atsu85 commentedon Nov 16, 2015
Hint: Atom editor works really well, much better than i expected ;)
billti commentedon Nov 16, 2015
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.
paulvanbrenk commentedon Nov 17, 2015
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: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?
rsnider19 commentedon Nov 18, 2015
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.
mhegazy commentedon Nov 19, 2015
for future searches, MSBuild properties mapping to compiler flags are documented in https://github.com/Microsoft/TypeScript/wiki/Setting-Compiler-Options-in-MSBuild-projects