-
Notifications
You must be signed in to change notification settings - Fork 28
Description
One of the problems I (and other developers) have had with Dijit in the past is the requirement of calling .startup() on programmatically-invoked widgets, and often having to manage the manual chaining of such invocations. (.destroy/.destroyRecursive is equally painful, if not more so, usually.)
I recently had to write some code to plug onto the side of our application to check that all our widgets in our DOM had correctly had .startup called on them, and that dead widgets had been .destroy()ed correctly, as this is so tricky to get right. I found quite a number of widgets which hadn't got this right (mostly by third party groups tbh).
So I'm a little surprised to see delite propagating a manual .startup/.destroy system. (See issue #222 for instance.)
Working with .startup() is extra tricky when mixing widgets with other frameworks, which won't pass on such chained calls or participate in this custom widget lifecycle. Frameworks such as Angular et al, which provide excellent array-based data-binding and repeater controls can happily create and remove widgets, but don't know to call .startup/.destroy, and so interop becomes quite hard.
The Web Components spec - whilst incomplete, obviously - is heading towards a mechanism which works a little differently from .startup/.destroy, namely one that informs the widget of attaches/detaches (without the widget having to chain that information manually). Polymer is implementing these callbacks There's nothing manual involved, although admittedly being told that you're detached from the DOM tree doesn't necessarily mean you're never coming back.
Are there any plans to obviate the need for manual calls to .startup/.destroy? With their presence, I can't quite see how delite widgets will interop well with other Web Component frameworks, especially where delite widgets are constructed by any other framework that doesn't know to call .startup?