Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type annotations #24

Open
ariesshrimp opened this issue Oct 13, 2016 · 3 comments
Open

Type annotations #24

ariesshrimp opened this issue Oct 13, 2016 · 3 comments

Comments

@ariesshrimp
Copy link
Collaborator

I thought it might be helpful as documentation to try adding type annotations to the code base. I guess I forgot that the annotations would have to be stripped out before runtime. That sucks, because it's nice that the CLI code doesn't have any build process right now. Stripping the types would require a build step, and separate source/build directories. Or runtime overhead by stripping them dynamically.

A branch with some basic annotations is here: https://github.com/joefraley/thingssdk-cli/tree/feature/flow-types

@chalkers does it seem worth while to bother with a transpile thing, or does it seem more like useless overhead?

@chalkers
Copy link
Member

It feels like 'useless overhead' at the moment, but if you can do a build process then that's cool too. However, I think writing typescript definitions (tsd) for the projects generated by the CLI for the Espruino runtime is probably a better use of time surrounding types.

@ariesshrimp
Copy link
Collaborator Author

cool, i dunno anything about typescript. looks weird. is typescript a thing people would want to use on their embedded programs?

@chalkers
Copy link
Member

The type definitions are accessible in Vanilla JS so it helps with code completion. You don't actually required to use TS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants