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

How to determine when to do the manual allocation when using Imperative Shadow DOM Distribution API #746

Closed
caridy opened this issue Mar 8, 2018 · 2 comments

Comments

@caridy
Copy link

caridy commented Mar 8, 2018

Proposal: https://github.com/w3c/webcomponents/blob/gh-pages/proposals/Imperative-Shadow-DOM-Distribution-API.md

@hayatoito, the proposal is looking good from the perspective of doing the manual allocation, but it is not providing enough information, or end-to-end examples.

My main concern is that with manual, no auto allocation/slotting will be done, which probably mean that you cannot use slotchange event to observe changes in your slots. The question is, how will the developer know when to do the manual allocation? And the answer cannot be: "just use mutation observer".

I think from our side, we will like to have a reliable signal for changes on the light tree so the allocation can happen accordingly. The most dummy example could be:

<fancy-menu>
     <menu-item>one</menu-item>
     <menu-item>two</menu-item>
</fancy-menu>

When adding a new menu item (e.g.: myFancyMenuElement.appendChild(menuItemThreeElement)), we should be able to detect that operation, and take care of the manual slotting on the spot.

/cc @diervo

@annevk
Copy link
Collaborator

annevk commented Mar 9, 2018

Could you please mention this in whatwg/html#3534 instead. Seems good to keep discussion a bit centralized for now.

@annevk annevk closed this as completed Mar 9, 2018
@caridy
Copy link
Author

caridy commented Mar 9, 2018

too many notifications to keep up with everything :), will post there!

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

2 participants