collective / volto-hydra

A volto addon to let you edit content in realtime when you have many frontends written in any framework
1 stars 2 forks source link

Test working with static site generation (SSG) like gatsby #139

Open djay opened 2 weeks ago

djay commented 2 weeks ago

needs c.webhooks or similar. also needs preview mode or preview server on the frontend while editing so the updates are fast

djay commented 1 week ago

Gastby uses a preview server - https://www.gatsbyjs.com/docs/how-to/local-development/running-a-gatsby-preview-server/ But it still needs a request sent to that server to tell it to refresh. It's not clear if that instantly invalidate so that a page request afterwards will result in the updated content.

if we use c.webhooks to do this then might not guarente the refresh happens before hydra tries to load the page again. So perhaps we need to more directly support this kind of webhook so we can ensure we always get the refreshed page after save? Or perhaps we just have change the UI somewhat so the user doesn't always expect the page to be updated? maybe a delay that does an extra refresh after a certain about of time?

Or do you make the frontend switch to SSR mode when editing? - https://www.gatsbyjs.com/docs/reference/rendering-options/server-side-rendering/