So sad! Has anyone had any luck using Babel to con...
# suitescript
t
So sad! Has anyone had any luck using Babel to convert from ES6 to ES5 and running it in NetSuite?
t
our team has and it actually works well
I haven't walk through the config and not familiar enough with babel
but we code in es6 and load up to Netsuite in es5
s
we have been using TypeScript for years to do the same (and get strong typing, of course)
c
@stalbert My understanding is that you run something to compile your TS to JS. This produces output JS files. How do you then upload these to NS?
I use WebStorm with the SuiteCloud IDE plugin and I use the feature it provides to upload files from WebStorm to NS
Would I have to make my JS output directory part of the project in WebStorm so that I can select the JS files and upload them to NS?
s
I used to upload files via a utilty, lately I've fallen back to just uploading using the file cabinet UI while the webstorm plugin gets better at doing it
I have been experimenting with using SDF cli to upload the files, and having TS output to the SDF folder
c
ok. I use the plugin and then if it fails once I start navigating to the file cabinet while it tries the second time and if it fails the second time then I upload it in the file cabinet UI
Does that way (SDF cli) work well?
s
it's working OK so far. I don't have a lot of faith in the webstorm UI plugin yet.
t
I'd like to start using Babel or TypeScript to convert ES6 code to ES5, but I'm worried how other developers on the team would interact with it.
c
@Tyler Be a pioneer, not their prisoner :)
t
@cja You're right!
c
j
I use a gulp task to convert ts / es6+ sources to js and upload the files to the netsuite file cabinet. @michoel has an example one here https://gist.github.com/michoelchaikin/e84bc97bc51fbe830a1d1273907dc27c
s
I haven't found the need to reach for gulp - TSC (the typescript compiler) is all I've needed so far for normal scripting.
and while I don't mind a nice GUI plugin, I'm more likely to continue using the sdf cli because it's more flexible - if it is what I'd use if I did introduce automation/gulp tasks around all this stuff.
what I miss from my old upload utility is the ability to press a single keyboard shortcut to upload the current focused editor file in webstorm - and it did so in <1second typically.
c
The SuiteCloud IDE plugin for WebStorm has a single keyboard shortcut for uploading, but it takes way longer than 1 second for me per file. Apparently this is because there are thousands of files in the file cabinet
Also it fails silently about 10% of the time but there is another keyboard shortcut that diffs the local and remote files which I always use to confirm success
s
that second shortcut sounds handy
the sdfcli 'uploadfiles' is also slow. slower than uploading by hand with the file cabinet UI, which I find astonishing