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

ServiceWorkerMessageEvent isn't consistent with MessageEvent #989

Closed
smaug---- opened this issue Oct 11, 2016 · 26 comments
Closed

ServiceWorkerMessageEvent isn't consistent with MessageEvent #989

smaug---- opened this issue Oct 11, 2016 · 26 comments

Comments

@smaug----
Copy link

Because of whatwg/html#1882, the interfaces have now different behavior when handling .ports for example.

But I'd recommend just merge the interfaces.

@smaug----
Copy link
Author

#988 is also related

@cdumez
Copy link

cdumez commented Oct 11, 2016

This also impacts ExtendableMessageEvent:
https://w3c.github.io/ServiceWorker/#extendablemessage-event-section

MessageEvent's ports attribute is no longer nullable in the HTML specification. It'd be great to align the similar interfaces in the Service Worker specification (or even merge the interfaces as @smaug---- suggests).

@foolip
Copy link
Member

foolip commented Oct 18, 2016

Ping @jungkees (most active committer recently)

@annevk
Copy link
Member

annevk commented Oct 19, 2016

@jungkees this is great, but there was also the suggestion to merge MessageEvent and ServiceWorkerMessageEvent. That's still pretty doable I think, no?

@jungkees
Copy link
Collaborator

Having looked at the previous discussion around this, we wanted the same for ServiceWorkerMessageEvent at the beginning. Later, for ExtendableMessageEvent, we had a reason not having been able to extend MessageEvent. I think even if we merge ServiceWorkerMessageEvent and MessageEvent at this time, we anyway have to maintain ExtendableMessageEvent interface separately as it's not a MessageEvent. Considering they have been shipped for a while, I'm inclined to regard them as pair of events defined in SW spec.

/cc @jakearchibald

@annevk
Copy link
Member

annevk commented Oct 21, 2016

One less class seems good? And MessageEvent / ExtendableMessageEvent we could potentially migrate to a shared mixin at some point.

@jungkees
Copy link
Collaborator

I'm not against refactoring. I've been concerned about the impact of the changes to the existing codes. If we do this, implementations should change, but the application codes won't be affected, right?

@annevk
Copy link
Member

annevk commented Oct 21, 2016

They could be affected if they use the class in some way. Extend its prototype, typeof it, etc. Seems unlikely, but there's a risk.

@annevk
Copy link
Member

annevk commented Oct 21, 2016

To be clear, that's only a problem for ServiceWorkerMessageEvent. The other change would not be noticeable (and implementations wouldn't even have to copy us necessarily there if they didn't care for it).

@foolip
Copy link
Member

foolip commented Oct 21, 2016

11 hits for "ServiceWorkerMessageEvent" results from httparchive:har.2016_09_15_chrome_requests_bodies and 6 from httparchive:har.2016_09_15_android_requests_bodies. They're things like http://docs.devdocs.io/dom/index.json?1469400308 and no real usage that I can see.

But, the Blink change would have to happen soon, if the spec changes but Blink waits, we could end up in a very silly place.

@jungkees
Copy link
Collaborator

But, the Blink change would have to happen soon, if the spec changes but Blink waits, we could end up in a very silly place.

Indeed. Other browsers also won't be able to completely avoid being in this kind of silly place for the time being I think.

@annevk
Copy link
Member

annevk commented Oct 21, 2016

@foolip are you okay with trying/doing it? Should be easy enough for others to follow if so.

@foolip
Copy link
Member

foolip commented Oct 21, 2016

I see it's also in Gecko. If one of Blink and Gecko changes right away and the other commits to following before long, I think the risk looks incredibly low, so 👍

@jakearchibald
Copy link
Contributor

I'm happy with this changing. Highly unlikely to break anything, and hopefully we'll see it in beta etc if it does.

@foolip
Copy link
Member

foolip commented Oct 21, 2016

So I guess step 1 would be to update MessageEvent in HTML to use (WindowProxy or MessagePort or ServiceWorker)?

@jungkees
Copy link
Collaborator

Considering the shared mixin for MessageEvent and ExtendableMessageEvent, wouldn't it be (WindowProxy or MessagePort or ServiceWorker or Client)?

@foolip
Copy link
Member

foolip commented Oct 21, 2016

I wasn't thinking about ExtendableMessageEvent, but yeah, I guess it's just as well to fix it all at once. @annevk, do you feel like trying the HTML changes?

@annevk
Copy link
Member

annevk commented Oct 21, 2016

For mixins:

  • I think I'd rather wait until IDL has actual mixins
  • The other issue is what to do with the dictionary, since dictionaries don't support mixins, we'd have to duplicate there for now

Given that, I think we should postpone deduplication there, especially as it doesn't directly impact implementations or developers, but I'll raise an IDL issue on mixins for dictionaries.

For removing ServiceWorkerMessageEvent, I can make the change to HTML to make MessageEvent reusable for that case.

@foolip
Copy link
Member

foolip commented Oct 21, 2016

SGTM.

@annevk annevk reopened this Oct 21, 2016
annevk added a commit to whatwg/html that referenced this issue Oct 21, 2016
See w3c/ServiceWorker#989 for discussion. I
also took the liberty to update all our broken Service Worker
specification links.
@jungkees
Copy link
Collaborator

Sounds good.

@annevk
Copy link
Member

annevk commented Oct 21, 2016

Thanks, done.

annevk added a commit to whatwg/html that referenced this issue Oct 24, 2016
See w3c/ServiceWorker#989 for discussion. I
also took the liberty to update all our broken Service Worker
specification links.
@LJWatson
Copy link

Thanks Remy. Red wine for me... or tequila of course :)

Léonie.

@LeonieWatson tink.uk Carpe diem

On 21/10/2016 13:18, Anne van Kesteren wrote:

Thanks, done.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#989 (comment), or
mute the thread
https://github.com/notifications/unsubscribe-auth/ADVr6f3AQTCAZ9nT6NqylFakryjyGUq9ks5q2K2ygaJpZM4KTie9.

domenic pushed a commit to whatwg/html that referenced this issue Nov 10, 2016
@annevk
Copy link
Member

annevk commented Nov 11, 2016

@jungkees I think it would be better if the generated results are somewhat wrong or something is not working well to open a PR and get those issues resolved first. Doing it through comments on a commit is very hard to follow.

@jungkees
Copy link
Collaborator

Okay. Got it.

@annevk
Copy link
Member

annevk commented Nov 11, 2016

That also makes the review process easier if we start doing more through PRs here. It's been working very well over in WHATWG-land.

@jungkees
Copy link
Collaborator

Understood. I'll try to do so. Thanks!

alice pushed a commit to alice/html that referenced this issue Jan 8, 2019
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

7 participants