trunk icon indicating copy to clipboard operation
trunk copied to clipboard

Prerendering

Open MartinKavik opened this issue 5 years ago • 4 comments

Prerendering is important for SEO & SMO, website performance and it allows to use Rust frameworks as static site generators.

Seed templates use react-snap as a non-Rust prerendering tool.

I think we can assume that wasm-bindgen automatically downloads needed webdrivers and there is a browser already installed on the target platform to make testing possible.

So we should be able to implement prerendering using one of these crates:

  • https://crates.io/crates/fantoccini
  • https://crates.io/crates/thirtyfour
  • https://crates.io/crates/lw-webdriver
  • https://crates.io/crates/rusty-driver

MartinKavik avatar Sep 04 '20 11:09 MartinKavik

@MartinKavik just a quick response here. Given how SSR typically works, I'm thinking that it would be best to ship this functionality as part of the trunk library being designed over in #9. We could add feature switches for the major web server frameworks (tide, warp, actix-web &c), and then folks could just use the trunk::ssr (server-side rendering) middleware to render their app for the HTTP response. The framework used on the frontend wouldn't make a difference.

Thoughts?

thedodd avatar Sep 08 '20 19:09 thedodd

I'm not sure if it's directly related to SSR or webserver frameworks. I just want to start Trunk's dev server and generate HTML files automatically through a browser.

In the Seed quickstart, it's the command build:prerender: https://github.com/seed-rs/seed-quickstart-webpack/blob/master/package.json#L12. It's basically a very special case of build:release.

However I understand it may not have to be included in the Trunk core. I've just created thit issue because it will be a show-stopper for moving seed-rs.org and other projects to Trunk.

MartinKavik avatar Sep 09 '20 14:09 MartinKavik

It is a comment for information. Is there a desing for this proposal.

eribol avatar Jun 29 '21 17:06 eribol

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Dec 11 '23 00:12 github-actions[bot]