diff --git a/contributors.yml b/contributors.yml index a603914de0..7cab60befb 100644 --- a/contributors.yml +++ b/contributors.yml @@ -132,6 +132,7 @@ - hampelm - harshmangalam - hernanif1 +- hi-ogawa - HK-SHAO - holynewbie - hongji00 diff --git a/integration/helpers/rsc-vite/package.json b/integration/helpers/rsc-vite/package.json index 43b3e09d18..12413185f1 100644 --- a/integration/helpers/rsc-vite/package.json +++ b/integration/helpers/rsc-vite/package.json @@ -9,7 +9,7 @@ "typecheck": "tsc" }, "devDependencies": { - "@hiogawa/vite-rsc": "0.4.1", + "@hiogawa/vite-rsc": "0.4.2", "@types/express": "^5.0.0", "@types/node": "^22.13.1", "@types/react": "^19.1.8", diff --git a/playground/rsc-vite/package.json b/playground/rsc-vite/package.json index f8aeca055c..aef4b95daa 100644 --- a/playground/rsc-vite/package.json +++ b/playground/rsc-vite/package.json @@ -9,7 +9,7 @@ "typecheck": "tsc" }, "devDependencies": { - "@hiogawa/vite-rsc": "0.4.1", + "@hiogawa/vite-rsc": "0.4.2", "@types/express": "^5.0.0", "@types/node": "^22.13.1", "@types/react": "^19.1.8", diff --git a/playground/rsc-vite/src/routes/home/home.client.css b/playground/rsc-vite/src/routes/home/home.client.css new file mode 100644 index 0000000000..9498c5c2ad --- /dev/null +++ b/playground/rsc-vite/src/routes/home/home.client.css @@ -0,0 +1,4 @@ +.client-box { + border: 1px solid black; + padding: 5px; +} diff --git a/playground/rsc-vite/src/routes/home/home.client.tsx b/playground/rsc-vite/src/routes/home/home.client.tsx index 308982b883..9f1ea77653 100644 --- a/playground/rsc-vite/src/routes/home/home.client.tsx +++ b/playground/rsc-vite/src/routes/home/home.client.tsx @@ -4,6 +4,7 @@ import * as React from "react"; import { type ClientLoaderFunctionArgs, useLoaderData } from "react-router"; import { Counter } from "../../counter"; +import "./home.client.css"; import type { loader } from "./home"; @@ -34,7 +35,7 @@ export function HomeForm({ fn }: { fn: () => unknown }) { const [state, formAction, isPending] = React.useActionState(fn, null); return ( -
+ diff --git a/playground/rsc-vite/src/routes/root/root.css b/playground/rsc-vite/src/routes/root/root.css new file mode 100644 index 0000000000..f43a09cd0c --- /dev/null +++ b/playground/rsc-vite/src/routes/root/root.css @@ -0,0 +1,4 @@ +.server-box { + border: 1px solid black; + padding: 10px; +} diff --git a/playground/rsc-vite/src/routes/root/root.tsx b/playground/rsc-vite/src/routes/root/root.tsx index 2387832d3e..af07cd1a21 100644 --- a/playground/rsc-vite/src/routes/root/root.tsx +++ b/playground/rsc-vite/src/routes/root/root.tsx @@ -3,6 +3,7 @@ import { type unstable_MiddlewareFunction } from "react-router/rsc"; import { Counter } from "../../counter"; import { ErrorReporter, NavigationState } from "./root.client"; +import "./root.css" export { shouldRevalidate } from "./root.client"; @@ -63,9 +64,10 @@ export function Layout({ children }: { children: React.ReactNode }) { React Server + {import.meta.viteRsc.loadCss()} -
+
Home {" | "} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d636988dfa..8a4ac656f4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -547,8 +547,8 @@ importers: version: link:../../../packages/react-router devDependencies: '@hiogawa/vite-rsc': - specifier: 0.4.1 - version: 0.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(lightningcss@1.30.1)(tsx@4.19.3)(yaml@2.6.0)) + specifier: 0.4.2 + version: 0.4.2(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(lightningcss@1.30.1)(tsx@4.19.3)(yaml@2.6.0)) '@types/express': specifier: ^5.0.0 version: 5.0.1 @@ -1852,8 +1852,8 @@ importers: version: link:../../packages/react-router devDependencies: '@hiogawa/vite-rsc': - specifier: 0.4.1 - version: 0.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(lightningcss@1.30.1)(tsx@4.19.3)(yaml@2.6.0)) + specifier: 0.4.2 + version: 0.4.2(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(lightningcss@1.30.1)(tsx@4.19.3)(yaml@2.6.0)) '@types/express': specifier: ^5.0.0 version: 5.0.1 @@ -3451,8 +3451,8 @@ packages: '@hiogawa/transforms@0.1.1': resolution: {integrity: sha512-NAJ38s8lMMSDv7HOupWt1w5EJ8poMOWPd+JCmmfHg8sdWgFCjCGHnaDi5pTGEBxYLzso9K2urfyK2rW6HORsHw==} - '@hiogawa/vite-rsc@0.4.1': - resolution: {integrity: sha512-GQ19F8q004E7wjCL/RARhblPXx6W2SC+hdVc8xw85xPy22iU0Ft67jJtY1gI7k3jqoPWrBNaUjgmemJIZRoazw==} + '@hiogawa/vite-rsc@0.4.2': + resolution: {integrity: sha512-MKHX7B6mqcynBJp9MQQLgMipOavvYIfyhasjZGcJqeMhB8kmGo6QHfRxZheiDo1jGjWHyMsHR1ayHIuMcrK+2w==} peerDependencies: react: '*' react-dom: '*' @@ -11801,7 +11801,7 @@ snapshots: magic-string: 0.30.17 periscopic: 4.0.2 - '@hiogawa/vite-rsc@0.4.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(lightningcss@1.30.1)(tsx@4.19.3)(yaml@2.6.0))': + '@hiogawa/vite-rsc@0.4.2(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(vite@6.2.5(@types/node@22.14.0)(jiti@2.4.2)(lightningcss@1.30.1)(tsx@4.19.3)(yaml@2.6.0))': dependencies: '@hiogawa/transforms': 0.1.1 '@mjackson/node-fetch-server': 0.6.1