Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/ci-rsc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ jobs:
- name: install react
if: ${{ matrix.react_version }}
run: |
sed -i "/^overrides:/a\ react: \"$REACT_VERSION\"" pnpm-workspace.yaml
sed -i "/^overrides:/a\ react-dom: \"$REACT_VERSION\"" pnpm-workspace.yaml
sed -i "/^overrides:/a\ react-server-dom-webpack: \"$REACT_VERSION\"" pnpm-workspace.yaml
./scripts/override-react.sh "$REACT_VERSION"
pnpm i --no-frozen-lockfile
Comment on lines 68 to 72
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step now depends on ./scripts/override-react.sh, which requires yq, but the workflow never installs/pins yq. Relying on a preinstalled yq on GitHub-hosted runners is brittle (runner images can change) and can break scheduled canary/experimental runs. Consider adding an explicit install/pin step for the expected yq v4 binary on Linux before any yq usage (this also covers the later Vite override step).

Copilot uses AI. Check for mistakes.
env:
REACT_VERSION: ${{ matrix.react_version }}
Expand Down
7 changes: 7 additions & 0 deletions packages/plugin-rsc/e2e/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
expect,
test,
} from '@playwright/test'
import React from 'react'
import { x } from 'tinyexec'
import { normalizePath, type Rollup } from 'vite'
import { type Fixture, useCreateEditor, useFixture } from './fixture'
Expand Down Expand Up @@ -949,7 +950,7 @@
editor.edit((s) =>
s.replaceAll(`/* import './server.css' */`, `import './server2.css'`),
)
await expect(page.locator('.test-style-server')).toHaveCSS(

Check failure on line 953 in packages/plugin-rsc/e2e/basic.test.ts

View workflow job for this annotation

GitHub Actions / test-rsc (macos-latest / chromium)

[chromium] › e2e/basic.test.ts:926:5 › dev-default › adding/removing css server @js

1) [chromium] › e2e/basic.test.ts:926:5 › dev-default › adding/removing css server @js ─────────── Error: expect(locator).toHaveCSS(expected) failed Locator: locator('.test-style-server') Expected: "rgb(0, 255, 165)" Received: "rgb(0, 0, 0)" Timeout: 5000ms Call log: - Expect "toHaveCSS" with timeout 5000ms - waiting for locator('.test-style-server') 9 × locator resolved to <div class="test-style-server">test-style-server</div> - unexpected value "rgb(0, 0, 0)" 951 | s.replaceAll(`/* import './server.css' */`, `import './server2.css'`), 952 | ) > 953 | await expect(page.locator('.test-style-server')).toHaveCSS( | ^ 954 | 'color', 955 | 'rgb(0, 255, 165)', 956 | ) at /Users/runner/work/vite-plugin-react/vite-plugin-react/packages/plugin-rsc/e2e/basic.test.ts:953:58
'color',
'rgb(0, 255, 165)',
)
Expand Down Expand Up @@ -1072,7 +1073,7 @@
'rgb(0, 165, 255)',
)
editor.reset()
await expect(page.locator('.test-style-url-server')).toHaveCSS(

Check failure on line 1076 in packages/plugin-rsc/e2e/basic.test.ts

View workflow job for this annotation

GitHub Actions / test-rsc (ubuntu-latest / chromium) (vite-7)

[chromium] › e2e/basic.test.ts:1065:5 › dev-default › css url server hmr

1) [chromium] › e2e/basic.test.ts:1065:5 › dev-default › css url server hmr ────────────────────── Error: expect(locator).toHaveCSS(expected) failed Locator: locator('.test-style-url-server') Expected: "rgb(255, 165, 0)" Received: "rgb(0, 165, 255)" Timeout: 5000ms Call log: - Expect "toHaveCSS" with timeout 5000ms - waiting for locator('.test-style-url-server') 9 × locator resolved to <div class="test-style-url-server">test-style-url-server</div> - unexpected value "rgb(0, 165, 255)" 1074 | ) 1075 | editor.reset() > 1076 | await expect(page.locator('.test-style-url-server')).toHaveCSS( | ^ 1077 | 'color', 1078 | 'rgb(255, 165, 0)', 1079 | ) at /home/runner/work/vite-plugin-react/vite-plugin-react/packages/plugin-rsc/e2e/basic.test.ts:1076:60
'color',
'rgb(255, 165, 0)',
)
Expand Down Expand Up @@ -1277,6 +1278,12 @@
await expect(page.getByTestId('action-error-boundary')).toContainText(
'(Error: boom!)',
)
} else if (/canary|experimental/.test(React.version)) {
// this is now minified on main
// https://github.com/facebook/react/pull/36277
await expect(page.getByTestId('action-error-boundary')).toContainText(
'(Error: Minified React error #441',
)
} else {
await expect(page.getByTestId('action-error-boundary')).toContainText(
'(Error: An error occurred in the Server Components render.',
Expand Down
5 changes: 0 additions & 5 deletions packages/plugin-rsc/e2e/react-router.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { createHash } from 'node:crypto'
import { readFileSync } from 'node:fs'
import { expect, test } from '@playwright/test'
import React from 'react'
import { type Fixture, useFixture } from './fixture'
import { expectNoReload, testNoJs, waitForHydration } from './helper'

test.describe('dev-default', () => {
test.skip(/canary|experimental/.test(React.version))

const f = useFixture({ root: 'examples/react-router', mode: 'dev' })
defineTest(f)
})
Expand All @@ -18,8 +15,6 @@
})

test.describe('dev-cloudflare', () => {
test.skip(/canary|experimental/.test(React.version))

const f = useFixture({
root: 'examples/react-router',
mode: 'dev',
Expand Down Expand Up @@ -136,7 +131,7 @@
// client side navigation to "/about" keeps "/" styles
await page.getByRole('link', { name: 'About' }).click()
await page.waitForURL(f.url('./about'))
await expect(page.locator('.test-style-home')).toHaveCSS(

Check failure on line 134 in packages/plugin-rsc/e2e/react-router.test.ts

View workflow job for this annotation

GitHub Actions / test-rsc (ubuntu-latest / chromium) (react-canary)

[chromium] › e2e/react-router.test.ts:123:3 › dev-cloudflare › server css code split

1) [chromium] › e2e/react-router.test.ts:123:3 › dev-cloudflare › server css code split ────────── Error: expect(locator).toHaveCSS(expected) failed Locator: locator('.test-style-home') Expected: "rgb(250, 150, 0)" Timeout: 5000ms Error: element(s) not found Call log: - Expect "toHaveCSS" with timeout 5000ms - waiting for locator('.test-style-home') 132 | await page.getByRole('link', { name: 'About' }).click() 133 | await page.waitForURL(f.url('./about')) > 134 | await expect(page.locator('.test-style-home')).toHaveCSS( | ^ 135 | 'color', 136 | 'rgb(250, 150, 0)', 137 | ) at /home/runner/work/vite-plugin-react/vite-plugin-react/packages/plugin-rsc/e2e/react-router.test.ts:134:52
'color',
'rgb(250, 150, 0)',
)
Expand Down
22 changes: 22 additions & 0 deletions scripts/override-react.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail

if [[ $# -ne 1 ]]; then
echo "Usage: $0 <react-version>" >&2
exit 1
fi

if ! command -v yq >/dev/null 2>&1; then
echo "yq is required to update pnpm-workspace.yaml" >&2
exit 1
fi

Comment on lines +10 to +13
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script only checks that yq exists, but the expression syntax used here relies on mikefarah/yq v4. If a developer has a different yq implementation (e.g. the Python wrapper), this will fail with a confusing parse error. Consider validating yq --version is v4 (and improving the error message with install/version guidance).

Suggested change
echo "yq is required to update pnpm-workspace.yaml" >&2
exit 1
fi
echo "yq is required to update pnpm-workspace.yaml." >&2
echo "Please install mikefarah/yq v4: https://github.com/mikefarah/yq/" >&2
exit 1
fi
yq_version=$(yq --version 2>&1 || true)
if [[ ! $yq_version =~ version[[:space:]]+v?4\. ]]; then
echo "This script requires mikefarah/yq v4 to update pnpm-workspace.yaml." >&2
echo "Detected: $yq_version" >&2
echo "Please install mikefarah/yq v4 and verify with: yq --version" >&2
exit 1
fi

Copilot uses AI. Check for mistakes.
react_version=$1
script_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
repo_root=$(cd -- "$script_dir/.." && pwd)

yq -i "
.overrides.react = \"$react_version\" |
.overrides[\"react-dom\"] = \"$react_version\" |
.overrides[\"react-server-dom-webpack\"] = \"$react_version\"
" "$repo_root/pnpm-workspace.yaml"
Loading