Skip to content
This repository has been archived by the owner on May 23, 2022. It is now read-only.

TypeScript Support #61

Closed
gavinr opened this issue Mar 11, 2016 · 4 comments
Closed

TypeScript Support #61

gavinr opened this issue Mar 11, 2016 · 4 comments
Milestone

Comments

@gavinr
Copy link
Contributor

gavinr commented Mar 11, 2016

In addition to ES2015 transpiling, would it be useful to allow Typescript transpiling?

Related (but not required for this to work): ArcGIS Ideas: Maintain a Typescript definition file for jimu.js

@gavinr
Copy link
Contributor Author

gavinr commented Feb 21, 2017

Looks like this may be covered: https://github.com/davewilton/generator-ecl-wab-widget
👍

@gavinr
Copy link
Contributor Author

gavinr commented Oct 19, 2017

I have worked with @davewilton to get a clean example of a Web AppBuilder widget written in TypeScript. Next step is to consider if this will fit into the context of the generator, and also if we WANT to do it (does this preclude non-TS users, for example?)

https://github.com/gavinr/web-appbuilder-typescript-examples (see the builder folder)

@thejones
Copy link

I am commenting on this here, related to https://github.com/gavinr/web-appbuilder-typescript-examples specifically the builder portion.

I was successful in using the generator (https://github.com/davewilton/generator-typescript-wab-widget) from @davewilton along with most of @gavinr files. I had problems in a few areas.

  1. SourceMap debugging did not work until I used inline sources.
  2. @gavinr used es6-promise which allowed me to use async/await (all I really care about in life these days). I had not used that before and previously just set the lib option in tsconfig to es2105. When I did this tsc output went crazy. Not sure why...
  3. The generator for TS does not currently include a settings page (unless I just missed this option).
  4. Documentation (obviously as there is none).

Thoughts/story time:
At work we used the generator and Grunt and everything fell apart when we got past a couple of widgets. It was simply too slow and only gets slower. Put a few widgets into a folder and let grunt run and you will soon see this. So, The Grunt workflow as-is only works, IMO, if you are developing single widget/single repo.

To comment on your question about if you WANT to include TS, I feel they would both need to exist or be two different projects. I love TypeScript, but when people used coffee script I would just avoid the project all together. So, do not force people into anything TS related as JavaScript is actually getting pretty nice lately.

I would personally like to see the workflow change to better support multiple widgets or make it easier to develop one widget per branch without maintenance headaches. We "solved" this at work by using npm scripts and creating symlinks so that the folders no longer copy/sync. Our app just had a link into the dist folder. This works so well for us I would highly recommend looking into something similar. We got it to work on Windows 7 so anything is possible...

Appreciate all the hard work and I would love to discuss further or help out in any way.

@gavinr
Copy link
Contributor Author

gavinr commented Nov 28, 2017

@thejones Thanks so much for the great feedback!

The notes about the TypeScript examples are good points - let's handle them in their separate issues:

  1. SourceMap debugging gavinr/web-appbuilder-typescript-examples#4
  2. Promises gavinr/web-appbuilder-typescript-examples#5
  3. Settings Page gavinr/web-appbuilder-typescript-examples#6
  4. If this ever got pulled into the generator, I agree we'll need some good documentation on what you can or cannot do from a Typescript perspective.

Regarding your last paragraph (like to see the workflow change to better support multiple widgets or make it easier to develop one widget per branch without maintenance headaches), I've created an issue here to track that: #95

Regarding your note about including TS in this Generator:

To comment on your question about if you WANT to include TS, I feel they would both need to exist or be two different projects. I love TypeScript, but when people used coffee script I would just avoid the project all together. So, do not force people into anything TS related as JavaScript is actually getting pretty nice lately.

I think that's the core of the discussion we want to have here. I am interested to hear others opinions on this too.

@gavinr gavinr changed the title Typescript Support TypeScript Support Nov 28, 2017
@gavinr gavinr added this to the v3? milestone Jan 30, 2018
@gavinr gavinr closed this as completed Feb 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants