Open
Description
I'm creating a docs website using whyframe and astro, the react integration works pretty well, but every reload on the page causes a little flash in the iframe, so after reading the source code i've imagined if we can expose a createServerApp
from the virtual import:
---
// /frames/default.astro
import { createServerApp } from "whyframe:app"
const html = await createServerApp(Astro.url.searchParams.get("frame-id"))
---
<Fragment set:html={html} />
So instead of collecting the id from dataset attributes we can send directly in the frame URL, like so:
<iframe src="/frames/default?frame-id=some-id" />
And then, in the createServerApp
internals we dynamic import the frame data and render with the matched framework function(e.g. renderToString). What do you think?