THEOplayer / web-ui

UI component library for the THEOplayer Web SDK
https://www.theoplayer.com/docs/open-video-ui/web/
MIT License
10 stars 0 forks source link

Add support for static site generation (SSG) or server-side rendering (SSR) #50

Closed MattiasBuelens closed 7 months ago

MattiasBuelens commented 7 months ago

This adds an entry point to @theoplayer/web-ui for Node.js, which uses Lit's SSR DOM shims to replace HTMLElement and customElements. We also make sure not to use document.createElement() during initial load, by lazy-loading all <template> elements.

This allows @theoplayer/react-ui to be loaded during SSG/SSR, such as when using the Server React DOM APIs or when using a full-stack framework like Next.js. You still need to hydrate your React app on the client to make the UI interactive, but that's usually handled by your app framework.