Open mbostock opened 1 year ago
This is now closely related to the new page loader feature #1523. We could consider server-side code blocks as “page fragment loaders” — programs that generate fragments of Markdown (or perhaps HTML) that is interpolated into the page during build. In effect, they are “just” page loaders, but without explicit names, and that get incorporated into the rest of the page. This approach would also support fenced code blocks in any language (at least any interpreted language that we already support for data loaders, but that list is also extensible by the user).
I’d like a way to opt-in to server-side JavaScript, akin to
"use client";
with React Server Components (or more precisely"use server";
with Server Actions, I guess?). I’m imagining something like this: