Skip to content

Commit 3bdd69e

Browse files
chore: fix ssr in rr7.3
1 parent a529bc4 commit 3bdd69e

File tree

17 files changed

+369
-363
lines changed

17 files changed

+369
-363
lines changed

examples/cloudflare/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
"typecheck": "tsc -b"
1111
},
1212
"dependencies": {
13-
"@react-router/node": "^7.1.3",
14-
"@react-router/serve": "^7.1.3",
13+
"@react-router/node": "^7.3.0",
14+
"@react-router/serve": "^7.3.0",
1515
"isbot": "^5.1.17",
1616
"react": "^19.0.0",
1717
"react-dom": "^19.0.0",
18-
"react-router": "7.1.3"
18+
"react-router": "7.3.0"
1919
},
2020
"devDependencies": {
2121
"@cloudflare/workers-types": "^4.20241112.0",
22-
"@react-router/cloudflare": "^7.1.3",
23-
"@react-router/dev": "^7.1.3",
22+
"@react-router/cloudflare": "^7.3.0",
23+
"@react-router/dev": "^7.3.0",
2424
"@rsbuild/core": "^1.2.19",
2525
"@rsbuild/plugin-react": "^1.1.1",
2626
"@rsbuild/plugin-react-router": "workspace:*",

examples/custom-node-server/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@
1414
"author": "",
1515
"license": "ISC",
1616
"dependencies": {
17-
"@react-router/express": "^7.0.2",
18-
"@react-router/node": "^7.0.2",
17+
"@react-router/express": "^7.3.0",
18+
"@react-router/node": "^7.3.0",
1919
"express": "^4.21.2",
2020
"isbot": "^5.1.22",
2121
"react": "^19.0.0",
2222
"react-dom": "^19.0.0",
23-
"react-router": "7.0.2"
23+
"react-router": "7.3.0"
2424
},
2525
"devDependencies": {
26-
"@react-router/dev": "^7.0.2",
26+
"@react-router/dev": "^7.3.0",
2727
"@rsbuild/core": "^1.2.19",
2828
"@rsbuild/plugin-react": "^1.1.1",
2929
"@rsbuild/plugin-react-router": "workspace:*",

examples/default-template/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@
99
"typecheck": "react-router typegen && tsc"
1010
},
1111
"dependencies": {
12-
"@react-router/express": "^7.1.3",
13-
"@react-router/node": "^7.1.3",
14-
"@react-router/serve": "^7.1.3",
12+
"@react-router/express": "^7.3.0",
13+
"@react-router/node": "^7.3.0",
14+
"@react-router/serve": "^7.3.0",
1515
"isbot": "^5.1.17",
1616
"react": "^19.0.0",
1717
"react-dom": "^19.0.0",
18-
"react-router": "7.1.3"
18+
"react-router": "7.3.0"
1919
},
2020
"devDependencies": {
21-
"@react-router/dev": "^7.1.3",
21+
"@react-router/dev": "^7.3.0",
2222
"@rsbuild/core": "^1.2.19",
2323
"@rsbuild/plugin-react": "^1.1.1",
2424
"@rsbuild/plugin-react-router": "workspace:*",
2525
"@tailwindcss/postcss": "^4.0.0",
2626
"@types/node": "^20",
2727
"@types/react": "^19.0.1",
2828
"@types/react-dom": "^19.0.1",
29-
"react-router-devtools": "^1.1.0",
29+
"react-router-devtools": "^1.1.6",
3030
"tailwindcss": "^4.0.0",
3131
"typescript": "^5.7.2",
3232
"vite": "^5.4.11",

examples/epic-stack/package-lock.json

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/epic-stack/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@
6262
"@radix-ui/react-toast": "1.2.5",
6363
"@radix-ui/react-tooltip": "1.1.7",
6464
"@react-email/components": "0.0.32",
65-
"@react-router/express": "7.1.5",
66-
"@react-router/node": "7.1.5",
67-
"@react-router/remix-routes-option-adapter": "7.1.5",
65+
"@react-router/express": "7.3.0",
66+
"@react-router/node": "^7.3.0",
67+
"@react-router/remix-routes-option-adapter": "7.3.0",
6868
"@remix-run/server-runtime": "2.15.3",
6969
"@rsbuild/core": "1.2.19",
7070
"@rsbuild/plugin-react": "1.1.1",
@@ -101,7 +101,7 @@
101101
"qrcode": "1.5.4",
102102
"react": "19.0.0",
103103
"react-dom": "19.0.0",
104-
"react-router": "7.1.5",
104+
"react-router": "7.3.0",
105105
"remix-auth": "3.7.0",
106106
"remix-auth-github": "1.7.0",
107107
"remix-utils": "8.1.0",
@@ -120,7 +120,7 @@
120120
"@epic-web/config": "1.16.5",
121121
"@faker-js/faker": "9.4.0",
122122
"@playwright/test": "1.50.1",
123-
"@react-router/dev": "7.1.5",
123+
"@react-router/dev": "^7.3.0",
124124
"@sentry/vite-plugin": "3.1.2",
125125
"@sly-cli/sly": "1.14.0",
126126
"@testing-library/dom": "10.4.0",

examples/federation/epic-stack-remote/app/components/spacer.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ export function Spacer({
5252
'3xl': 'h-40',
5353
'4xl': 'h-44',
5454
}
55-
const className = options[size];
56-
console.log('SPACER');
55+
const className = options[size]
5756
return <div className={className} />
5857
}

examples/federation/epic-stack-remote/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "epic-stack",
2+
"name": "epic-stack-remote",
33
"private": true,
44
"license": "MIT",
55
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
@@ -65,9 +65,9 @@
6565
"@radix-ui/react-toast": "1.2.5",
6666
"@radix-ui/react-tooltip": "1.1.7",
6767
"@react-email/components": "0.0.32",
68-
"@react-router/express": "7.1.5",
69-
"@react-router/node": "7.1.5",
70-
"@react-router/remix-routes-option-adapter": "7.1.5",
68+
"@react-router/express": "7.3.0",
69+
"@react-router/node": "^7.3.0",
70+
"@react-router/remix-routes-option-adapter": "7.3.0",
7171
"@remix-run/server-runtime": "2.15.3",
7272
"@rsbuild/core": "1.2.19",
7373
"@rsbuild/plugin-react": "1.1.1",
@@ -104,7 +104,7 @@
104104
"qrcode": "1.5.4",
105105
"react": "19.0.0",
106106
"react-dom": "19.0.0",
107-
"react-router": "7.1.5",
107+
"react-router": "7.3.0",
108108
"remix-auth": "3.7.0",
109109
"remix-auth-github": "1.7.0",
110110
"remix-utils": "8.1.0",
@@ -122,7 +122,7 @@
122122
"@epic-web/config": "1.16.5",
123123
"@faker-js/faker": "9.4.0",
124124
"@playwright/test": "1.50.1",
125-
"@react-router/dev": "7.1.5",
125+
"@react-router/dev": "^7.3.0",
126126
"@sly-cli/sly": "1.14.0",
127127
"@testing-library/dom": "10.4.0",
128128
"@testing-library/jest-dom": "6.6.3",

examples/federation/epic-stack-remote/server/dev-build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ async function startServer() {
1313
throw new Error('Node environment not found in dev server')
1414
}
1515

16-
const bundle = await devServer.environments.node.loadBundle('app');
16+
const bundle = await devServer.environments.node.loadBundle('app')
1717
const { createApp } = bundle
1818
const app = await createApp(devServer)
1919

examples/federation/epic-stack-remote/server/index.ts

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import compression from 'compression'
88
import express, { type RequestHandler } from 'express'
99
import rateLimit from 'express-rate-limit'
1010
import getPort, { portNumbers } from 'get-port'
11-
// import helmet from 'helmet'
11+
import helmet from 'helmet'
1212
import morgan from 'morgan'
1313
import { type ServerBuild } from 'react-router'
1414

@@ -95,6 +95,7 @@ export async function createApp(devServer?: any) {
9595
// Everything else (like favicon.ico) is cached for an hour. You may want to be
9696
// more aggressive with this caching.
9797
app.use(express.static('build/client', { maxAge: '1h' }))
98+
app.use('/server', express.static('build/server', { maxAge: '1h' }))
9899
}
99100

100101
app.get(['/img/*', '/favicons/*'], ((
@@ -128,38 +129,38 @@ export async function createApp(devServer?: any) {
128129
next()
129130
})
130131

131-
// app.use(
132-
// helmet({
133-
// xPoweredBy: false,
134-
// referrerPolicy: { policy: 'same-origin' },
135-
// crossOriginEmbedderPolicy: false,
136-
// contentSecurityPolicy: {
137-
// // NOTE: Remove reportOnly when you're ready to enforce this CSP
138-
// reportOnly: true,
139-
// directives: {
140-
// 'connect-src': [
141-
// MODE === 'development' ? 'ws:' : null,
142-
// process.env.SENTRY_DSN ? '*.sentry.io' : null,
143-
// "'self'",
144-
// ].filter(Boolean),
145-
// 'font-src': ["'self'"],
146-
// 'frame-src': ["'self'"],
147-
// 'img-src': ["'self'", 'data:'],
148-
// 'script-src': [
149-
// "'strict-dynamic'",
150-
// "'self'",
151-
// // @ts-expect-error
152-
// (_, res) => `'nonce-${res.locals.cspNonce}'`,
153-
// ],
154-
// 'script-src-attr': [
155-
// // @ts-expect-error
156-
// (_, res) => `'nonce-${res.locals.cspNonce}'`,
157-
// ],
158-
// 'upgrade-insecure-requests': null,
159-
// },
160-
// },
161-
// }),
162-
// )
132+
app.use(
133+
helmet({
134+
xPoweredBy: false,
135+
referrerPolicy: { policy: 'same-origin' },
136+
crossOriginEmbedderPolicy: false,
137+
contentSecurityPolicy: {
138+
// NOTE: Remove reportOnly when you're ready to enforce this CSP
139+
reportOnly: true,
140+
directives: {
141+
'connect-src': [
142+
MODE === 'development' ? 'ws:' : null,
143+
process.env.SENTRY_DSN ? '*.sentry.io' : null,
144+
"'self'",
145+
].filter(Boolean),
146+
'font-src': ["'self'"],
147+
'frame-src': ["'self'"],
148+
'img-src': ["'self'", 'data:'],
149+
'script-src': [
150+
"'strict-dynamic'",
151+
"'self'",
152+
// @ts-expect-error
153+
(_, res) => `'nonce-${res.locals.cspNonce}'`,
154+
],
155+
'script-src-attr': [
156+
// @ts-expect-error
157+
(_, res) => `'nonce-${res.locals.cspNonce}'`,
158+
],
159+
'upgrade-insecure-requests': null,
160+
},
161+
},
162+
}),
163+
)
163164

164165
// When running tests or running in development, we want to effectively disable
165166
// rate limiting because playwright tests are very fast and we don't want to
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
LITEFS_DIR="/litefs/data"
2+
DATABASE_PATH="./prisma/data.db"
3+
DATABASE_URL="file:./data.db?connection_limit=1"
4+
CACHE_DATABASE_PATH="./other/cache.db"
5+
SESSION_SECRET="super-duper-s3cret"
6+
HONEYPOT_SECRET="super-duper-s3cret"
7+
RESEND_API_KEY="re_blAh_blaHBlaHblahBLAhBlAh"
8+
SENTRY_DSN="your-dsn"
9+
10+
# this is set to a random value in the Dockerfile
11+
INTERNAL_COMMAND_TOKEN="some-made-up-token"
12+
13+
# the mocks and some code rely on these two being prefixed with "MOCK_"
14+
# if they aren't then the real github api will be attempted
15+
GITHUB_CLIENT_ID="MOCK_GITHUB_CLIENT_ID"
16+
GITHUB_CLIENT_SECRET="MOCK_GITHUB_CLIENT_SECRET"
17+
GITHUB_TOKEN="MOCK_GITHUB_TOKEN"
18+
19+
# set this to false to prevent search engines from indexing the website
20+
# default to allow indexing for seo safety
21+
ALLOW_INDEXING="true"

0 commit comments

Comments
 (0)