Repository navigation
TanStack: Fix createServerFn validator mock - #35185
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds a ChangescreateServerFn mock validator chain
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The Danger failure is only asking for labels, but I don't have permission to add labels to this repo. Could a maintainer add the appropriate labels? Suggested based on this fix: |
|
Any news? Would be cool to get this PR merged. cc @ndelangen @huang-julien @valentinpalkovic |
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 73 | 73 | 0 |
| Self size | 21.32 MB | 22.16 MB | 🚨 +835 KB 🚨 |
| Dependency size | 36.44 MB | 36.44 MB | 0 B |
| Bundle Size Analyzer | Link | Link |
@storybook/ember
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 187 | 187 | 0 |
| Self size | 13 KB | 15 KB | 🚨 +2 KB 🚨 |
| Dependency size | 30.94 MB | 30.94 MB | 🎉 -652 B 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/nextjs
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 533 | 533 | 0 |
| Self size | 640 KB | 663 KB | 🚨 +23 KB 🚨 |
| Dependency size | 62.27 MB | 62.31 MB | 🚨 +34 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/nextjs-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 93 | 93 | 0 |
| Self size | 1.37 MB | 1.39 MB | 🚨 +22 KB 🚨 |
| Dependency size | 23.97 MB | 24.01 MB | 🚨 +38 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-native-web-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 122 | 122 | 0 |
| Self size | 29 KB | 30 KB | 🚨 +940 B 🚨 |
| Dependency size | 25.04 MB | 25.08 MB | 🚨 +38 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 83 | 83 | 0 |
| Self size | 32 KB | 36 KB | 🚨 +4 KB 🚨 |
| Dependency size | 21.75 MB | 21.78 MB | 🚨 +34 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-webpack5
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 274 | 274 | 0 |
| Self size | 23 KB | 23 KB | 🚨 +777 B 🚨 |
| Dependency size | 48.06 MB | 48.09 MB | 🚨 +34 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/tanstack-react
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 84 | 84 | 0 |
| Self size | 112 KB | 110 KB | 🎉 -2 KB 🎉 |
| Dependency size | 21.78 MB | 21.82 MB | 🚨 +38 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/cli
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 205 | 205 | 0 |
| Self size | 827 KB | 827 KB | 🚨 +84 B 🚨 |
| Dependency size | 91.32 MB | 92.15 MB | 🚨 +834 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/codemod
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 198 | 198 | 0 |
| Self size | 32 KB | 32 KB | 🎉 -115 B 🎉 |
| Dependency size | 89.80 MB | 90.63 MB | 🚨 +835 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
create-storybook
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 74 | 74 | 0 |
| Self size | 1.09 MB | 1.09 MB | 🎉 -720 B 🎉 |
| Dependency size | 57.77 MB | 58.60 MB | 🚨 +835 KB 🚨 |
| Bundle Size Analyzer | node | node |
@storybook/react
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 59 | 59 | 0 |
| Self size | 1.49 MB | 1.52 MB | 🚨 +35 KB 🚨 |
| Dependency size | 12.45 MB | 12.45 MB | 🚨 +81 B 🚨 |
| Bundle Size Analyzer | Link | Link |
…tor-mock TanStack: Fix createServerFn validator mock (cherry picked from commit 50b895a)
Closes #35174
What I did
Adds support for the TanStack Start
createServerFn().validator(...).handler(...)chain in the@storybook/tanstack-reactStart mock. The mock already treatedinputValidatoras a no-op builder step;validatornow behaves the same way so stories using the documented TanStack Start validator syntax do not crash beforehandler()is mocked.Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
No manual UI testing is needed for this mock-builder change. To verify manually, add a story or imported module that defines a server function with
createServerFn().validator(...).handler(...); Storybook should load it withoutcreateServerFn(...).validator is not a function.Commands run:
yarn install --immutableyarn nx compile coreyarn vitest run --config code/frameworks/tanstack-react/vitest.config.ts code/frameworks/tanstack-react/src/export-mocks/start.test.ts(failed before the fix withcreateServerFn(...).validator is not a function, then passed after the fix)cd code && yarn fmt:writeyarn nx compile eslint-pluginyarn --cwd code lint:js:cmd frameworks/tanstack-react/src/export-mocks/start.ts frameworks/tanstack-react/src/export-mocks/start.test.tsyarn vitest run --config code/frameworks/tanstack-react/vitest.config.ts code/frameworks/tanstack-react/src/export-mocks/start.test.ts code/frameworks/tanstack-react/src/export-mocks/react-router.test.tsyarn nx compile tanstack-reactyarn nx check tanstack-reactyarn vitest run code/frameworks/tanstack-react/src/export-mocks/start.test.tsDocumentation
MIGRATION.MD
Note: I used Codex while preparing this change, reviewed the final diff, and ran the listed checks locally.
Summary by CodeRabbit
Tests
Chores