Skip to content

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

  • Story docs for AI agents work on Storybook 11.0.0-rc.2 and later, which changed how story docs providers are chained; Storybook 10.6 keeps working (#420). Astro story snippets also no longer get another provider’s import line above them.
  • storybook build works for projects whose .storybook/preview.ts registers addon-docs, including the CSF-factories setup npm create storybook writes on Storybook 11; it failed with ReferenceError: document is not defined (#410). The static prerender now also applies that preview’s global decorators and parameters to CSF3 stories.
  • In the static prerender, a decorator that reads a browser-only global such as document or window is skipped for the stories it wraps, with a warning, instead of leaving those stories out of the build; their other decorators still apply (#413). A definePreview() preview’s global decorators aren’t covered yet (#411).
  • @storybook-astro/renderer no longer installs @types/node 20 into your project (#333). If your own code uses Node’s types and your project doesn’t list @types/node, add it: npm i -D @types/node.
  • On Storybook 11, Astro stories run by @storybook/addon-vitest get no extracted props while the Docgen Server is on, as React and Vue stories do; the Controls & ArgTypes docs now say so (#368).
  • Component tests that use renderStory work on Astro 7.4.9 and later, on Node 20.19+ or 22.12+ (#329).
  • On Windows, islands in Astro stories hydrate in storybook dev (#382). Thanks to @Dan503 for the report and the fix.
  • Framework stories (React, Vue, Svelte, Solid) are unmounted when Storybook removes them, so their effects clean up (#238).
  • React Fast Refresh now works on Vite 8 / Astro 7, so React stories and islands keep their state across edits (#380).
  • framework: { name: '@storybook-astro/framework' } with no options no longer fails with “Cannot read properties of undefined (reading ‘resolveFrom’)” (#370).
  • A prop’s @default JSDoc tag fills the props table’s Default column, @ignore on a base interface no longer hides a prop the component redeclares, and a quoted key in the Astro.props destructuring keeps its default (#371, #373).
  • On Storybook 11, a project without a usable TypeScript gets one warning instead of two, and a TypeScript 7 project is told how to keep 7 alongside TypeScript 6 (#367).
  • On Storybook 11, the Docgen Server and the components manifest are on by default, so AI agents using @storybook/addon-mcp get Astro components’ props, slots and story snippets without configuration (#214). Turn them off with features: { docgenServer: false } or features: { componentsManifest: false }. Storybook 10.6 is unchanged.
  • viteFinal no longer returns optimizeDeps.esbuildOptions or rolldownOptions; a plugin adds them for the Vite that runs (#378). A viteFinal in .storybook/main.js that pushes onto them must create them first. To drop the framework’s optimizer options, filter the storybook-astro:optimize-deps plugin out of config.plugins.
  • The props table shows each default as the component writes it, drops props marked @ignore, and AI agents get a prop’s whole type instead of TypeScript’s shortened one (#355, #356, #357).
  • With the Docgen Server on, slot rows in the Controls panel have their text controls again (#267).
  • In a static build, every control of an Astro story is disabled, including rows from the Docgen Server and rows Storybook infers from args (#375).
  • In a monorepo, the framework now sets Vite’s dependency optimizer options for the Vite that actually runs Storybook (#378). A pnpm app on Vite 8 without a direct vite dependency no longer gets the Vite 6/7 options and their deprecation warning because an older Vite was hoisted to the workspace root.
  • Storybook 11 support, alongside Storybook 10, including the Storybook 11 builds of storybook-solidjs-vite (#205, #207, #208). Storybook 11 needs Node 22.12 or later.
  • With the Docgen Server and the components manifest on, AI agents using @storybook/addon-mcp get each Astro component’s props and slots, and each story’s description and an Astro snippet (#353, #354). The Controls & ArgTypes page has a new “Components manifest and AI agents” section (#323).
  • Leaving an Astro story while it renders no longer reloads the preview, cancels the render request, and no longer reports a server error that arrives afterwards (#271, #303, #342).
  • Show code and the Code panel no longer break on args that JSON can’t represent, such as a Symbol, a BigInt or an object that refers to itself (#273).
  • A @storybook/addon-vitest run exits as soon as its tests finish (#312).
  • With more than one astro.config.* file, Storybook reads the one Astro would (#257).
  • The Docs props table lists the slots an Astro component accepts, with descriptions from @slot comments (#188).
  • Each slot gets a text control in the Controls panel, so slot content can be edited without the args.slots JSON editor (#203, #306).
  • Stylesheets imported by a story’s components and the modules they import (plain CSS, Sass, CSS Modules, plugin virtual stylesheets), and the <style> blocks of server-rendered Vue and Svelte components, now ship with the story, as an Astro page ships them (#223, #241, #242, #243). Components loaded with a dynamic import() or import.meta.glob ship their CSS too, without being run (#245, #277).
  • parameters.docs.source.objectProps: 'inline' writes object and array props inline in Show code and the Code panel (#190).
  • A “Rendering story…” indicator shows while a slow Astro story renders, and the canvas keeps its height between renders (#236).
  • Show code and the Code panel put a tag’s attributes on separate lines when one spans lines (#190).
  • Astro component <style> blocks are now scoped the way Astro scopes them, in dev, static builds and server mode, and <style lang="scss"> works (#189). Story CSS goes into the preview’s <head> (#224), and Docs pages share one copy of CSS that several stories ship (#234).
  • scopedStyleStrategy and compressHTML from astro.config.* now apply in Storybook, and static builds and server mode load the project’s Astro integrations (#226, #258).
  • Fonts declared under fonts: are injected into the iframe head in static and server builds (#248).
  • Storybook 11 readiness: the framework reads Storybook 11’s renamed features.docgenServer flag, and keeps reading experimentalDocgenServer on Storybook 10.6 (#206).
  • The Solid integration’s optional peer is now storybook-solidjs-vite (>=10.0.0 <10.1.0 || ^10.6.0) instead of the abandoned storybook-solidjs (#209).
  • vitestPatchForSolidJs from @storybook-astro/framework/vitest is no longer needed or applied by defineConfig, and will be removed in the next major version (#209).
  • storybook build failed with the Solid integration on storybook-solidjs-vite 10.1 and later, including the current 10.7 (#209).
  • CSS Module styles were missing from static and server-mode builds on Astro 7.4 (#199).
  • The framework’s internal SSR servers logged Failed to run dependency scan, and on some setups failed the build (#184).
  • Builds with both componentsManifest and the Docgen Server enabled silently failed to write the components manifest (#183).
  • Support for @astrojs/react 7 (#192). Its peer range was ^4 || ^5 || ^6, so installing the framework next to the current @astrojs/react failed with ERESOLVE.
  • Support for Vitest 5 (#193). The optional vitest peer range is now ^4.1.0 || ^5.0.0.
  • Docgen extracted no props on Windows; the autodocs props table only showed props inferred from a story’s args (#185).
  • With TypeScript 7 installed, docgen crashed storybook dev and addon-vitest runs (#197). Component descriptions and props tables are now skipped with a warning to install TypeScript 5 or 6.
  • TypeScript in an Astro component <script> reached the browser untranspiled in storybook dev and threw a SyntaxError (#187).
  • Static builds left pre-rendered Astro stories pointing at the build machine for component scripts and server-only images (#186). Scripts are now bundled into _astro/ with the hydrated islands, and images the build never emitted are copied under a content hash.
  • Images imported from src/ stopped loading on Astro 7.4 (#196), and Astro font families resolved to nothing on Astro 7.4.
  • storyRules module mocks were ignored by storybook build (#194).
  • Static builds left /@fs/ image URLs in place when the project path contained a space or another URL-encoded character.
  • JSDoc/props extraction can now run in Storybook’s Docgen Server instead of the Vite plugin (#173). Set features: { experimentalDocgenServer: true } in .storybook/main.* to move extraction into the long-lived worker thread Storybook core owns, off the dev server’s critical path. Requires Storybook 10.6+.
  • Docs “Show code” and the Code Panel now show the Astro template a story’s args describe, instead of falling back to the raw story file (#106, #161). The snippet regenerates on every render, so it follows Controls changes.
  • Importing a story whose component uses astro:assets failed at module load with TypeError: Unknown file extension ".astro" on Vitest below 4.1.0 (#117). vitest is now declared as an optional peer dependency (^4.1.0).
  • Component descriptions and prop documentation are extracted from JSDoc in a component’s .astro frontmatter, so autodocs pages populate without argTypes boilerplate in story files (#163, #110). Covers per-prop descriptions, types and defaults, select controls for literal union props, and types imported from other files including through tsconfig paths aliases. Inherited DOM attributes are filtered out while destructured props are kept. Opt out with the docgen framework option.
  • @storybook/addon-vitest support: Storybook’s official test runner now runs Astro component stories as Vitest browser tests on Astro 5, 6 and 7 (#159). Stories render through the same server-side pipeline the canvas uses, and play functions run against the resulting DOM.
  • Vite’s dependency scanner can now read .astro files (#159), fixing Failed to run dependency scan. Skipping dependency pre-bundling errors that surfaced as Vitest failed to find the current suite or TypeError: Illegal invocation under @storybook/addon-vitest.
  • The framework now reads the Vite version from the project’s own copy rather than the hoisted one, fixing incorrect Vite-version gates in monorepos (#159).
  • The Storybook renderer entry-preview exclusion is now correctly scoped to the esbuild optimizer (Vite ≤7) instead of Vite 8 (#159).
  • The internal Astro SSR Vite server is now closed when the parent server closes, fixing close timed out after 10000ms under @storybook/addon-vitest (#159).
  • Islands declared inside .astro components nested inside a story’s top-level .astro file are now collected for the static build, fixing missing hydration for such components in a published static Storybook (#168).
  • Vite plugins auto-loaded from the project’s astro.config are now applied to every render pipeline (static prerender, hydrated-island build, dev SSR), fixing broken markup for components that depend on a project Vite plugin (#170).
  • Decorator support (#40): Storybook’s decorator API now works for Astro component stories — global (.storybook/preview.js), component-level, and story-level decorators all compose into the story’s server-rendered tree in a single request, reusing the configured-component slot machinery. Three decorator shapes are supported: a component descriptor ({ component, props?, slots? }, with the story auto-placed in the default slot), an HTML string built around Story() (e.g. (Story) => `<div>${Story()}</div>`), and a bare Astro component (decorators: [Wrapper]) as sugar for the descriptor form. Works in dev mode, server mode, static prerender (decorators run at build time against initialGlobals), and the portable-stories testing API (composeStories/composeStory/renderStory). Framework component stories (React, Vue, etc.) keep Storybook’s own decorator composition; Vue decorators need the render-function form ((story) => () => h(...)), not the documented { components, template } shape — see the Decorators guide for details.
  • setProjectAnnotations is no longer silently ignored by composeStories/composeStory in the testing API (#40). Any global decorators, parameters, etc. registered via setProjectAnnotations([preview]) are now applied as expected.
  • Bare Astro components used as decorators (decorators: [Wrapper]) now work through real Storybook story preparation instead of throwing an “Astro components cannot be used in the browser” stub error (#40).
  • Imported SVG files are now correctly passed as Astro SvgComponent args (#154). Previously, an SVG imported as import StarIcon from './star.svg' was treated as a plain object rather than detected as an Astro SVG component.
  • An array slot’s string entries are now sanitized together as one HTML document instead of each entry in isolation, so a wrapper tag’s opening and closing halves can live in separate array entries around a component (#149). Previously, sanitization auto-closed an entry like '<div>' on its own and discarded a lone '</div>' in a later entry, so the component ended up rendered as a sibling after a self-closed wrapper instead of nested inside it.
  • Storybook updated to 10.5.2 (#151).
  • Configured-component slots: a slots entry can now be a { component, props, slots } object, placing a child component in a parent’s slot with its own props and slot content — and slot entries can be arrays that mix plain HTML strings with (configured) components (#146). This extends the bare component-as-slot support from #128, which rendered the child with default props and no slots. A configured component’s props are passed through untouched (not HTML-sanitized); its slots are sanitized like any other string slot. Component tags written inside a string are still not compiled — pass the imported component reference.
  • storybook build no longer fails with ReferenceError: document is not defined during the static prerender for CSF4 projects that register addons whose UI kit touches the DOM (e.g. @storybook/addon-a11y, @storybook/addon-themes) (#145). CSF4 stories import @storybook/preview, which re-exports the project’s .storybook/preview.ts and pulls those addons — and through them storybook/internal/components, which reads document at module load under Node. The prerender now stubs @storybook/preview with a minimal CSF4 factory (it only needs each story’s component and args), sidestepping the project preview and its entire addon graph. This generalizes the earlier per-package docs stubs (#121, #130), which only covered @storybook/addon-docs/@storybook/blocks.
  • Astro components can now be passed as props (args: { Icon }, rendered by the parent via <Comp />) and as slot content (args.slots.default, the React children pattern) — closes #128. Component slot content keeps its own rendered markup; plain-string slots are still sanitized.
  • Astro 7 support — verified against Astro 7’s Rust compiler (now the default) and Vite 8 (Rolldown). No configuration changes are required to move an Astro 6 setup to Astro 7.
  • New integration/astro7 and integration/astro7-server example apps, plus an astro7 smoke-test template. CI build, browser-test, smoke-test, and publish workflows now cover Astro 5, 6, and 7.
  • Peer dependency ranges widened to accept Astro 7 (astro, and the @astrojs/* framework integrations at their Astro 7 majors) and @vitejs/plugin-react@6.
  • get-tsconfig dependency aligned to the exact version Astro pins (5.0.0-beta.4), so Astro 6.4+/7 and the framework resolve a single deduped copy that exposes both getTsconfig and readTsconfig.
  • Images served from the project’s public/ directory now render in the static build — /@fs/<root>/public/... URLs are now rewritten to their served root path (e.g. /images/logo.png).
  • optimizeDeps.esbuildOptions is now only set on Vite ≤7, removing the deprecation warning emitted under Vite 8.
  • Storybook dev server no longer hangs with a blank preview under Astro 7 / Vite 8.
  • @vitejs/plugin-react is now an optional peer dependency, fixing ERESOLVE on projects without React that use Vite 7.
  • Date story args are no longer corrupted before rendering — the arg serializer now only recurses into plain objects.
  • Date args also survive the static build (renderMode: 'static') prerender path.
  • Default docs story height set in renderer for consistent documentation views
  • Font CSS is now injected into the render response so fonts declared in astro.config load correctly in the browser
  • @storybook/blocks stubbed in SSR prerender to fix document is not defined errors
  • *.astro type shim now auto-applied via triple-slash reference in dist/index.d.ts
  • TypeScript errors across the framework package resolved
  • Default docs story height now applied to CSF-factory story previews
  • Replaced deprecated tsconfck dependency with get-tsconfig
  • Astro component scripts now re-run on story navigation
  • Default renderMode is now 'static' instead of 'server'
  • AstroComponentFactory type is now callable to match Astro language server shape
  • Child component scoped styles are now correctly loaded when rendering parent stories
  • Hybrid CSS injection approach resolves ‘No Astro CSS’ error in certain configurations
  • Astro 6 Font Provider API — font providers declared in astro.config are now resolved and injected during Storybook SSR
  • User astro.config integrations are now auto-loaded into Vite, so framework-specific plugins (e.g. @astrojs/react) no longer need manual configuration
  • Tsconfig path aliases (e.g. @/components/...) now resolve correctly for embedded island hydration
  • Renderer annotations are now composed into definePreview for CSF4 compatibility
  • Factory story-rule mocks — defineStoryRules now supports factory functions for dynamic mock values
  • Date props (e.g. pubDate) now survive JSON serialization across the render pipeline — previously caused date.toISOString is not a function errors in components like FormattedDate
  • Restored missing ./node export dropped during dist migration
  • Removed preset re-export from index entry to prevent bundler conflicts and excluded framework from Vite optimizeDeps
  • Hydrated framework component styles now emitted correctly in static prerender builds
  • defineStoryRules and StoryRule types moved to the ./node entry so they resolve in Node-only contexts
  • Scoped hasDefaultExport check to .jsx/.tsx files only in the hydratable component scan
  • Renderer now clears the canvas when switching between framework renderers, preventing stacked DOM from different frameworks
  • Suppressed unanalyzable dynamic import warning emitted by Vite during SSR
  • Restored built server hydration and interactive behavior for server-mode stories
  • Astro container now loaded via Vite SSR for correct slot class identity
  • Excluded fsevents and preview-api from optimizeDeps to prevent bundling errors
  • Unified Astro render pipeline and shared production render runtime across dev, static, and server modes
  • Simplified Vite plugin naming conventions
  • Integration examples now consume compiled package dist instead of source
  • Controls panel is now automatically disabled for Astro stories in production (static Storybook) builds
  • Resolved broken images and escaped slot HTML in static prerender
  • Alpine.js component detection no longer incorrectly includes plain .ts/.js files in the hydratable source scan
  • Svelte and Vue component chunks now emitted directly instead of through virtual modules, improving static build compatibility
  • Prevented vite-plugin-svelte from processing component virtual module stubs
  • Passthrough image service now correctly injected during Astro 6 build prerender
  • React plugin include filter in vitest configs now uses a RegExp for compatibility with more project setups
  • setProjectAnnotations, composeStory, and composeStories are now generic over renderer type for improved TypeScript support
  • Widened @vitejs/plugin-vue peer dep range to ^5.2.3 || ^6.0.0 and @vitejs/plugin-vue-jsx to ^4.1.2 || ^5.0.0 — fixes install conflict when using @astrojs/vue@6
  • Stubbed astro:toolbar:internal virtual module in Storybook context to prevent build errors with Astro’s internal toolbar module
  • Renderer now resolved via import.meta.resolve for compatibility with pnpm installations
  • Nested Astro component rendering support — components can now include other Astro components as children
  • Image support via astro:assets Image component — integrated passthrough image service into the renderer
  • definePreview and defineMain helpers for improved type safety and DX in preview.js and main.js files
  • Pre-release smoke test infrastructure — validates compiled packages work in real Astro 5 and 6 projects before publishing
  • Astro integration virtual module stubs (@astrojs/react:opts, astro:preact:opts, etc.)
  • TypeScript declarations now properly generated with tsconfig.json in both packages
  • Resolved implicit any and Integration[] | undefined type errors in middleware plugin
  • Virtual module ambient declarations now globally visible across the framework
  • Middleware path correctly resolved from compiled dist chunks
  • Global setup correctly compiled and resolved from dist/
  • Server entry resolved correctly from package root for tarball installations
  • Framework package now includes @storybook/builder-vite in smoke test dependencies
  • Removed invalid —no-telemetry flag from storybook build
  • Fixed portable timeout wrapper in smoke test orchestration
  • Release Manager skill updated with release branch cutting workflow
  • Documentation updated for nested component support and assets handling
  • Fixed Astro 5.17.2+ compatibility by requiring Vite 6.4.1+ — the framework package previously allowed Vite 5.x which caused “Cannot read properties of undefined (reading ‘name’)” error due to missing Vite 6+ this.environment feature
  • Vite 5.4.0+ support — framework package now compatible with Astro 5 projects using Vite 5.x
  • Astro 5 projects with Vite 5.4.21+ can now install @storybook-astro/framework without peer dependency conflicts
  • storybook dev now works correctly with fresh npm installs — previously produced a Failed to load astro-prerendered-stories.json. Received 404 Not Found error or a blank “Astro Component / requires server-side rendering” placeholder
  • Added @storybook-astro/renderer to Vite optimizeDeps.exclude in the framework preset, preventing esbuild pre-bundling from stripping import.meta.hot out of the renderer chunk
  • Changed getViteHot() in the renderer to access import.meta.hot directly rather than via an intermediate variable — Vite’s importAnalysis plugin detects hot usage by static analysis on the literal import.meta.hot string; the previous indirect pattern compiled by tsup was invisible to this analysis
  • renderAstroToCanvas now catches a prerendered stories fetch failure gracefully and falls through to HMR rendering with a clear console warning, instead of crashing with a confusing network error (defensive fallback)
  • Stable 1.0.0 release with production-ready Storybook Astro framework
  • Full support for Astro 5 (5.5.3+) and Astro 6
  • Multi-framework support: React, Vue, Svelte, Solid, Preact, Alpine.js
  • Server-side rendering with middleware pipeline
  • Portable stories (composeStories) for vitest integration
  • Comprehensive testing utilities and framework integration helpers
  • Framework now production-ready after extensive beta testing and monorepo restructuring
  • Improved documentation and Getting Started guide
  • Enhanced website with component demos across all frameworks
  • Documentation and website updated to reflect support for both Astro 5 (5.5.3+) and Astro 6 Beta
  • Framework package description, README, Getting Started guide, and root README now list Astro 5 + 6
  • Migrated repository from lukemcd/storybook-astro to storybook-astro/storybook-astro
  • Restructured as a monorepo with Yarn workspaces (packages/@storybook-astro/*, apps/*)
  • Marketing website separated into apps/website/
  • Storybook demo/test project moved to apps/sandbox-astro6/
  • Added Astro 5 sandbox (apps/sandbox-astro5/) for cross-version compatibility testing
  • Root package.json stripped to monorepo config with shared devDeps only
  • Getting Started guide (docs/GETTING_STARTED.md) with detailed story file and Astro slots documentation
  • Package README for npm display
  • findPackageDir helper in cjsInteropPlugin for monorepo-aware node_modules resolution
  • cjsInteropPlugin now walks up from process.cwd() to find hoisted packages in monorepo structure
  • ESLint config updated for monorepo paths and Svelte parser compatibility
  • CI workflow updated with workspace-based builds and timeout for hung Storybook processes
  • Website build fixes: resolved missing assets, styles, and README path for monorepo layout
  • Ensure integrations ?? [] guard survives tsup compilation (default parameter was stripped)
  • Handle undefined integrations option — Storybook now starts without requiring integrations in framework options
  • Add @storybook/builder-vite to install instructions
  • Use npm publish compatible version for @storybook-astro/renderer dependency (was workspace:* which only Yarn resolves)
  • Remove wildcard * hard dependencies (react, vue, svelte, etc.) from framework package that caused install failures — these are peer dependencies only
  • Astro 6 peer dependency fix was missing from beta.2 publish due to branch sync issue
  • Astro 6 peer dependency compatibility — astro peer dep now accepts ^5.5.3 || ^6.0.0-beta.0
  • All @astrojs/* integration peer deps updated for Astro 6 beta versions
  • yarn lint and yarn lint:fix scripts
  • Versioning and branching strategy documentation (docs/VERSIONING.md)
  • Storybook docs panel typography overrides for light background readability
  • Mobile hamburger navigation for the website
  • Accordion components updated to dark theme styling across all 7 frameworks
  • Website “Components Demo” renamed to “Sample Components”
  • Navigation reordered: About, Contribute, Sample Components, Storybook Demo
  • About page text contrast improved (#c9d1d9 for paragraphs/lists, styled inline code and code blocks)
  • Astro 6 component rendering in Storybook via the Container API
  • Multi-framework support: React, Vue, Svelte, Solid, Preact, Alpine.js
  • Server-side rendering with middleware pipeline
  • Portable stories (composeStories) for vitest integration
  • Testing utilities (testStoryRenders, testStoryComposition)
  • Framework integration helpers with glob-based routing
  • Astro website with component demos and documentation
  • Header and Footer components with configurable props and Storybook controls
  • Contribute page and CONTRIBUTING.md with branching strategy
  • Requires Astro 6 (beta) and Storybook 8.6+
  • This is the first public beta release under the @storybook-astro organization