Skip to content

chore(rsc): update vite-rsc and add css example #13823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 18, 2025
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
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
- hampelm
- harshmangalam
- hernanif1
- hi-ogawa
- HK-SHAO
- holynewbie
- hongji00
Expand Down
2 changes: 1 addition & 1 deletion integration/helpers/rsc-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion playground/rsc-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions playground/rsc-vite/src/routes/home/home.client.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.client-box {
border: 1px solid black;
padding: 5px;
}
3 changes: 2 additions & 1 deletion playground/rsc-vite/src/routes/home/home.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -34,7 +35,7 @@ export function HomeForm({ fn }: { fn: () => unknown }) {
const [state, formAction, isPending] = React.useActionState(fn, null);

return (
<form action={formAction}>
<form action={formAction} className="client-box">
<button type="submit">
Log on server{isPending ? " (pending)" : null}
</button>
Expand Down
4 changes: 4 additions & 0 deletions playground/rsc-vite/src/routes/root/root.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.server-box {
border: 1px solid black;
padding: 10px;
}
4 changes: 3 additions & 1 deletion playground/rsc-vite/src/routes/root/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -63,9 +64,10 @@ export function Layout({ children }: { children: React.ReactNode }) {
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>React Server</title>
<Links />
{import.meta.viteRsc.loadCss()}
</head>
<body>
<div style={{ border: "1px solid black", padding: "10px" }}>
<div className="server-box">
<header>
<Link to="/">Home</Link>
{" | "}
Expand Down
14 changes: 7 additions & 7 deletions pnpm-lock.yaml

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