DioxusLabs / DioxusLabs/dioxus
Allow SSG to generate content with resources pending
- Dominant language
- Rust
- Stars
- 39.1k
- Forks
- 1.9k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 4
Description
## Feature Request
Currently static site generation is only useful for _truly_ static sites. Like a blog without comments.
This is because the static content that gets rendered will run `use_resource`s to completion. So if you wanted to use SSG for a blog with comments, the initial page load would just contain whatever comments were present at the time the site was generated. Similarly if you had a feed or any dynamic content that might change from time to time, that content would just be stale from the time you generated the site.
## Implement Suggestion
I think that there should be an option (perhaps in [`ssg::Config`](https://docs.rs/dioxus-static-site-generation/0.6.0-alpha.2/dioxus_static_site_generation/struct.Config.html)?) to render static routes with all resources in the state of `UseResourceState::Pending`, and then have the client side run the resources to completion on page load. This way, your blog would render immediately with potentially nice skeleton placeholders in the comment section, and then they'd hydrate with the actual resources client side.
This functionality would basically just let `ssg` be a better version of `web` -- all of its existing functionality, plus the fast render and SEO benefits from `ssg` / `fullstack`.
I'm interested in working on this if it is feasible as a first Dioxus issue.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.