Serenity: DO NOT UPDATE to Microsoft.TypeScript.MSBuild.3.2.3 (3.2+ for that matter)

Created on 7 Jan 2019  路  11Comments  路  Source: serenity-is/Serenity

You wont be able to transpile TS to JS, since tsc.exe is not available in new MSBuild

Most helpful comment

You may replace command in CompileTSC part with this for now:

    <Exec Command="&quot;$(NodePath)\node&quot; &quot;$(TSJavaScriptFile.Replace('build\\..\tools\', 'tools\'))&quot; -p ./tsconfig.json" ContinueOnError="true" />

Think it is time to turn back to NodeJS version of TSC. Chakra version was 2 times faster than NodeJS one on compile, sad to see Microsoft killing its own tool again.

All 11 comments

cool, I changed $SUBJ then.
I tried to play with it a little bit, god down to the part where I modified after build commands to go for node.exe rather than tsc.exe, but I was not able quickly (and offline) to figure how to do it, so rolled back to 3.1.1 I guess.

I figured transpiling does not work, when my changes did not get into project.web.js file no matter what.

You may replace command in CompileTSC part with this for now:

    <Exec Command="&quot;$(NodePath)\node&quot; &quot;$(TSJavaScriptFile.Replace('build\\..\tools\', 'tools\'))&quot; -p ./tsconfig.json" ContinueOnError="true" />

Think it is time to turn back to NodeJS version of TSC. Chakra version was 2 times faster than NodeJS one on compile, sad to see Microsoft killing its own tool again.

Shut, I believe I tried -p and it did not work.
I'll leave it open little bit longer, so that people get a chance to see it here

@ga5tan what is your build setup like? Are you using MSBuild?

@pranavsenthilnathan do we have an MSBuild property to explicitly specify the node.exe location?

Sorry about the breaking change. I took a look at how you folks were using tsc.exe and I have a proposed solution here #4268. If you install our NuGet package Microsoft.TypeScript.MSBuild, it will automatically export the build targets that enable TypeScript compilation. I built the Serenity.Scripts project with my changes and the dist folder has the compiled javascript as expected. With this change you should be able to also remove the Tools\TypeScript directory in favor of the NuGet reference in the csproj. The other project with tsc.exe (Serenity.Test.Net45) gave me some non-TypeScript build issues so I didn't include it in my PR. I'd bet a similar change would work on that csproj as well though.

@minestarks yeah, I use MSBuild. I just reverted to the older version, since I was not able to fix it quickly
volkanceylan provided way to fix it, but I guess I just wait until it's out in Serenity. I dont see need for newer TS, unless it's gonna be faster (which I doubt)

PranavSenthilnathan suggested a solution as well. Not sure how that's gonna work, since it looks too simple to me :)

@PranavSenthilnathan the problem is not about Serenity sources, its an issue with people's Serene/StartSharp based projects

Added notes to upgrade doc

@volkanceylan I saw it there.
I updated to latest JS engine and TS Build and got another set of problems even with your fix :(
I had to go back to 3.1.1 for MS build

This is now added in projects:

  <Target Name="CompileSiteLess" AfterTargets="AfterBuild">
    <Exec Command="&quot;$(ProjectDir)tools\node\lessc.cmd&quot; &quot;$(ProjectDir)Content\site\site.less&quot; &gt; &quot;$(ProjectDir)Content\site\site.css&quot;" />
    <Exec Command="node_modules/.bin/tsc -p ./tsconfig.json" ContinueOnError="true" />
  </Target>

So rebuilding _updates_ current projects, you could run Build -> Transform All T4 Templates to generate them. Just recently had to Alter a table via migrations and a mere Rebuild fixed xyzRow.ts file for me.

Kind Regards.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AmuthaKondusamy picture AmuthaKondusamy  路  3Comments

dkontod picture dkontod  路  3Comments

ahsansolution picture ahsansolution  路  3Comments

dudeman972 picture dudeman972  路  3Comments

GitHubOrim picture GitHubOrim  路  3Comments