Skip to content

Commit 689944f

Browse files
authored
Merge pull request #34051 from storybookjs/version-patch-from-10.2.16
Release: Patch 10.2.17
2 parents 8a7f39a + 6797eb4 commit 689944f

4 files changed

Lines changed: 24 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 10.2.17
2+
3+
- Next.js: Add support for v16.2 - [#34046](https://github.com/storybookjs/storybook/pull/34046), thanks @valentinpalkovic!
4+
15
## 10.2.16
26

37
- CSF-Factories: Fix ConfigFile parser false warning on `definePreview({...}).type<T>()` export default - [#33885](https://github.com/storybookjs/storybook/pull/33885), thanks @copilot-swe-agent!

code/frameworks/nextjs/src/swc/loader.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { getVirtualModules } from '@storybook/builder-webpack5';
77

88
import type { NextConfig } from 'next';
99
import nextJSLoadConfigModule from 'next/dist/build/load-jsconfig.js';
10-
import { getSupportedBrowsers } from 'next/dist/build/utils.js';
1110
import type { Configuration as WebpackConfig } from 'webpack';
1211

1312
import { getNodeModulesExcludeRegex } from '../utils';
@@ -51,10 +50,26 @@ export const configureSWCLoader = async (
5150
hasReactRefresh: isDevelopment,
5251
jsConfig,
5352
nextConfig,
54-
supportedBrowsers: getSupportedBrowsers(projectRoot, isDevelopment),
53+
supportedBrowsers: await getSupportedBrowsers(projectRoot, isDevelopment),
5554
swcCacheDir: join(projectRoot, nextConfig?.distDir ?? '.next', 'cache', 'swc'),
5655
bundleTarget: 'default',
5756
},
5857
},
5958
});
6059
};
60+
61+
async function getSupportedBrowsers(projectRoot: string, isDevelopment: boolean) {
62+
try {
63+
// @ts-expect-error - Correct import since Next.js v16.2
64+
return (await import('next/dist/build/get-supported-browsers.js')).getSupportedBrowsers(
65+
projectRoot,
66+
isDevelopment
67+
);
68+
} catch (e) {
69+
// TODO: Remove as soon as we don't have to support Next.js < 16.2 anymore
70+
return (await import('next/dist/build/utils.js')).getSupportedBrowsers(
71+
projectRoot,
72+
isDevelopment
73+
);
74+
}
75+
}

code/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,5 +220,6 @@
220220
"Dependency Upgrades"
221221
]
222222
]
223-
}
223+
},
224+
"deferredNextVersion": "10.2.17"
224225
}

docs/versions/latest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"10.2.16","info":{"plain":"- CSF-Factories: Fix ConfigFile parser false warning on `definePreview({...}).type<T>()` export default - [#33885](https://github.com/storybookjs/storybook/pull/33885), thanks @copilot-swe-agent!\n- Core: Add host/origin validation to requests and websocket connections - [#33835](https://github.com/storybookjs/storybook/pull/33835), thanks @ghengeveld!\n- Core: Add vike metadata frameworks - [#33965](https://github.com/storybookjs/storybook/pull/33965), thanks @yannbf!\n- Core: Resolve builder preset path correctly in pnpm strict mode - [#34032](https://github.com/storybookjs/storybook/pull/34032), thanks @braedenfoster!\n- Core: Update default allowed hosts in host validation middleware - [#34045](https://github.com/storybookjs/storybook/pull/34045), thanks @ghengeveld!"}}
1+
{"version":"10.2.17","info":{"plain":"- Next.js: Add support for v16.2 - [#34046](https://github.com/storybookjs/storybook/pull/34046), thanks @valentinpalkovic!"}}

0 commit comments

Comments
 (0)