background-fetch icon indicating copy to clipboard operation
background-fetch copied to clipboard

is updateUI better replaced via postMessage?

Open kenchris opened this issue 6 years ago • 3 comments

In response to https://github.com/w3ctag/design-reviews/issues/279

Seeing examples like event.updateUI(Level ${level} ready to play!);, it is not clear to me as an app developer whether I would like that to be updated in platform UI, a notification or a toast integrated inside my game.

For this reason, I am wondering whether just using postMessage/onmessage might make more sense for updating such UI.

kenchris avatar May 29 '18 13:05 kenchris

updateUI is for platform-controlled UI (such as a notification), so postMessage doesn't seem appropriate. For page-based UI, postMessage is the recommendation.

jakearchibald avatar May 29 '18 13:05 jakearchibald

Maybe at least make it clear in the spec/explainer that this is not always the thing to use. I still think that the "UI" name is way too generic, and maybe it is better to know - or define - what UI is actually being updated

kenchris avatar May 29 '18 13:05 kenchris

I guess we need to come up with a name for the UI. Seems confusing to call it a 'notification', especially as that's unlikely to be the implementation on desktop. Open to ideas.

jakearchibald avatar May 29 '18 13:05 jakearchibald