With the official release of TypeScript 7 and no s...
# suitescript
m
With the official release of TypeScript 7 and no support for AMD modules, are we just pinning to TypeScript 6 or has anyone found a good replacement for the TypeScript to SuiteScript JS build?
👀 1
j
The following solution is working for us: use TS v7 compiler to ESM + Rollup to bundle ESM to AMD + custom Rollup plugins to apply SuiteScript specifics. Could've used just a bundler without
tsc
, but wanted to keep type checking as part of the build process, instead of only the type-stripping that bundlers do. FYI that whole repo is meant to be freely used by anyone as boilerplate/scaffolding. We've made it open since it may save others a lot of time: github.com/anagram-dev/suitecloud-ts
c
We're in the process of switching to SWC to compile to AMD, and using tsc as a validator. github.com/swc-project/swc
a
My personal and old grumpy man solution: • Defined coding standards (no prettier). • Defined custom Hungarian Notation. • Defined naming convention for custom fields and records. • Hire Developers who actually pay attention to details. Custom Hungarian Notation: • aoData = Array of Objects • bValue = Boolean • nMoney = Numeric • aData = Array • oData = Object You can always do you and go through 5 different hoops to use TypeScript and hire careless developers who expect the language to catch their mistakes. My very personal opinion is that TypeScript added complexity is not needed for SuiteScript which is at the end of the day transpiled to Java; there is no performance gains; no complexity that justify TypeScript or OOP for that matter.
☝🏻 1
m
I definitely get where you’re coming from. It's not even about the typing part of it for me, it just provides better code completion support in IDEs with the SuiteScript API and custom modules imported in. Helps me to write out scripts quicker. For my setup, typescript was just a single config file and an auto one step build each time I saved changes to my files. If these other tools need more than that then I'll just ditch it back to regular JavaScript.
👍 1
j
FWIW it would make sense to pin TS to v6 then if that's the case, if you don't want to get rid of TS but also don't need other potentially more complex setup