bluwy / whyframe

Develop components in isolation with just an iframe

Home Page:https://whyframe.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support Astro 3

bluwy opened this issue · comments

WIP branch: https://github.com/bluwy/whyframe/tree/astro-3

I can't quite figure out the perfect way to support its new JSX support. In the branch, I updated docs/astro.config.mjs to support this new change, but it's a bit ugly.

React is hard to support now because it needs the preamble code in the client-side inside the iframe. Astro only adds the preamble code if there's an island in the frame page.

Any update on this?

I haven't find the time to continue this, but feel free if you'd like to. The only thing missing is to get this preamble code injected into the iframe's html, through the @whyframe/astro plugin, for dev only.

The plugin could use the whyframe:app module and the transform hook to inject this preamble code to the page. However, I haven't tried this yet and whether this could be done cleanly. But at least copying the preamble code for now could be fine though.