-
Notifications
You must be signed in to change notification settings - Fork 545
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
[Batch] Improve slots implementation in PRC to enable React SSR compatibility & performance gain #1690
Comments
We probably want to pick this one up when we work on Navigation List https://github.com/github/primer/issues/637. |
Another use case for this (without SSR) - https://github.com/orgs/github/issues/issues (behind feature flag) Screen.Recording.2022-07-25.at.10.19.03.online-video-cutter.com.1.mp4As a stop gap, we moved the contents of leading visual inside text |
Another example where this falls short: https://github.com/github/primer/issues/1224 |
Hi! This issue has been marked as stale because it has been open with no activity for 180 days. You can comment on the issue or remove the stale label to keep it open. If you do nothing, this issue will be closed in 7 days. |
Hey @siddharthkp, would it be helpful to keep this one open for reference or should we go ahead and close? I have a draft in the Primer Roadmap backlog to revisit slots so it's definitely still on the radar. https://github.com/orgs/github/projects/2759/views/32?filterQuery=-no%3Afocus-area+-status%3A%22Inbox+%F0%9F%93%A5%22+-label%3Ainitiative+slots |
@lesliecdubs Late reply, but I think we should keep this open :) Leaving here for future reference, we have a draft of the implementation in this closed PR: #2525 |
👋🏻 @colebemis starting this week, could you please add a |
Trending🟢 on track Target date2023-04-21 This WeekMigrated
Next Week
|
Trending🟢 on track Target date2023-04-21 This WeekMigrated
Next Week
|
Hooray! 🎉 Thank you for the quick work on this one @colebemis! |
Background
The current slot implementation isn't compatible with server-side rendering (SSR). It only renders the freeform main slot on the server and then adds other slots after mounting on the client (with useEffect) which is not a problem in client-only components like Overlay but can be a bad loading experience for other components with layout shift.
The tradeoffs considered at the time of building this component are mentioned in this comment: https://github.com/github/primer/issues/1224#issuecomment-1222450075
Task
Update the slots implementation to render consistently across the server and client. This will introduce a limitation that a slot needs to be a direct child of the slot container, deep nesting is not allowed.
Components to migrate
Related work
Clean up
The text was updated successfully, but these errors were encountered: