Draft Mode: Support Websockets for real live-preview #50642
Unanswered
LasseRosenow
asked this question in
App Router
Replies: 1 comment
-
|
You can use SSE instead of websockets (https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
It would be really helpful if with an enabled
Draft Mode, it were possible to update the content of the webpage live via for exampleWebsockets.This allows
real live-previewinstead of needing to reload the page every time to get the new data.Use Case
I have
Headless-CMSwhich has alive-previewfeature that embeds the page via an iframe.The
Headless-CMSallows me to subscribe to a preview endpoint, which continuously returns the data I currently type into my CMS.So when I write something on my CMS, it immediately gets pushed to the client website without me needing to save, so I can in theory see my input being rendered on the client in real-time.
But with next.js this does not work so well, because even in
Draft Modethe server prerenders the pages content and sends a static page to the client browser.I need some way for next.js to update that client browser without having to reload the whole page on every change.
Beta Was this translation helpful? Give feedback.
All reactions