Closed tomayac closed 2 years ago
Yes, my intent was for it to be dev-defined like the Manifest as it will be necessary for orchestrating updates to the correct widget (especially if you have multiple). Having a unique id
, per widget, that is known to the developer should make that process more predictable and faster (no need to enumerate Widgets). If the implementation concern is potential collisions, I think there can be an internal process for remedying that by generating an system-level identifier that combines the widget id
with the Manifest id
(e.g., "https://example.com/" + "inbox" or similar).
Tucking into the SW spec (and its inheritance from HTML) a bit more, it looks like the Client id
originates from HTML’s environment concept which is the readonly, browser-directed piece. Assuming the WidgetClient
interface inherits from Client
in the same way WindowClient
does, it might make sense to pivot slightly to map it to the Notification tag
. I still think id
makes more sense from a nomenclature standpoint, but mechanically the tag
concept is more in line with what I’m looking for (a way to disambiguate Widgets). The process for updating a Notification (which you first have to find by its tag
) is a little clunkier than I’d like for this, but I don’t think everything needs to be modeled 1:1 on Notifications either.
Thanks for considering my comment, tag
seems like a good compromise and avoids misunderstandings.
If
WidgetClient.id
is supposed to be similar toWindowClient.id
, then it's readonly and will be set by the browser to an opaque string:Were you maybe thinking to model this analog to the manifest's
id
member, which is writable?