Skip to content

Commit

Permalink
Merge branch 'jeppe/react-prerelease-sandboxes' of github.com:storybo…
Browse files Browse the repository at this point in the history
…okjs/storybook into jeppe/temp-gen-react-prerelease-sandboxes
  • Loading branch information
JReinhold committed Apr 26, 2024
2 parents f2d2caa + e244830 commit 03bae80
Show file tree
Hide file tree
Showing 17 changed files with 56 additions and 52 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Expand Up @@ -768,30 +768,30 @@ workflows:
requires:
- build
- create-sandboxes:
parallelism: 35
parallelism: 37
requires:
- build
# - smoke-test-sandboxes: # disabled for now
# requires:
# - create-sandboxes
- build-sandboxes:
parallelism: 35
parallelism: 37
requires:
- create-sandboxes
- chromatic-sandboxes:
parallelism: 32
parallelism: 34
requires:
- build-sandboxes
- e2e-production:
parallelism: 30
parallelism: 32
requires:
- build-sandboxes
- e2e-dev:
parallelism: 2
requires:
- create-sandboxes
- test-runner-production:
parallelism: 30
parallelism: 32
requires:
- build-sandboxes
- test-portable-stories:
Expand Down
Expand Up @@ -44,6 +44,8 @@ export default {
docs: {
name: 'ResolvedReact',
},
// the version string changes with every release of React/Next.js/Preact, not worth snapshotting
chromat: { disable: true },
},
};

Expand Down
2 changes: 1 addition & 1 deletion code/addons/links/package.json
Expand Up @@ -82,7 +82,7 @@
"typescript": "^5.3.2"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta"
},
"peerDependenciesMeta": {
"react": {
Expand Down
2 changes: 1 addition & 1 deletion code/e2e-tests/addon-docs.spec.ts
Expand Up @@ -67,7 +67,7 @@ test.describe('addon-docs', () => {
await new Promise(resolve => resolve('Play function'));
}
}`;
await expect(sourceCode.textContent()).resolves.toContain(expectedSource);
await expect(sourceCode).toHaveText(expectedSource);
});

test('should render errors', async ({ page }) => {
Expand Down
2 changes: 1 addition & 1 deletion code/e2e-tests/framework-svelte.spec.ts
Expand Up @@ -41,7 +41,7 @@ test.describe('Svelte', () => {
await showCodeButton.click();
const sourceCode = root.locator('pre.prismjs');
const expectedSource = '<ButtonJavaScript primary/>';
await expect(sourceCode.textContent()).resolves.toContain(expectedSource);
await expect(sourceCode).toHaveText(expectedSource);
});

test('Decorators runs only once', async ({ page }) => {
Expand Down
4 changes: 2 additions & 2 deletions code/frameworks/nextjs/package.json
Expand Up @@ -133,8 +133,8 @@
},
"peerDependencies": {
"next": "^13.5.0 || ^14.0.0",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
"webpack": "^5.0.0"
},
"peerDependenciesMeta": {
Expand Down
4 changes: 2 additions & 2 deletions code/frameworks/react-vite/package.json
Expand Up @@ -64,8 +64,8 @@
"vite": "^4.0.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
"vite": "^4.0.0 || ^5.0.0"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions code/frameworks/react-webpack5/package.json
Expand Up @@ -53,8 +53,8 @@
"@types/node": "^18.0.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
"typescript": ">= 4.2.x"
},
"peerDependenciesMeta": {
Expand Down
8 changes: 5 additions & 3 deletions code/lib/cli/src/sandbox-templates.ts
Expand Up @@ -204,13 +204,13 @@ const baseTemplates = {
'react-vite/prerelease-ts': {
name: 'React Prerelease (Vite | TypeScript)',
script:
'npm create vite --yes {{beforeDir}} -- --template react-ts && cd {{beforeDir}} && yarn add react@next react-dom@next',
'npm create vite --yes {{beforeDir}} -- --template react-ts && cd {{beforeDir}} && yarn add react@beta react-dom@beta',
expected: {
framework: '@storybook/react-vite',
renderer: '@storybook/react',
builder: '@storybook/builder-vite',
},
skipTasks: ['bench'],
skipTasks: ['e2e-tests-dev', 'bench'],
},
'react-webpack/18-ts': {
name: 'React Latest (Webpack | TypeScript)',
Expand All @@ -236,7 +236,7 @@ const baseTemplates = {
'react-webpack/prerelease-ts': {
name: 'React Prerelease (Webpack | TypeScript)',
script:
'yarn create webpack5-react {{beforeDir}} --version-react="next" --version-react-dom="next"',
'yarn create webpack5-react {{beforeDir}} --version-react="beta" --version-react-dom="beta"',
expected: {
framework: '@storybook/react-webpack5',
renderer: '@storybook/react',
Expand Down Expand Up @@ -650,6 +650,8 @@ export const daily: TemplateKey[] = [
'angular-cli/prerelease',
'cra/default-js',
'react-vite/default-js',
'react-vite/prerelease-ts',
'react-webpack/prerelease-ts',
'vue3-vite/default-js',
'vue-cli/default-js',
'lit-vite/default-js',
Expand Down
4 changes: 2 additions & 2 deletions code/lib/react-dom-shim/package.json
Expand Up @@ -58,8 +58,8 @@
"typescript": "^5.3.2"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta"
},
"publishConfig": {
"access": "public"
Expand Down
8 changes: 4 additions & 4 deletions code/lib/react-dom-shim/src/preset.ts
Expand Up @@ -6,7 +6,7 @@ import { readFile } from 'fs/promises';
* Get react-dom version from the resolvedReact preset, which points to either
* a root react-dom dependency or the react-dom dependency shipped with addon-docs
*/
const getIsReactVersion18 = async (options: Options) => {
const getIsReactVersion18or19 = async (options: Options) => {
const { legacyRootApi } =
(await options.presets.apply<{ legacyRootApi?: boolean } | null>('frameworkOptions')) || {};

Expand All @@ -24,11 +24,11 @@ const getIsReactVersion18 = async (options: Options) => {
}

const { version } = JSON.parse(await readFile(join(reactDom, 'package.json'), 'utf-8'));
return version.startsWith('18') || version.startsWith('0.0.0');
return version.startsWith('18') || version.startsWith('19') || version.startsWith('0.0.0');
};

export const webpackFinal = async (config: any, options: Options) => {
const isReactVersion18 = await getIsReactVersion18(options);
const isReactVersion18 = await getIsReactVersion18or19(options);
if (isReactVersion18) {
return config;
}
Expand All @@ -46,7 +46,7 @@ export const webpackFinal = async (config: any, options: Options) => {
};

export const viteFinal = async (config: any, options: Options) => {
const isReactVersion18 = await getIsReactVersion18(options);
const isReactVersion18 = await getIsReactVersion18or19(options);
if (isReactVersion18) {
return config;
}
Expand Down
4 changes: 2 additions & 2 deletions code/lib/theming/package.json
Expand Up @@ -68,8 +68,8 @@
"typescript": "^5.3.2"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta"
},
"peerDependenciesMeta": {
"react": {
Expand Down
4 changes: 2 additions & 2 deletions code/presets/react-webpack/package.json
Expand Up @@ -84,8 +84,8 @@
"typescript": "^5.3.2"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta"
},
"peerDependenciesMeta": {
"typescript": {
Expand Down
4 changes: 2 additions & 2 deletions code/renderers/react/package.json
Expand Up @@ -86,8 +86,8 @@
"require-from-string": "^2.0.2"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
"typescript": ">= 4.2.x"
},
"peerDependenciesMeta": {
Expand Down
4 changes: 2 additions & 2 deletions code/ui/blocks/package.json
Expand Up @@ -75,8 +75,8 @@
"@types/color-convert": "^2.0.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta"
},
"peerDependenciesMeta": {
"react": {
Expand Down
4 changes: 2 additions & 2 deletions code/ui/components/package.json
Expand Up @@ -86,8 +86,8 @@
"use-resize-observer": "^9.1.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta"
},
"publishConfig": {
"access": "public"
Expand Down
38 changes: 19 additions & 19 deletions code/yarn.lock
Expand Up @@ -5150,7 +5150,7 @@ __metadata:
ts-dedent: "npm:^2.0.0"
typescript: "npm:^5.3.2"
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
peerDependenciesMeta:
react:
optional: true
Expand Down Expand Up @@ -5431,8 +5431,8 @@ __metadata:
ts-dedent: "npm:^2.0.0"
util-deprecate: "npm:^1.0.2"
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
peerDependenciesMeta:
react:
optional: true
Expand Down Expand Up @@ -5695,8 +5695,8 @@ __metadata:
use-resize-observer: "npm:^9.1.0"
util-deprecate: "npm:^1.0.2"
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -6185,8 +6185,8 @@ __metadata:
webpack: "npm:^5.65.0"
peerDependencies:
next: ^13.5.0 || ^14.0.0
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
webpack: ^5.0.0
dependenciesMeta:
sharp:
Expand Down Expand Up @@ -6322,8 +6322,8 @@ __metadata:
typescript: "npm:^5.3.2"
webpack: "npm:5"
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
peerDependenciesMeta:
typescript:
optional: true
Expand Down Expand Up @@ -6449,8 +6449,8 @@ __metadata:
"@storybook/types": "workspace:*"
typescript: "npm:^5.3.2"
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
languageName: unknown
linkType: soft

Expand All @@ -6472,8 +6472,8 @@ __metadata:
typescript: "npm:^5.3.2"
vite: "npm:^4.0.0"
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
vite: ^4.0.0 || ^5.0.0
languageName: unknown
linkType: soft
Expand All @@ -6487,8 +6487,8 @@ __metadata:
"@storybook/react": "workspace:*"
"@types/node": "npm:^18.0.0"
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
typescript: ">= 4.2.x"
peerDependenciesMeta:
typescript:
Expand Down Expand Up @@ -6529,8 +6529,8 @@ __metadata:
type-fest: "npm:~2.19"
util-deprecate: "npm:^1.0.2"
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
typescript: ">= 4.2.x"
peerDependenciesMeta:
typescript:
Expand Down Expand Up @@ -6915,8 +6915,8 @@ __metadata:
ts-dedent: "npm:^2.0.0"
typescript: "npm:^5.3.2"
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
peerDependenciesMeta:
react:
optional: true
Expand Down

0 comments on commit 03bae80

Please sign in to comment.