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

Serial API events: on(dis)connect -> (dis)connect_event #13925

Merged
merged 3 commits into from
Feb 3, 2022

Conversation

Elchi3
Copy link
Member

@Elchi3 Elchi3 commented Dec 9, 2021

Update per new events guideline

Content work needed.

@Elchi3 Elchi3 added the needs content update 📝 This PR needs a corresponding update to mdn/content to update the documentation label Dec 9, 2021
@github-actions github-actions bot added the data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API label Dec 9, 2021
@Elchi3
Copy link
Member Author

Elchi3 commented Dec 13, 2021

@foolip There are two events here but we have 4 entries because the event bubbles from SerialPort to Serial. Is this a scenario where we would want to have 2 entries only?

@foolip
Copy link
Collaborator

foolip commented Dec 22, 2021

@Elchi3 bubbling is fairly rare out side of the Node hierarchy, but for consistency I think we should do the same thing for everything that overrides the get the parent algorithm to allow bubbling. In addition to Serial, it happens in https://w3c.github.io/IndexedDB/.

On MDN, perhaps we should also consider pointing to bubbling event for the parent object types, similar to inherited properties and methods.

@Elchi3
Copy link
Member Author

Elchi3 commented Jan 10, 2022

but for consistency I think we should do the same thing for everything that overrides the get the parent algorithm to allow bubbling.

I don't know this algorithm and I understand what this means. Can you elaborate? What is the consequence for BCD?

On MDN, perhaps we should also consider pointing to bubbling event for the parent object types, similar to inherited properties and methods.

Okay. So then we probably want the two events documented under SerialPort? The Serial interface page can then contain pointers to bubbled events from SerialPort?

@foolip
Copy link
Collaborator

foolip commented Jan 11, 2022

but for consistency I think we should do the same thing for everything that overrides the get the parent algorithm to allow bubbling.

I don't know this algorithm and I understand what this means. Can you elaborate? What is the consequence for BCD?

It's how the specs express what event targets event bubble through. The kind of bubbling you're familiar with is when an event is fired on an element, and it bubbles first through all of its parent elements, then to the document and finally to the window. That path comes from "get the parent" being defined for the nodes involved here. Bubbling is very uncommon outside of nodes, but one can find those places by looking for "get the parent" in other specs. Serial and IndexedDB is what I found.

On MDN, perhaps we should also consider pointing to bubbling event for the parent object types, similar to inherited properties and methods.

Okay. So then we probably want the two events documented under SerialPort? The Serial interface page can then contain pointers to bubbled events from SerialPort?

Yes, I think that's exactly right.

@foolip
Copy link
Collaborator

foolip commented Feb 1, 2022

On MDN, perhaps we should also consider pointing to bubbling event for the parent object types, similar to inherited properties and methods.

Okay. So then we probably want the two events documented under SerialPort? The Serial interface page can then contain pointers to bubbled events from SerialPort?

Yes, I think that's exactly right.

@Elchi3 I'm not sure if we ended up on the same page after all. I see you've left the event entries in Serial.json, and I thought they'd only be left in the MDN page for Serial, not in BCD outside of SerialPort.json.

@Elchi3
Copy link
Member Author

Elchi3 commented Feb 1, 2022

I'm happy to remove them in Serial.json. In fact, that makes more sense to me now, too.

@foolip
Copy link
Collaborator

foolip commented Feb 1, 2022

Cool, back on the same page :D

@Elchi3 Elchi3 removed the needs content update 📝 This PR needs a corresponding update to mdn/content to update the documentation label Feb 3, 2022
@Elchi3 Elchi3 merged commit 05d063d into mdn:main Feb 3, 2022
@Elchi3 Elchi3 deleted the events-serial branch February 3, 2022 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants