build(storybook): update storybook to v10 DEV-1246#7212
Merged
Conversation
Member
Author
|
@greptile-apps review please |
Contributor
|
Member
Author
|
@greptile-apps please re-review |
jamesrkiger
reviewed
Jul 3, 2026
| "description": "KoboToolbox frontend interface.", | ||
| "engines": { | ||
| "node": "^20.18.1 || ^22.4.1" | ||
| "node": ">=20.19.0 || >=22.12.0" |
Contributor
There was a problem hiding this comment.
I think we should stick with the caret here. The caret keeps the versions bound to major version. >= does not, which makes the second clause redundant because the first clause includes anything above 20.19.
Member
Author
There was a problem hiding this comment.
You're right, fixed :)
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.
📣 Summary
Upgraded Storybook from v9 to v10 for compatibility with modern tooling and Node 20.19+. And hopes of making it behave better.
👷 Description for instance maintainers
This upgrade requires Node 20.19.0 or newer (was 20.18.1). The
.nvmrcfile has been updated, sonvm usewill switch to the correct version. Although the version bump was due to Storybook (code testing), the version bump is project wide, so it influences the production code building too.💭 Notes
Changes here:
Package updates:
@storybook/addon-links(deprecated in v10) - AFAIK we didn't use it at all@storybook/addon-webpack5-compiler-swc(incompatible, switched to Babel)jest-environment-jsdomto v30 to match Jest v30orval:^7.10.0→~7.10.0(prevents upgrade to 7.21.0 which requires Node 22.18+)webpack-extract-translation-keys-plugin:^6.1.0→6.1.0(exact version to match existing patch file)Storybook configuration:
.storybook/main.js→.storybook/main.mjs- Converted to ESM (Storybook 10 requirement)__dirnamepolyfill usingimport.meta.url.module.cssfilesType migrations for Storybook 10:
ESLint plugin upgrade:
@tanstack/eslint-plugin-query- the newer version changed howeslint-disabledirectives work - they must be placed before the hook call, not inside the options object. Fixed affected files.Orval config fixes for Node 20.19+:
orval.config.js- Converted from mixed ESM/CommonJS to pure CommonJSjsapp/js/api/orval.operationName.js- Convertedimporttorequire()(Node 20.19+ is stricter about ESM in non-module files)Node version updates (20.18.1 → 20.19.0):
.nvmrcand.node-version,package.json,Dockerfile(already at 20.19, one missing spot was still there), GitHub Actions workflows,scripts/hints.jsTypeScript:
tsconfig.json- UpdatedmoduleResolutionto handle Storybook 10's ESM packagesWhy Babel instead of SWC?
The main webpack config (
webpack.common.js) hasrefresh: trueset for the SWC loader, which pairs with ReactRefreshWebpackPlugin in dev mode. When Storybook tried to use the SWC compiler addon, it inherited this setting and started injecting React Refresh code ($RefreshReg$,$RefreshSig$) without the runtime plugin that actually defines those globals. Result: browser errors. Babel doesn't have this conflict and works cleanly with Storybook's HMR.👀 Preview steps
nvm useto switch to Node 20.19npm cito install dependencies (if you encounter some issues, trynpm cache clean)npm run storybookhttp://localhost:6006npm run build:storybooknpm run test.stories.tsxfile in VSCode@storybook/typesorDecoratorFunction