Rocket.Chat.Apps-engine icon indicating copy to clipboard operation
Rocket.Chat.Apps-engine copied to clipboard

Update TypeScript to 3.8.3

Open ThomasVuillaume opened this issue 5 years ago • 6 comments

Set skipLibCheck: true to avoid the following error :

Error: Deployment error: {"status":"compiler_error","messages":[{"file":"/home/vagrant/Rocket.Chat/node_modules/@types/node/index.d.ts","line":165,"character":10,"message":"/home/vagrant/Rocket.Chat/node_modules/@types/node/index.d.ts (166,11): Duplicate identifier 'IteratorResult'."},{"file":"/vagrant/Rocket.Chat.Apps-engine/node_modules/typescript/lib/lib.es2015.iterable.d.ts","line":40,"character":5,"message":"/vagrant/Rocket.Chat.Apps-engine/node_modules/typescript/lib/lib.es2015.iterable.d.ts (41,6): Duplicate identifier 'IteratorResult'."}],"success":false}

Tested on a Ubuntu 18 on Vagrant VM, with the following :

 ➔ +-----------------------------------------------+
 ➔ |                 SERVER RUNNING                |
 ➔ +-----------------------------------------------+
 ➔ |                                               |
 ➔ |  Rocket.Chat Version: 3.0.7                   |
 ➔ |       NodeJS Version: 12.14.0 - x64           |
 ➔ |      MongoDB Version: 4.0.6                   |
 ➔ |       MongoDB Engine: wiredTiger              |
 ➔ |             Platform: linux                   |
 ➔ |         Process Port: 23563                   |
 ➔ |             Site URL: http://localhost:3000/  |
 ➔ |     ReplicaSet OpLog: Enabled                 |
 ➔ |          Commit Hash: f69d16950d              |
 ➔ |        Commit Branch: master                  |
 ➔ |                                               |
 ➔ +-----------------------------------------------+

To test that deployment is OK, I used the Giphy app, modified to use specific TS 3.8 ECMAScript Private Fields syntax.

Then used rc-apps to deploy it with success :

image

ThomasVuillaume avatar Mar 28 '20 18:03 ThomasVuillaume

This work was based on #107 #146

ThomasVuillaume avatar Mar 28 '20 18:03 ThomasVuillaume

Failing test is, of course, to discuss (trivial to fix if the configuration proposed is OK)

ThomasVuillaume avatar Mar 28 '20 19:03 ThomasVuillaume

Hey @ThomasVuillaume ! Thanks for the contribution! I'm going to run Rocket.Chat's test suite with this version to test if all is good :)

d-gubert avatar Mar 30 '20 19:03 d-gubert

One thought on this that occured to me, Apps which use the new version of TypeScript will no longer be compatible with older versions of the App Engine. In my opinion, this is a breaking change. I know we all want the latest and greatest features, I want them a lot 😬, but we need to think through the strategy and consequences of this. If an App created with this version of TypeScript was attempted to be deployed on an older version of TypeScript, that version won't know what to do with the new syntax and will fail to run due to the incompatibility. 🧐🤔

cc: @RocketChat/apps

graywolf336 avatar May 08 '20 13:05 graywolf336

@graywolf336 makes sense and that's why we should remove the typescript compiler from inside the apps engine ASAP

rodrigok avatar May 08 '20 13:05 rodrigok

@rodrigok one thing to keep in mind when you guys do this, that will be a breaking change in and of itself as well. Because it won't be compatible with older versions of the Apps Engine. So, I think that would have to be in v2 or something. But I am curious and excited to see the proposal for it and what you guys have thought through and come up with 🎉

graywolf336 avatar May 08 '20 13:05 graywolf336