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

TypeScript Support #61

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

Comments

Projects
None yet
2 participants
@gavinr
Member

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

This comment has been minimized.

Show comment
Hide comment
@gavinr

gavinr Feb 21, 2017

Member

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

Member

gavinr commented Feb 21, 2017

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

@gavinr

This comment has been minimized.

Show comment
Hide comment
@gavinr

gavinr Oct 19, 2017

Member

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)

Member

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

This comment has been minimized.

Show comment
Hide comment
@thejones

thejones Nov 28, 2017

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.

thejones commented Nov 28, 2017

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

This comment has been minimized.

Show comment
Hide comment
@gavinr

gavinr Nov 28, 2017

Member

@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. gavinr/web-appbuilder-typescript-examples#4
  2. gavinr/web-appbuilder-typescript-examples#5
  3. 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.

Member

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. gavinr/web-appbuilder-typescript-examples#4
  2. gavinr/web-appbuilder-typescript-examples#5
  3. 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 from Typescript Support to TypeScript Support Nov 28, 2017

@gavinr gavinr referenced this issue Jan 29, 2018

Merged

TypeScript option #98

@gavinr gavinr added this to the v3? milestone Jan 30, 2018

@gavinr gavinr closed this Feb 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment