Sign In Register

How can we help you today?

Start a new topic

External Editors for Cloud Code

At our organization we prefer to work, where possible, with files that we can then commit into version control.

With cloud code, our official line is that we work with files in the format set out in the exported zip layout, using the Export function at the bottom left.  We then Import the zipped copies of that version controlled directory to get our changes into the preview environment.  This theoretically ensures that all work is present in version control, with a proper commit message, as it is tested.

In practice, however, because of the Cloud Code Editor's knowledge of the Spark API and other nice features, people are preferring to work directly with the Cloud Code Editor and very often then neglecting to Export to update the version controlled copy.

What we'd like to do to get around this is to use a decent JavaScript editor like WebStorm or similar - is there any way out there of injecting some reference of the Spark API into WebStorm's intellisense?

I'm putting this out there before we begin to roll our own, in hopes that there is something that already exists!

5 people have this question

I've been pondering this, as well. However, Rhino js is extremely wonky and lacks modern ES6 features you'd normally find. Plus, as you mentioned, Spark's own goodies.
I'd love to somehow use Microsoft Code or something for this. There's another thread that includes typings and another that transpiles typescript to gs cloudscript. However, I'm not sure how reliable that transpile is.

Even better, yet unrealistic, it'd be great if they could catch up with competition and ditch Rhino for "real" JS of some kind. However, that part is just a dream.


It looks like there might be some real javascript engine in use for the realtime scripts - you get proper CommonJS require functionality there it seems.  I could be wrong about that, but if I'm not then it means that any external editor setup we do get working will need to treat the realtime scripts differently to the others, which complicates things a bit.

To be honest, in the short term, we'd be happy if we could just get some autocomplete on the Spark API stuff - that might be enough to get us away from the cloud code editor and into some proper version control.  Hopefully there will be some milage in including the TypeScript definitions with VS - perhaps it will reflect those in plain JS too.  I'll feed back here if I have any success with this!

Another solution would be if the cloud editor had version control integration (the real thing, and not the import/export features it has at the moment).  That's probably a dream too though - it's hard to imagine that such a thing would be very high up on the priorities list.

1 person likes this
Login to post a comment