typings icon indicating copy to clipboard operation
typings copied to clipboard

Add widget example

Open jcardonadcdev opened this issue 7 years ago • 5 comments

It would be nice to have an advanced example that shows how to make a widget that extends _WidgetBase and _TemplatedMixin. I see some examples in github repositories, but it would be good to get an example from SitePen that demonstrates best practices.

jcardonadcdev avatar Mar 23 '17 13:03 jcardonadcdev

I would appreciate this too.

gavinr avatar Aug 01 '17 18:08 gavinr

In the meantime you will probably find this helpful https://www.sitepen.com/blog/2017/03/29/what-typescript-can-offer-to-dojo-1-x/

davewilton avatar Nov 17 '17 06:11 davewilton

Does anyone have an example of this working?

GordonSmith avatar Jul 26 '18 15:07 GordonSmith

Yes see the link above, you will find it very helpful. Basically you just need to add declareDecorator to your project and enable experimental decorators in your tsconfig.

Here is a link to a very simple example

https://www.dropbox.com/s/vmtc10dc405n39e/ExampleWidget.zip?dl=0

davewilton avatar Jul 27 '18 05:07 davewilton

Thanks for the sample - I had (finally) got something similar working myself.

The current issue I am seeing is trying to "derive" a Dojo JS class from a TypeScript Dojo Class. While this is probably just a non runner, it would greatly help in a large migration we are doing?

(Between this and https://github.com/OpenNTF/dojo-webpack-plugin we finally have a modern dev environment for the legacy wen app!!!).

GordonSmith avatar Jul 27 '18 06:07 GordonSmith