Skip to content

Conversation

@StrahilKazlachev
Copy link
Contributor

@StrahilKazlachev StrahilKazlachev commented Sep 6, 2018

ShadowSlot and PassThroughSlot have custom logic that calls ShadowDOM.distributeNodes/ShadowDOM.distributeView after binding the fallback View. Because of that ShadowDOM.distributeView should not be called in View.prototype.bind for fallback Views. Calling it results in the creation and binding of the fallback View for nested <slot>s even if override is provided for that nested <slot>.
@EisenbergEffect @bigopon

let ShadowSlot and PassThroughSlot handle nodes/view distribution themselves
@bigopon
Copy link
Member

bigopon commented Sep 6, 2018

@StrahilKazlachev nice that you figured this out. This is the most obscure part in this module. Maybe we will need to give it few tests to go together with this. Can you also help with that @StrahilKazlachev

@EisenbergEffect
Copy link
Contributor

Seems reasonable but I get nervous when changing code in here because there aren't really tests and it's rather complicated and a little shaky code.

@StrahilKazlachev
Copy link
Contributor Author

@EisenbergEffect @bigopon will testing in such manner suffice? I know those aren't exactly unit tests.
If yes, I'll refactor and expand.

@bigopon
Copy link
Member

bigopon commented Sep 7, 2018

@StrahilKazlachev That looks nice to me. We can test with element first, and then later will test with slot scenarios where it involves only text node. For unit test, I think if you already have pin pointed the issue, maybe a test for that specific part only if possible would be better, @EisenbergEffect 's call

@EisenbergEffect
Copy link
Contributor

I'd be very happy with some more tests like this, yes :)

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

Successfully merging this pull request may close these issues.

3 participants