-
Notifications
You must be signed in to change notification settings - Fork 96
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
feat: ssr-friendly slot-controller #2505
base: main
Are you sure you want to change the base?
Conversation
|
✅ Deploy Preview for patternfly-elements ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
👉 DRAFT PR DO NOT MERGE 👈
This approach is experimental and requires discussion before pursuing. This PR is a PoC only. However there is a lot to get excited about. for example, we could load a
/elements/pf-icon/pf-icon-ssr.js
at ssr time which, instead of setting up a bunch of client side js to fetch and render the icon, would just dump the contents of the svg into shadow root withawait readFile
, at SSR time.Read more: https://lit.dev/docs/ssr/overview/
TODO:
use export conditions instead of
isServer
What I did
has-slotted
host attrTesting Instructions
Notes to Reviewers
Problem: Lit-SSR can't access the children, whereas SlotController relies on knowledge about the children.
Proposal: read
has-slotted="a,b,c"
attr on SlotController hosts. This has limitations:hasSlotted
in connectedCallback, only inrender
(lit may relax this limitation in the future)