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

appreciate your feedback for custom element reactions diagram #41

Closed
AndyOGo opened this issue Feb 19, 2019 · 3 comments
Closed

appreciate your feedback for custom element reactions diagram #41

AndyOGo opened this issue Feb 19, 2019 · 3 comments
Labels

Comments

@AndyOGo
Copy link

AndyOGo commented Feb 19, 2019

I just released an adapted version of the interactive react lifecycle methods diagram for custom element reactions:
https://andyogo.github.io/custom-element-reactions-diagram/

If you have time, I would appreciate your feedback very much.

@smalluban
Copy link
Contributor

Overall it is done quite well. I am not sure of the purpose, but I have some highlights:

  • define is not one of the element reactions, a complete list is described in the specs here, so I think this "Unknown phase" is not needed here.
  • connectedCallback/disconnectedCallback is also called when an element is moved from one place to another. I know, that in that process an element is disconnected, but your diagram and explanation suggests, that it works more like React components, which only calls unmount when the component is going to be destroyed.

@AndyOGo
Copy link
Author

AndyOGo commented Feb 21, 2019

@smalluban
Thanks for your great feedback.

I agree with you, strictly speaking constructor, define, aren't part of what are custom element's reactions.
Maybe lifecycle is a better fit, though I wanted to avoid that people start to think with React paradigms in mind and therefore used other terms by intention.

Indeed, there are many initiators for connectedCallback and disconnectedCallback, i.e. the whole DOM API - but I wanted to avoid to include the whole API.
Maybe it helps to prefix the initiators by e.g. to clarify that this is only one possibility?
Tracked here AndyOGo/custom-element-reactions-diagram#23

The purpose is to increase awareness and understanding of custom elements, to help people find relevant parts in the spec and actually study them carefully.

@AndyOGo
Copy link
Author

AndyOGo commented Feb 21, 2019

@smalluban
Done, Thanks a lot.
I have added two examples of the DOM API being marked as [CEReactions] extended IDL attribute.

https://andyogo.github.io/custom-element-reactions-diagram/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants