dojo / typings

Dojo 1 - TypeScript Typings (including Dijit and DojoX)
Other
28 stars 37 forks source link

Add widget example #120

Open jcardonadcdev opened 7 years ago

jcardonadcdev commented 7 years ago

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.

gavinr commented 7 years ago

I would appreciate this too.

davewilton commented 6 years ago

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/

GordonSmith commented 6 years ago

Does anyone have an example of this working?

davewilton commented 6 years ago

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

GordonSmith commented 6 years ago

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!!!).