ProjectEvergreen / greenwood

Greenwood is your full-stack workbench for the web, focused on supporting modern web standards and development to help you create your next project.
https://www.greenwoodjs.io
MIT License
94 stars 9 forks source link

dynamic layouts for SSR #1248

Open thescientist13 opened 2 weeks ago

thescientist13 commented 2 weeks ago

Summary

Coming out of #955 / #1212 , one follow up feature to track is supporting dynamic layouts during SSR. So while this has been possible

src/
  layouts/
    app.js
    blog.js

The layout was executed only once at bundle time which means it was only a one time render. https://github.com/ProjectEvergreen/greenwood/blob/v0.30.0-alpha.2/packages/cli/src/lifecycles/bundle.js#L243

Details

Main trick is that I think this this will require bundling layouts into SSR pages like we do the body. Not sure how tricky this will be though. 🤔


Additionally, would be nice to support dynamic context layouts too, as currently they are hardcoded to only support HTML. https://github.com/ProjectEvergreen/greenwood/blob/v0.30.0-alpha.2/packages/cli/src/lib/templating-utils.js#L13