Sign In Register

How can we help you today?

Start a new topic

Flowtype support

It would be great if you could support Flow ( for the JS cloud code

it's a static analysis tool that catches early most of the common errors made when writing code, without having to execute those lines.

examples: wrong types, accessing stuff from null/undefined vars, typos, etc. (i.e. stuff a compiler would catch, and more (nulls))

I use it offline with limitations, my current workflow (no pun intended) is:

- edit code locally (with Atom)

- run flow check from the terminal

- fix errors

- commit and push to github

- fetch from the GS dashboard

what I don't have and I would like to be integrated is:

- GS API support (I wrote libdefs for the API part I use, but I have to declare manually each Spark.* and RTSession.* function, guessing their signature (i.e. if they can accept or return nulls) 

- your "require" architecture is not supported out of the box, so I have to emulate node.js modules with annotations (commented)

- - i.e.: in the module I add "/*:: module.exports = {XXX} */" (with XXX being my functions, luckily I follow the convention "declare one global per module and use it as a namespace")

- - in the using code, I mark the line with require("Module") as to ignore, and add /*:: Module = require("../modules/Module.js") */ as a flow annotation

- Spark.getData() depends on the event, so it has to be marked as "any" and we lose the type checking

- annotations have to be wrapped into /*:: */ comments, that flow parses as if they are not comments but an uncommented annotation would bypass everything until runtime (unless fetching from git does a syntax check like the online editor)

- flow check during online editing

Hi Mauro,

Thanks for logging the feature request. This is something we can raise with the dev team for you.



Hi Mauro,

Currently there are no plans to add FlowType support. If we receive more requests to support it we will review it again in the future.



Login to post a comment