Skip to content
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

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

Merged
merged 10 commits into from
Feb 14, 2024

Conversation

MattiasBuelens
Copy link
Collaborator

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.

@MattiasBuelens MattiasBuelens added the enhancement New feature or request label Feb 14, 2024
@MattiasBuelens MattiasBuelens merged commit cb10924 into main Feb 14, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants