Skip to content
Draft
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
22 changes: 20 additions & 2 deletions packages/plugin-rsc/e2e/basic.test.ts
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't remember much about the context of this test, but it looks like tailwind forces reloading on unuded.tsx changes seems reasonable. This looks like independent from SSR framework issue of tailwind, so let's adjust the test case here:

Original file line number Diff line number Diff line change
Expand Up @@ -1237,14 +1237,32 @@ function defineTest(f: Fixture) {
logs.push(msg.text())
}
})
f.createEditor('src/routes/tailwind/unused.tsx').resave()
await page.waitForTimeout(200)
f.createEditor('src/routes/tailwind/server.tsx').resave()
await expect
.poll(() => logs)
.toEqual([
expect.stringMatching(/\[vite-rsc:update\].*\/tailwind\/server.tsx/),
])
await page.waitForTimeout(200)
expect(logs).toEqual([
expect.stringMatching(/\[vite-rsc:update\].*\/tailwind\/server.tsx/),
])
})

// https://github.com/tailwindlabs/tailwindcss/pull/19745
test('tailwind force reloads on file changes outside of module graph', async ({
page,
}) => {
await page.goto(f.url())
await waitForHydration(page)
const reloaded = page.waitForEvent('framenavigated', {
predicate: (frame) =>
frame === page.mainFrame() && frame.url().startsWith(f.url()),
})
f.createEditor('src/routes/tailwind/unused.tsx').resave()
await reloaded
await waitForHydration(page)
})
})

test('temporary references @js', async ({ page }) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-rsc/examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"react-dom": "^19.2.4"
},
"devDependencies": {
"@tailwindcss/vite": "^4.2.1",
"@tailwindcss/vite": "file:../../../../tailwindcss-vite-4.2.1.tgz",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "latest",
Expand All @@ -30,7 +30,7 @@
"@vitejs/test-dep-transitive-cjs": "file:./test-dep/transitive-cjs",
"@vitejs/test-dep-transitive-use-sync-external-store": "file:./test-dep/transitive-use-sync-external-store",
"rsc-html-stream": "^0.0.7",
"tailwindcss": "^4.2.1",
"tailwindcss": "file:../../../../tailwindcss-4.2.1.tgz",
"vite": "^8.0.0-beta.16",
"wrangler": "^4.67.0"
},
Expand Down
20 changes: 10 additions & 10 deletions packages/plugin-rsc/examples/basic/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ export default defineConfig({
plugins: [
// import("vite-plugin-inspect").then(m => m.default()),
tailwindcss(),
{
// TODO: quick workaround for https://github.com/tailwindlabs/tailwindcss/pull/19670
name: 'fix-tailwind-full-reload',
configResolved(config) {
const plugin = config.plugins.find(
(p) => p.name === '@tailwindcss/vite:generate:serve',
)
delete plugin?.hotUpdate
},
},
// {
// // TODO: quick workaround for https://github.com/tailwindlabs/tailwindcss/pull/19670
// name: 'fix-tailwind-full-reload',
// configResolved(config) {
// const plugin = config.plugins.find(
// (p) => p.name === '@tailwindcss/vite:generate:serve',
// )
// delete plugin?.hotUpdate
// },
// },
react(),
vitePluginUseCache(),
vitePluginVirtualModuleTest(),
Expand Down
20 changes: 10 additions & 10 deletions packages/plugin-rsc/examples/react-router/cf/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ export default defineConfig({
plugins: [
// import("vite-plugin-inspect").then(m => m.default()),
tailwindcss(),
{
// TODO: quick workaround for https://github.com/tailwindlabs/tailwindcss/pull/19670
name: 'fix-tailwind-full-reload',
configResolved(config) {
const plugin = config.plugins.find(
(p) => p.name === '@tailwindcss/vite:generate:serve',
)
delete plugin?.hotUpdate
},
},
// {
// // TODO: quick workaround for https://github.com/tailwindlabs/tailwindcss/pull/19670
// name: 'fix-tailwind-full-reload',
// configResolved(config) {
// const plugin = config.plugins.find(
// (p) => p.name === '@tailwindcss/vite:generate:serve',
// )
// delete plugin?.hotUpdate
// },
// },
react(),
rsc({
entries: {
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-rsc/examples/react-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
"devDependencies": {
"@cloudflare/vite-plugin": "^1.25.2",
"@tailwindcss/typography": "^0.5.19",
"@tailwindcss/vite": "^4.2.1",
"@tailwindcss/vite": "file:../../../../tailwindcss-vite-4.2.1.tgz",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "latest",
"@vitejs/plugin-rsc": "latest",
"tailwindcss": "^4.2.1",
"tailwindcss": "file:../../../../tailwindcss-4.2.1.tgz",
"vite": "^8.0.0-beta.16",
"wrangler": "^4.67.0"
}
Expand Down
20 changes: 10 additions & 10 deletions packages/plugin-rsc/examples/react-router/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ export default defineConfig({
plugins: [
// import("vite-plugin-inspect").then(m => m.default()),
tailwindcss(),
{
// TODO: quick workaround for https://github.com/tailwindlabs/tailwindcss/pull/19670
name: 'fix-tailwind-full-reload',
configResolved(config) {
const plugin = config.plugins.find(
(p) => p.name === '@tailwindcss/vite:generate:serve',
)
delete plugin?.hotUpdate
},
},
// {
// // TODO: quick workaround for https://github.com/tailwindlabs/tailwindcss/pull/19670
// name: 'fix-tailwind-full-reload',
// configResolved(config) {
// const plugin = config.plugins.find(
// (p) => p.name === '@tailwindcss/vite:generate:serve',
// )
// delete plugin?.hotUpdate
// },
// },
react(),
rsc({
entries: {
Expand Down
36 changes: 22 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added tailwindcss-4.2.1.tgz
Binary file not shown.
Binary file added tailwindcss-vite-4.2.1.tgz
Binary file not shown.
Loading