Closed rishson closed 7 years ago
Is this really required now we've moved to classes? I don't think there much boilerplate.
Well create-app
will probably be used a few times a year, but create-widget
will be used much more I think.
It could:
create: MyWidget.ts
, /styles/MyWidget.css
, /tests/unit/MyWidget.ts
(potentially add to /unit/all.ts
)
For MyWidget.ts
, it could:
widget-core
and Themeable
)@theme
MyWidgetProperties
const myWidgetBase = ThemeableMixin(WidgetBase)
render
, e.g.:@theme(css)
export default class MyWidget extends MyWidgetBase<MyWidgetProperties> {
All of the above is tiresome copy/paste that we could easily automate. I know we will have to keep in sync with with widget-core
but the rate of change of the authoring system should slow. Angular has good cli
tools to create widgets and I think this is a decent expectation of users in other frameworks.
I really don't think currently this will provide that value you think it will.
I think users will spend far more time creating widgets than they will creating apps, so it would be nice to add a boilerplate generator.
I really don't think currently this will provide that value you think it will.
There's one way to find out (e.g. try to create the command and see what can be generalized). For what it's worth, a large part of the tutorial for creating a custom widget is to basically add these files, add boilerplate, etc., so there may be more value for beginners, and that's probably better than encouraging them to take an existing widget and copy/pasta it.
@dylans I guess so; feels like it would be something for a community style issue or one hit wonder that can be picked up when we are light on other tasks.
Sure, though it will mean a rewrite of one of the beginner tutorials... :)
This would be a new command and most likely repository, do you think the issue should be moved to meta?
Issue moved to dojo/meta #194 via ZenHub
@rishson commented on Tue Feb 07 2017
Either a new repo
cli-create-widget
or extendcli-create-app
to be a generic boilerplate creator.I think users will spend far more time creating widgets than they will creating apps, so it would be nice to add a boilerplate generator. Ideally, it should be useful internally as well to generate widgets in
@dojo/widgets
.