-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Description:
Our Web Components currently don't support server-side rendering, which limits their usage in SSR frameworks like Next.js (our documentation app), Remix, and other modern frameworks. This causes hydration issues, flash of unstyled content (FOUC), and poor SEO for pages using our components.
Expected Behaviour:
- Components render correctly on the server without browser APIs
- No hydration mismatches when components load on client
- Declarative Shadow DOM support for proper SSR
- Compatible with Next.js app router and pages router
- Improved initial page load performance and SEO
Approach:
- Investigate Declarative Shadow DOM (DSD) for SSR compatibility
- Add server-side rendering utilities for Web Components (e.g.,
@lit-labs/ssrif using Lit) - Identify and abstract browser-only APIs (localStorage, window, document) with SSR-safe fallbacks
- Add SSR compatibility checks in component lifecycle methods
- Test SSR integration with our Next.js documentation app
- Document SSR setup and best practices for consumers
- Consider creating SSR-friendly React bindings as part of shadcn integration effort
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Ready