Repository navigation
Support native TSRX components in Storybook - #1082
Merged
Merged
Conversation
This was referenced Nov 6, 2026
The Solid and Vue plugin tests keep main's #1250 module-id tests and this branch's HMR CSS test, with both sides' node:fs imports. Main's #1125 already keeps the binding of a default-exported Vue component (const App = ...; export default App), so main's transform and shared compile test are kept, this branch's equivalent export-specifier rewrite and its vue-default-function-export changeset are dropped, and its Vue regression test, which passes on main's output, is kept. pnpm-lock.yaml is main's plus the entries this branch's lockfile added, re-resolved with the storybook-examples vue and vue-jsx-vapor pins moved to main's 3.6.0-rc.14 and 3.2.29 (#1296), so the README and llms.txt no longer list a Vue peer mismatch. Starting from main's lockfile alone resolved vue-component-meta 3.3.14, which brings @volar/* 2.4.30 and gives the VS Code extension two volar-service-typescript copies. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FRKmwAwuyPbGQ1ejNqiJ46
In the Solid and Vue plugins, main's #1103 added a transform hook right before the handleHotUpdate this branch makes async to refresh CSS; both are kept. The other #1103 changes to the five plugins merged cleanly next to this branch's order: 'post' config hooks, and main changed no dependencies, so pnpm-lock.yaml stays as this branch had it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FRKmwAwuyPbGQ1ejNqiJ46
Two import lists conflicted: tsrx-vue/tests/basic.test.js keeps main's TSRX_ERRORS import and this branch's typescript import, and tsrx/tests/utils/platform.test.js keeps main's createVolarMappingsResult and this branch's mergePlatformDefinitions. Main changed no dependencies, so pnpm-lock.yaml stays as this branch had it, with vue-component-meta 3.3.13 and one @volar 2.4.28. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FRKmwAwuyPbGQ1ejNqiJ46
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 907fa5e. Configure here.
… doesn't compile This branch made the Solid and Vue plugins compile a `.tsrx` file in `handleHotUpdate`, to refresh its extracted CSS before the virtual JS reloads. The compile had no error handling, so saving a file that doesn't compile, such as one with an unclosed tag, threw out of the hook. Vite then stopped the update: the virtual module wasn't invalidated, so its `load` never ran to report the compile error as it does on main, where the hook only invalidates. The refresh now catches the error and keeps the last good CSS, as the React and Preact plugins do since #1182, and the hook still returns the virtual and CSS modules so the reload reports the error. A regression test in each plugin saves a broken update after a good one and checks both. Reported by Cursor Bugbot on #1082. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FRKmwAwuyPbGQ1ejNqiJ46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

TSRX components can run in Storybook through their native target compilers and existing renderers, with stories kept in ordinary
.stories.ts/.stories.tsxfiles. Add runnable React, Preact, Solid, Vue Vapor, Hono DOM, and Ripple examples in a private workspace package, plus a copyable setup guide. Octane continues to use its separateOctaneCompatexample.The examples use direct native components where supported and small native lifecycle adapters where needed. Controls update props without resetting component state. No Storybook repository changes, new published preset, or
.stories.tsrxsupport are required.The browser matrix exposed three compatibility problems, fixed here with regressions and patch changesets:
Add a dedicated CI job that checks native component/story props and tests all six development and static Storybook canvases. Declare the root DOM matcher dependency and the extension's development TypeScript provider so the expanded dependency graph preserves existing test and VSIX packaging contracts.
Validation:
The examples cover browser canvases. SSR, hydration, native mobile hosts, automatic
.tsrxdocgen, and.stories.tsrxdiscovery remain outside this change. The guide records the pinned Solid/Vue prerelease versions and their upstream peer-range mismatches.Note
Medium Risk
Touches build-time
import.meta.envmerging across all Vite target plugins and adds CI browser coverage; HMR/CSS changes affect Solid/Vue dev workflows but are well-tested.Overview
Adds a private
@tsrx/storybook-examplespackage with runnable Storybook setups for React, Preact, Solid, Vue Vapor, Hono DOM, and Ripple—ordinary.stories.ts(x)importing native.tsrxcomponents, typed props tests, and Playwright journeys over dev and static builds. CI gains a storybook job (typecheck + browser tests, failure artifacts); docs/README/llms point consumers at the examples.Fixes Storybook+Vite integration in core and all target Vite plugins:
merge_platform_definitionsnow merges compatible JSONimport.meta.envdefaults with TSRX platform flags (and addsimport.meta.env.platformfor Vite dev), while still rejecting conflicts; pluginconfighooks runorder: 'post'so Storybook’s environmentdefineis composed before platform specialization.Solid and Vue plugins refresh extracted scoped CSS on HMR before virtual JS reload (clear cache when styles removed; keep last good CSS when compile fails). Vue compiler gains a regression for default-exported components that also re-export the same binding.
Minor tooling: root
@testing-library/jest-dom, VS Code plugin devtypescript, patch changesets for affected packages.Reviewed by Cursor Bugbot for commit 501e41e. Bugbot is set up for automated code reviews on this repo. Configure here.