@whyframe/astro

Status

Experimental. As there isn’t a way to render Astro code dynamically, we rely on data-why="<framework>" attributes to pass the iframe content as framework code. However, since this is not a 1-to-1 conversion, features like:

  • <style> is not supported in JSX
  • <script> is not support in all frameworks

Ultimately this integration would only render Astro code, and the framework feature would be removed.

@whyframe/astro exports a Vite plugin with the options below:

Options

include

  • Type: string | RegExp | (string | RegExp)[]
  • Default: /\.astro$/

A picomatch pattern, or array of patterns, which specifies the files the plugin should operate on.

exclude

  • Type: string | RegExp | (string | RegExp)[]

A picomatch pattern, or array of patterns, which specifies the files to be ignored by the plugin.

defaultFramework

  • Type: 'svelte' | 'vue' | 'solid' | 'preact' | 'react'

All iframes require a value for data-why to render the HTML content using a specific UI framework. If unset, it can fallback to this value.