Hello, has anyone tried to use typescript instead ...
# suitescript
t
Hello, has anyone tried to use typescript instead of javascript on SuiteScript? I want to know what's the difference. TIA
w
Yes, we are. What do you want to know?
t
Oh how's the performance? Why did you choose to use typescript instead of js?
w
Typescript has to be transpiled into regular javascript before it can be deployed to Netsuite. Performance-wise, I don't see any difference. Performance issues is rarely related to regular javascript-code. It's mostly caused by Netsuite api's that talk to the database. We like developing with typescript as we can use modern syntax in our development but still output ES5 javascript. (but we're going to try to change to ES6 output and see how it works) With the typings-suitescript-2.0 from headintheclouddev, we get a lot of help with ns functions to validate or just help us remember the names of the parameters. We use webpack to pack all dependencies in one .js-file when transpiling. This means that we can update a utility function and deploy one script without disturbing the other scripts that use the same function. (Yes, we will have to test that other scripts still work when we need to re-deploy those)
ES6 requires SS2.1, and some script types seem to still have issues with 2.1. Financial Connectivity Plug-ins may have for instance.
t
thanks Tomas, this is what I really want to know. If there are any issues encountering when using a typescript. As such what would be the remedy in order to proceed if this will be encountered. You provide it thanks. I now know where to start on my research