superset icon indicating copy to clipboard operation
superset copied to clipboard

Add typescript support to start documenting the code

Open ahmadalibaloch opened this issue 9 years ago • 8 comments

  • [X ] I have checked the superset logs for python stacktraces and included it here as text if any
  • [X ] I have reproduced the issue with at least the latest released version of superset
  • [X ] I have checked the issue tracker for the same issue and I haven't found one similar

Understanding the reactjs code without any type of documentation in a large project is a great challenge. Typescript can help reduce this challenge effort a lot.

Are there any plans to document the code and migrate it to typescript may be gradually.

ahmadalibaloch avatar Aug 03 '17 07:08 ahmadalibaloch

I'd gladly avoid adding another compilation step to the javascript assets. If types are needed, i think fb flow would be the choice. As a general note issues proposing to use some tools are usually best accompanied with a PR :)

xrmx avatar Aug 03 '17 07:08 xrmx

Regarding the compilation steps : Adding a loader type to webpack is not another step but a different path for specific file types, at the moment we are compiling from es6 to es5 and less to css etc and then with typescript we will be compiling from typescript to es5, for ts files.

we have written some components, live data sources, mqtt services in typescript for superset but at the moment this is an hindrance on our side to PR typescript code int js. Plus we (team) have spent a long time understanding reactjs code and created many bugs due to lack of documentation and type checking, as the topic suggest for this issue.

ahmadalibaloch avatar Aug 03 '17 07:08 ahmadalibaloch

@ahmadalibaloch looking forward your PRs then 👍

xrmx avatar Aug 03 '17 07:08 xrmx

Do you mean we can PR typescript coded features and components and they will be accepted by the superset community?

ahmadalibaloch avatar Aug 03 '17 08:08 ahmadalibaloch

I mean that it's easier to evaluate a change if it comes with code.

xrmx avatar Aug 03 '17 08:08 xrmx

@ahmadalibaloch looking forward to you code samples.

AKNiazi avatar Aug 04 '17 06:08 AKNiazi

Personally I'm not clear on the implications. Also unclear that TS is a solution to address documentation. There's nothing keeping us from documenting the React code we have now. To me the best way to document React is something like: https://github.com/storybooks/storybook

Definitely want to be careful in jumping on the latest JS bandwagon (glad we passed on CoffeeScript for instance). Coming from Python I'm not super enthusiastic about types.

Also not enthusiastic about adding a layer in the webpack delivery chain. I spent hours in dependency/webpack hell recently and clearly want to keep things lean in that area.

So at least for now I think the odds are against TS unless someone can make a strong case for it and for the Apache committers to rally behind that decision.

mistercrunch avatar Aug 04 '17 16:08 mistercrunch

Notice: this issue has been closed because it has been inactive for 261 days. Feel free to comment and request for this issue to be reopened.

mistercrunch avatar Apr 23 '18 07:04 mistercrunch