Closed bennypowers closed 1 year ago
this is an escape hatch for advanced usage, ordinary users don't need to use this.
some server-side frameworks will (sometimes helpfully, sometimes annoyingly) "compile away" your slots, and move, rather than project your content
Source (an imaginary framework SFC format):
<template framework:mode="dsd"> <slot></slot> <!-- it's a trap! framework appends, doesn't project --> </template>
Source (light DOM):
<dsd-slide> <ul> <li reveal>A</li> <li reveal>B</li> <ul> </dsd-slide>
Result:
<dsd-slide> <template shadowrootmode="open"> <ul> <li reveal>A</li> <li reveal>B</li> </ul> </template> </dsd-slide>
Frameworks shouldn't do that
Agreed! but in the mean time they do do that.
Make more internal state public
not ideal. Better to just pass a reference, like so.
LGTM. 👍 Let me know if it's ready to merge
this is an escape hatch for advanced usage, ordinary users don't need to use this.
some server-side frameworks will (sometimes helpfully, sometimes annoyingly) "compile away" your slots, and move, rather than project your content
Source (an imaginary framework SFC format):
Source (light DOM):
Result:
Alternatives
Agreed! but in the mean time they do do that.
not ideal. Better to just pass a reference, like so.