Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServiceWorkerRegistration.pushRegistrationManager is very verbose #47

Closed
beverloo opened this issue Sep 29, 2014 · 4 comments
Closed

ServiceWorkerRegistration.pushRegistrationManager is very verbose #47

beverloo opened this issue Sep 29, 2014 · 4 comments

Comments

@beverloo
Copy link
Member

Given the example in the specification:

navigator.serviceWorker.ready.then(function (serviceWorkerRegistration) {
  serviceWorkerRegistration.pushRegistrationManager.register(...);
});

This obviously is very verbose. We renamed "push" to "pushRegistrationManager" to avoid potential confusion with Array.prototype.push per a comment from the TAG.

A mid-ground would be to consider renaming this to "pushRegistration", as "manager" doesn't add any value in this case (there's only one active registration per SWR). However, there is a PushRegistration object as well, used by various methods on the PRM.

Straw man: Change the PushRegistration interface to be a dictionary instead. That way it doesn't have to be exposed on the global, and we can rename pushRegistrationManager to pushRegistration, avoiding developer confusion.

@jakearchibald
Copy link
Contributor

pushMessaging, pushManager, pushService?

@mvano
Copy link
Contributor

mvano commented Dec 5, 2014

Using pushManager of type PushManager has worked well for me. It's how I implemented it in Chrome, and it has felt like a reasonably distinct identifier that is not overly verbose.

@johnmellor
Copy link
Contributor

+1 for pushMessaging (nice and unambiguous)

@mvano
Copy link
Contributor

mvano commented Dec 15, 2014

I think all of Jake's suggestions are better than the current PushRegistrationManager. I'd prefer to avoid PushService because that's already a concept in the spec. I prefer PushManager over PushMessaging because it's a noun, so I went with that.

@mvano mvano closed this as completed Dec 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants