DioxusLabs / dioxus

Fullstack GUI library for web, desktop, mobile, and more.
https://dioxuslabs.com
Apache License 2.0
19.3k stars 735 forks source link

Create a Static Site Generation platform; Deduplicate hot reloading code #2226

Closed ealmloff closed 1 month ago

ealmloff commented 2 months ago

This PR introduces a new dioxus-static-site-generation crate that handles the setup for statically generated and hydrated sites like the docsite.

Why is this a separate crate?

This is a separate crate instead of a feature in fullstack or the router because static site generation needs to pull in the sitemap from the router crate and the router crate needs to pull in the router context from the fullstack crate.

Static site generation can also make sense with or without dioxus fullstack depending on if you want a pure SSG only page or a page with SSG and hydration. This PR is focused on SSG with hydration, but we could support SSG without prerendering in the future

TODO:

Closes #2006 Closes https://github.com/DioxusLabs/dioxus/issues/2249 Closes https://github.com/DioxusLabs/dioxus/issues/1847