A static site generator for data apps, dashboards, reports, and more. Observable Framework combines JavaScript on the front-end for interactive graphics with any language on the back-end for data analysis.
For even faster (perceived) page loads it would be valuable to render initial views of charts and other content on the server, then "hydrate" them on the client once corresponding runtime cells are ready. For example, I'd like to publish static SVG as part of the initial page content, which can then be replaced with "live" content upon load.
I realize there be dragons here, especially with arbitrary code that may involve randomness, generators, or otherwise cause strange changes of content upon hydration, and so on. Nevertheless, I see a lot of value in being able to knowingly opt-in to SSR.
I imagine one would have to instantiate a runtime during server-side compilation then extract resulting content. We do something similar in Living Papers using Puppeteer to extract and screenshot runtime-generated content, though a lighter weight approach (e.g., using jsdom and node canvas?) may be preferable and cover common use cases.
It looks like some work in this direction is ongoing, though I'm not sure of the planned scope. So, just wanted to share a plug for this!
Thanks for the great work on Framework!
For even faster (perceived) page loads it would be valuable to render initial views of charts and other content on the server, then "hydrate" them on the client once corresponding runtime cells are ready. For example, I'd like to publish static SVG as part of the initial page content, which can then be replaced with "live" content upon load.
I realize there be dragons here, especially with arbitrary code that may involve randomness, generators, or otherwise cause strange changes of content upon hydration, and so on. Nevertheless, I see a lot of value in being able to knowingly opt-in to SSR.
I imagine one would have to instantiate a runtime during server-side compilation then extract resulting content. We do something similar in Living Papers using Puppeteer to extract and screenshot runtime-generated content, though a lighter weight approach (e.g., using jsdom and node canvas?) may be preferable and cover common use cases.
It looks like some work in this direction is ongoing, though I'm not sure of the planned scope. So, just wanted to share a plug for this!