whyframe icon indicating copy to clipboard operation
whyframe copied to clipboard

Support latest Astro

Open bluwy opened this issue 2 years ago • 2 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.

bluwy avatar Oct 06 '23 06:10 bluwy

Any update on this?

prodkt avatar Oct 11 '23 15:10 prodkt

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.

bluwy avatar Oct 11 '23 15:10 bluwy