Open
Description
Thanks for sharing this w/me @aarongustafson! Here are my initial thoughts! I think the real tl;dr takeaway of these is that I think there should be a separation between defining widgets and configuring widgets, and given that separation.
Basic definition thoughts
- Why use
tag
instead ofid
given thattag
is defined asclient.id
?tag
isn't clear to me on first glance as the ID for the widget. - Is it
widget
(as in sample) ortemplate
(as in Templated Widgets) to define what widget template to use?
Overall thoughts
- I'm having a little trouble understanding exactly what this is for based on the descriptions here. Would this allow an installed PWA to offer like and Android or iOS homescreen widget? A Mac sidebar widget? A Windows gadget? The Adaptive Card system mentioned at the end seems like a specific usecase, but one I'm not super familiar with (and I'd imagine others may not be). More concrete examples up-front, maybe with low-res wireframes, would help contextualize this a bit more IMO.
update
feels like maybe it should be something like keywords for frequency instead of seconds? I'm a bit torn here, but saying I want this to update every 900 seconds and then having the definition of update be "thanks for your request, we'll get to it when we see fit" feels worse to me than more vague keywords.type
feels like it is inherently tied to the widget type, or more likely a bit of configuration for a piece of widget data. See next.- While both "widgets", I actually think that host-provided widgets and user-defined widgets should be entirely separate entities. A host-provided widget, to me, is conceptually a host-provided component, like in a style guide, that has properties and needs specific to that component. A user-defined widget, though, is more like creating your own component, where you need to define those things yourself. The breakdown of needs is configuration vs creation. With this all said, I think this'd make more sense to me if broken down as follows:
WidgetDefinition
- Focused on creating a custom widget. Requires an identifier (maybe following CSS's lead with some defined prefix, likewidget-{{foo}}
like data attributes require a leadingdata-
),url
as currently defined, and optionaldata
, which would include a list of required and optional parameters (with some way to do validation, probably in the SW) and thetype
expected for each.backgrounds
andicons
are optionally be always optional. This would allow someone to define a custom widget as follows:
Then it can be used as follows:{ name: 'widget-my-w', url: '/widgets/agenda', data: { required: [ { name: 'feed', type: 'text/calendar' }, { name: 'cities', type: 'text/json' } ], } }
{ name: 'City Feed 1', id: 'city-feed-1', template: 'widget-my-w', data: { feed: '/widgets/data/agenda.ical', cities: '/widgets/data/cities.json' } }
Widgets
- Focused on configuring a widget, so would requirename
,id
,template
, and optionaldata
,update
, andactions
. Things likeicons
andbackgrounds
should live underdata
. The Adaptive Card example could then be re-written as:
{ name: 'My Adaptive Card', id: 'my-adaptive-card', template: 'ms-acn', data: { prefer: "medium", small: '/widgets/data/agenda-acn-small.json', medium: '/widgets/data/agenda-acn-medium.json', large: '/widgets/data/agenda-acn-large.json' } }
Metadata
Assignees
Labels
No labels