ladybug-tools / design_explorer_lite

A light version of design explorer meant to display sliders for the inputs and simple images + charts for outputs: http://www.ladybug.tools/design_explorer_lite/
GNU General Public License v3.0
4 stars 2 forks source link

Proposal: Add typescript bindings, reorganize javascript files #13

Open paul42 opened 6 years ago

paul42 commented 6 years ago

While the hackathon was great, and I'm personally wowed by how much the team accomplished, I think for long term support, I could take a pass at a pull request where I was thinking I could try:

  1. combine javascript files slightly differently so that methods that need global variables are just getting them from the method, this would give typescript a much better idea of what variables are passed around, and in addition, this will make the project a bit more robust, where changing a global variable won't break unseen things in another method.

  2. Create and export typescript interfaces/etc. so that maintenance in the future will be easier (if using a typescript enabled IDE (I like visual studio code with plugins)

What are your thoughts?

chriswmackey commented 6 years ago

@paul42 ,

I am all in favor of organizing the javascript files and making the global variables clearer and you should definitely feel free to do this.

I am not sure it I understand the full benefit of using TypeScript, though. Would this involve adding typescript references to the repo here as well as anything that we would do on our end in terms of using VisualStudio or node.js?

paul42 commented 6 years ago

So typescript is almost another language or superset of JavaScript that compiles down to JavaScript. It does introduce some more cognitive overhead and steps to the process, but in my opinion it is compensated by adding type safety and helpful intellisense features in supported ides, providing compile time safety for some errors and typos. I can rig up a demo but most of the setup is done be developers and goes unnoticed by end users.

MingboPeng commented 6 years ago

@paul42 totally agreed. for the further developing, typescript is the way to go. I probably will try to start converting current JS to TS.

chriswmackey commented 6 years ago

Ok, let's do it! I don't have much experience with TypeScript so I will follow your lead here.