@react-router/serve 7.10.1 → 7.11.0-pre.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -2
- package/dist/cli.js +10 -7
- package/package.json +10 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# `@react-router/serve`
|
|
2
2
|
|
|
3
|
+
## 7.11.0-pre.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- support custom entrypoints for RSC framework mode ([#14643](https://github.com/remix-run/react-router/pull/14643))
|
|
8
|
+
- Update `compression` and `morgan` dependencies to address `on-headers` CVE: [GHSA-76c9-3jph-rj3q](https://github.com/advisories/GHSA-76c9-3jph-rj3q) ([#14652](https://github.com/remix-run/react-router/pull/14652))
|
|
9
|
+
- Updated dependencies:
|
|
10
|
+
- `react-router@7.11.0-pre.0`
|
|
11
|
+
- `@react-router/node@7.11.0-pre.0`
|
|
12
|
+
- `@react-router/express@7.11.0-pre.0`
|
|
13
|
+
|
|
3
14
|
## 7.10.1
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -690,12 +701,10 @@
|
|
|
690
701
|
- Introduces the `defer()` API from `@remix-run/router` with support for server-rendering and HTTP streaming. This utility allows you to defer values returned from `loader` functions by returning promises instead of resolved values. This has been refered to as _"sending a promise over the wire"_. ([#4920](https://github.com/remix-run/remix/pull/4920))
|
|
691
702
|
|
|
692
703
|
Informational Resources:
|
|
693
|
-
|
|
694
704
|
- <https://gist.github.com/jacob-ebey/9bde9546c1aafaa6bc8c242054b1be26>
|
|
695
705
|
- <https://github.com/remix-run/remix/blob/main/decisions/0004-streaming-apis.md>
|
|
696
706
|
|
|
697
707
|
Documentation Resources (better docs specific to Remix are in the works):
|
|
698
|
-
|
|
699
708
|
- <https://reactrouter.com/en/main/utils/defer>
|
|
700
709
|
- <https://reactrouter.com/en/main/components/await>
|
|
701
710
|
- <https://reactrouter.com/en/main/hooks/use-async-value>
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* @react-router/serve v7.
|
|
3
|
+
* @react-router/serve v7.11.0-pre.0
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) Remix Software Inc.
|
|
6
6
|
*
|
|
@@ -64,7 +64,9 @@ import_source_map_support.default.install({
|
|
|
64
64
|
});
|
|
65
65
|
run();
|
|
66
66
|
function isRSCServerBuild(build) {
|
|
67
|
-
return
|
|
67
|
+
return Boolean(
|
|
68
|
+
typeof build === "object" && build && "default" in build && typeof build.default === "object" && build.default && "fetch" in build.default && typeof build.default.fetch === "function"
|
|
69
|
+
);
|
|
68
70
|
}
|
|
69
71
|
function parseNumber(raw) {
|
|
70
72
|
if (raw === void 0) return void 0;
|
|
@@ -83,14 +85,15 @@ async function run() {
|
|
|
83
85
|
let buildPath = import_node_path.default.resolve(buildPathArg);
|
|
84
86
|
let buildModule = await import(import_node_url.default.pathToFileURL(buildPath).href);
|
|
85
87
|
let build;
|
|
86
|
-
|
|
88
|
+
let isRSCBuild = false;
|
|
89
|
+
if (isRSCBuild = isRSCServerBuild(buildModule)) {
|
|
87
90
|
const config = {
|
|
88
91
|
publicPath: "/",
|
|
89
92
|
assetsBuildDirectory: "../client",
|
|
90
93
|
...buildModule.unstable_reactRouterServeConfig || {}
|
|
91
94
|
};
|
|
92
95
|
build = {
|
|
93
|
-
fetch: buildModule.default,
|
|
96
|
+
fetch: buildModule.default.fetch,
|
|
94
97
|
publicPath: config.publicPath,
|
|
95
98
|
assetsBuildDirectory: import_node_path.default.resolve(
|
|
96
99
|
import_node_path.default.dirname(buildPath),
|
|
@@ -112,7 +115,7 @@ async function run() {
|
|
|
112
115
|
};
|
|
113
116
|
let app = (0, import_express2.default)();
|
|
114
117
|
app.disable("x-powered-by");
|
|
115
|
-
if (!
|
|
118
|
+
if (!isRSCBuild) {
|
|
116
119
|
app.use((0, import_compression.default)());
|
|
117
120
|
}
|
|
118
121
|
app.use(
|
|
@@ -125,13 +128,13 @@ async function run() {
|
|
|
125
128
|
app.use(build.publicPath, import_express2.default.static(build.assetsBuildDirectory));
|
|
126
129
|
app.use(import_express2.default.static("public", { maxAge: "1h" }));
|
|
127
130
|
app.use((0, import_morgan.default)("tiny"));
|
|
128
|
-
if (
|
|
131
|
+
if (build.fetch) {
|
|
129
132
|
app.all("*", (0, import_node_fetch_server.createRequestListener)(build.fetch));
|
|
130
133
|
} else {
|
|
131
134
|
app.all(
|
|
132
135
|
"*",
|
|
133
136
|
(0, import_express.createRequestHandler)({
|
|
134
|
-
build,
|
|
137
|
+
build: buildModule,
|
|
135
138
|
mode: process.env.NODE_ENV
|
|
136
139
|
})
|
|
137
140
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-router/serve",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.11.0-pre.0",
|
|
4
4
|
"description": "Production application server for React Router",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/remix-run/react-router/issues"
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"build": {
|
|
22
22
|
"command": "tsup",
|
|
23
23
|
"files": [
|
|
24
|
+
"../../pnpm-workspace.yaml",
|
|
24
25
|
"*.ts",
|
|
25
26
|
"bin.js",
|
|
26
27
|
"tsconfig.json",
|
|
@@ -33,24 +34,24 @@
|
|
|
33
34
|
},
|
|
34
35
|
"dependencies": {
|
|
35
36
|
"@mjackson/node-fetch-server": "^0.2.0",
|
|
36
|
-
"compression": "^1.
|
|
37
|
+
"compression": "^1.8.1",
|
|
37
38
|
"express": "^4.19.2",
|
|
38
39
|
"get-port": "5.1.1",
|
|
39
|
-
"morgan": "^1.10.
|
|
40
|
+
"morgan": "^1.10.1",
|
|
40
41
|
"source-map-support": "^0.5.21",
|
|
41
|
-
"@react-router/express": "7.
|
|
42
|
-
"@react-router/node": "7.
|
|
42
|
+
"@react-router/express": "7.11.0-pre.0",
|
|
43
|
+
"@react-router/node": "7.11.0-pre.0"
|
|
43
44
|
},
|
|
44
45
|
"peerDependencies": {
|
|
45
|
-
"react-router": "7.
|
|
46
|
+
"react-router": "7.11.0-pre.0"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
|
-
"@types/compression": "^1.
|
|
49
|
+
"@types/compression": "^1.8.1",
|
|
49
50
|
"@types/express": "^4.17.9",
|
|
50
|
-
"@types/morgan": "^1.9.
|
|
51
|
+
"@types/morgan": "^1.9.10",
|
|
51
52
|
"@types/source-map-support": "^0.5.6",
|
|
52
53
|
"tsup": "^8.3.0",
|
|
53
|
-
"typescript": "^5.
|
|
54
|
+
"typescript": "^5.4.5",
|
|
54
55
|
"wireit": "0.14.9"
|
|
55
56
|
},
|
|
56
57
|
"engines": {
|