You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MIGRATION.md
+26-23Lines changed: 26 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,11 @@
3
3
-[From version 9.x to 10.0.0](#from-version-9x-to-1000)
4
4
-[Core Changes](#core-changes)
5
5
-[Local addons must be fully resolved](#local-addons-must-be-fully-resolved)
6
-
-[The `.storybook/main.*`-file must be valid ESM](#the-storybookmain-file-must-be-valid-esm)
6
+
-[The `.storybook/main.*`file and other presets must be valid ESM](#the-storybookmain-file-and-other-presets-must-be-valid-esm)
7
7
-[Node.js 20.19+ or 22.12+ required](#nodejs-2019-or-2212-required)
8
8
-[Require `tsconfig.json``moduleResolution` set to value that supports `types` condition](#require-tsconfigjson-moduleresolution-set-to-value-that-supports-types-condition)
9
9
-[`core.builder` configuration must be a fully resolved path](#corebuilder-configuration-must-be-a-fully-resolved-path)
A `main.ts` file that's CJS is no longer supported.
531
+
A `main.ts` file that's CJS is no longer supported. The same applies to any custom preset files.
532
+
533
+
Additionally, **extensionless relative imports are no longer supported** in JavaScript-based configuration files (`.storybook/main.js`) and custom presets. All relative imports must now include explicit file extensions.
534
+
535
+
**Before (no longer works):**
536
+
```js
537
+
// .storybook/main.js
538
+
importmyPresetfrom'./my-file';
539
+
```
540
+
541
+
**After:**
542
+
```js
543
+
// .storybook/main.js
544
+
importmyPresetfrom'./my-file.js';
545
+
```
546
+
547
+
This change aligns with Node.js ESM requirements, where relative imports must specify the full file extension. This applies to `.storybook/main.js` and any custom preset files. While TypeScript-based files (`.storybook/main.ts`) will continue to work with extensionless imports for now through automatic resolution, we recommend migrating to explicit extensions for consistency and better compatibility.
548
+
549
+
**Recommended approach for all files:**
550
+
- Use `.js` for JavaScript files
551
+
- Use `.mjs` for ES modules
552
+
- Use `.ts` for TypeScript files
553
+
- Always include the extension in relative imports
533
554
534
555
#### Node.js 20.19+ or 22.12+ required
535
556
@@ -586,24 +607,6 @@ export const core = {
586
607
During development of Storybook [Tags](https://storybook.js.org/docs/writing-stories/tags), we created `dev-only`, `docs-only`, and `test-only` built-in tags. These tags were never documented and superseded by the currently-documented `dev`, `autodocs`, and `test` tags which provide more precise control. The outdated `x-only` tags are removed in 10.0.
587
608
During development of Storybook [Tags](https://storybook.js.org/docs/writing-stories/tags), we created `dev-only`, `docs-only`, and `test-only` built-in tags. These tags were never documented and superceded by the currently-documented `dev`, `autodocs`, and `test` tags which provide more precise control. The outdated `x-only` tags are removed in 10.0.
588
609
589
-
#### Extensionless imports in JS-based preset files are no longer supported
590
-
591
-
Storybook 10 no longer supports extensionless relative imports in JavaScript-based preset and configuration files (e.g., `.storybook/main.js`). All relative imports must now include explicit file extensions.
592
-
593
-
**Before (no longer works):**
594
-
```js
595
-
// .storybook/main.js
596
-
importmyPresetfrom'./my-file';
597
-
```
598
-
599
-
**After:**
600
-
```js
601
-
// .storybook/main.js
602
-
importmyPresetfrom'./my-file.js';
603
-
```
604
-
605
-
This change aligns with Node.js ESM requirements, where relative imports must specify the full file extension. While TypeScript-based files (`.storybook/main.ts`) will continue to work with extensionless imports for now through automatic resolution, we recommend migrating to explicit extensions for consistency and better compatibility.
0 commit comments