@tanstack/react-start 1.167.41 → 1.167.43
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/dist/esm/plugin/rsbuild.d.ts +7 -0
- package/dist/esm/plugin/rsbuild.js +53 -0
- package/dist/esm/plugin/rsbuild.js.map +1 -0
- package/dist/esm/plugin/shared.js +1 -1
- package/dist/esm/plugin/vite.js +1 -1
- package/dist/esm/rsbuild/browser-decode.d.ts +1 -0
- package/dist/esm/rsbuild/browser-decode.js +1 -0
- package/dist/esm/rsbuild/ssr-decode.d.ts +1 -0
- package/dist/esm/rsbuild/ssr-decode.js +1 -0
- package/package.json +30 -7
- package/src/plugin/rsbuild.ts +66 -0
- package/src/rsbuild/browser-decode.ts +1 -0
- package/src/rsbuild/ssr-decode.ts +1 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TanStackStartRsbuildInputConfig } from '@tanstack/start-plugin-core';
|
|
2
|
+
import { RsbuildPlugin } from '@rsbuild/core';
|
|
3
|
+
export declare function tanstackStart(options?: TanStackStartRsbuildInputConfig & {
|
|
4
|
+
rsc?: {
|
|
5
|
+
enabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
}): RsbuildPlugin;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { reactStartDefaultEntryPaths } from "./shared.js";
|
|
2
|
+
import { START_ENVIRONMENT_NAMES, tanStackStartRsbuild } from "@tanstack/start-plugin-core";
|
|
3
|
+
//#region src/plugin/rsbuild.ts
|
|
4
|
+
function tanstackStart(options) {
|
|
5
|
+
const rscEnabled = options?.rsc?.enabled ?? false;
|
|
6
|
+
let corePluginOpts = {
|
|
7
|
+
framework: "react",
|
|
8
|
+
defaultEntryPaths: reactStartDefaultEntryPaths,
|
|
9
|
+
providerEnvironmentName: START_ENVIRONMENT_NAMES.server,
|
|
10
|
+
ssrIsProvider: true
|
|
11
|
+
};
|
|
12
|
+
if (rscEnabled) {
|
|
13
|
+
const rscConfig = configureRscRsbuild();
|
|
14
|
+
corePluginOpts = {
|
|
15
|
+
...corePluginOpts,
|
|
16
|
+
providerEnvironmentName: rscConfig.providerEnvironmentName,
|
|
17
|
+
ssrIsProvider: false,
|
|
18
|
+
serializationAdapters: rscConfig.serializationAdapters,
|
|
19
|
+
rsc: true
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
return tanStackStartRsbuild(corePluginOpts, options);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Configure RSC options for the rsbuild adapter.
|
|
26
|
+
*
|
|
27
|
+
* Returns provider env, serialization adapters, and core RSC options.
|
|
28
|
+
*
|
|
29
|
+
* The SSR resolver strategy is intentionally NOT changed from 'default' —
|
|
30
|
+
* in the rspack layered model, SSR and RSC live in the same
|
|
31
|
+
* compilation so they share the same resolver file. No forwarding needed.
|
|
32
|
+
*/
|
|
33
|
+
function configureRscRsbuild() {
|
|
34
|
+
return {
|
|
35
|
+
providerEnvironmentName: START_ENVIRONMENT_NAMES.server,
|
|
36
|
+
serializationAdapters: [{
|
|
37
|
+
client: {
|
|
38
|
+
module: "@tanstack/react-start/rsc/serialization/client",
|
|
39
|
+
export: "rscSerializationAdapter",
|
|
40
|
+
isFactory: true
|
|
41
|
+
},
|
|
42
|
+
server: {
|
|
43
|
+
module: "@tanstack/react-start/rsc/serialization/server",
|
|
44
|
+
export: "rscSerializationAdapter",
|
|
45
|
+
isFactory: true
|
|
46
|
+
}
|
|
47
|
+
}]
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
export { tanstackStart };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=rsbuild.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rsbuild.js","names":[],"sources":["../../../src/plugin/rsbuild.ts"],"sourcesContent":["import {\n START_ENVIRONMENT_NAMES,\n tanStackStartRsbuild,\n} from '@tanstack/start-plugin-core'\nimport { reactStartDefaultEntryPaths } from './shared'\nimport type { TanStackStartRsbuildPluginCoreOptions } from '@tanstack/start-plugin-core/rsbuild/types'\nimport type { TanStackStartRsbuildInputConfig } from '@tanstack/start-plugin-core'\nimport type { RsbuildPlugin } from '@rsbuild/core'\n\nexport function tanstackStart(\n options?: TanStackStartRsbuildInputConfig & { rsc?: { enabled?: boolean } },\n): RsbuildPlugin {\n const rscEnabled = options?.rsc?.enabled ?? false\n\n let corePluginOpts: TanStackStartRsbuildPluginCoreOptions = {\n framework: 'react',\n defaultEntryPaths: reactStartDefaultEntryPaths,\n providerEnvironmentName: START_ENVIRONMENT_NAMES.server,\n ssrIsProvider: true,\n }\n\n if (rscEnabled) {\n const rscConfig = configureRscRsbuild()\n corePluginOpts = {\n ...corePluginOpts,\n providerEnvironmentName: rscConfig.providerEnvironmentName,\n ssrIsProvider: false,\n serializationAdapters: rscConfig.serializationAdapters,\n rsc: true,\n }\n }\n\n return tanStackStartRsbuild(corePluginOpts, options)\n}\n\n/**\n * Configure RSC options for the rsbuild adapter.\n *\n * Returns provider env, serialization adapters, and core RSC options.\n *\n * The SSR resolver strategy is intentionally NOT changed from 'default' —\n * in the rspack layered model, SSR and RSC live in the same\n * compilation so they share the same resolver file. No forwarding needed.\n */\nfunction configureRscRsbuild(): {\n providerEnvironmentName: TanStackStartRsbuildPluginCoreOptions['providerEnvironmentName']\n serializationAdapters: TanStackStartRsbuildPluginCoreOptions['serializationAdapters']\n} {\n return {\n providerEnvironmentName: START_ENVIRONMENT_NAMES.server,\n serializationAdapters: [\n {\n client: {\n module: '@tanstack/react-start/rsc/serialization/client',\n export: 'rscSerializationAdapter',\n isFactory: true,\n },\n server: {\n module: '@tanstack/react-start/rsc/serialization/server',\n export: 'rscSerializationAdapter',\n isFactory: true,\n },\n },\n ],\n }\n}\n"],"mappings":";;;AASA,SAAgB,cACd,SACe;CACf,MAAM,aAAa,SAAS,KAAK,WAAW;CAE5C,IAAI,iBAAwD;EAC1D,WAAW;EACX,mBAAmB;EACnB,yBAAyB,wBAAwB;EACjD,eAAe;EAChB;AAED,KAAI,YAAY;EACd,MAAM,YAAY,qBAAqB;AACvC,mBAAiB;GACf,GAAG;GACH,yBAAyB,UAAU;GACnC,eAAe;GACf,uBAAuB,UAAU;GACjC,KAAK;GACN;;AAGH,QAAO,qBAAqB,gBAAgB,QAAQ;;;;;;;;;;;AAYtD,SAAS,sBAGP;AACA,QAAO;EACL,yBAAyB,wBAAwB;EACjD,uBAAuB,CACrB;GACE,QAAQ;IACN,QAAQ;IACR,QAAQ;IACR,WAAW;IACZ;GACD,QAAQ;IACN,QAAQ;IACR,QAAQ;IACR,WAAW;IACZ;GACF,CACF;EACF"}
|
package/dist/esm/plugin/vite.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { reactStartDefaultEntryPaths, reactStartPluginDir } from "./shared.js";
|
|
2
2
|
import { START_ENVIRONMENT_NAMES, tanStackStartVite } from "@tanstack/start-plugin-core";
|
|
3
|
-
import { configureRsc, reactStartRscVitePlugin } from "@tanstack/react-start-rsc/plugin/vite";
|
|
4
3
|
import path from "pathe";
|
|
4
|
+
import { configureRsc, reactStartRscVitePlugin } from "@tanstack/react-start-rsc/plugin/vite";
|
|
5
5
|
//#region src/plugin/vite.ts
|
|
6
6
|
var isInsideRouterMonoRepo = path.basename(path.resolve(reactStartPluginDir, "../../../../")) === "packages";
|
|
7
7
|
function tanstackStart(options) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tanstack/react-start-rsc/rsbuild/browser-decode';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@tanstack/react-start-rsc/rsbuild/browser-decode";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tanstack/react-start-rsc/rsbuild/ssr-decode';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@tanstack/react-start-rsc/rsbuild/ssr-decode";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/react-start",
|
|
3
|
-
"version": "1.167.
|
|
3
|
+
"version": "1.167.43",
|
|
4
4
|
"description": "Modern and scalable routing for React applications",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -76,6 +76,12 @@
|
|
|
76
76
|
"default": "./dist/esm/plugin/vite.js"
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
|
+
"./plugin/rsbuild": {
|
|
80
|
+
"import": {
|
|
81
|
+
"types": "./dist/esm/plugin/rsbuild.d.ts",
|
|
82
|
+
"default": "./dist/esm/plugin/rsbuild.js"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
79
85
|
"./server-entry": {
|
|
80
86
|
"import": {
|
|
81
87
|
"types": "./dist/default-entry/esm/server.d.ts",
|
|
@@ -104,6 +110,18 @@
|
|
|
104
110
|
"default": "./dist/esm/rsc/serialization/client.js"
|
|
105
111
|
}
|
|
106
112
|
},
|
|
113
|
+
"./rsbuild/browser-decode": {
|
|
114
|
+
"import": {
|
|
115
|
+
"types": "./dist/esm/rsbuild/browser-decode.d.ts",
|
|
116
|
+
"default": "./dist/esm/rsbuild/browser-decode.js"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"./rsbuild/ssr-decode": {
|
|
120
|
+
"import": {
|
|
121
|
+
"types": "./dist/esm/rsbuild/ssr-decode.d.ts",
|
|
122
|
+
"default": "./dist/esm/rsbuild/ssr-decode.js"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
107
125
|
"./server-only": {
|
|
108
126
|
"import": {
|
|
109
127
|
"types": "./dist/esm/server-only.d.ts",
|
|
@@ -131,26 +149,31 @@
|
|
|
131
149
|
},
|
|
132
150
|
"dependencies": {
|
|
133
151
|
"pathe": "^2.0.3",
|
|
134
|
-
"@tanstack/react-
|
|
135
|
-
"@tanstack/react-start-
|
|
136
|
-
"@tanstack/react-start-
|
|
137
|
-
"@tanstack/
|
|
138
|
-
"@tanstack/
|
|
139
|
-
"@tanstack/react-router": "1.168.22",
|
|
152
|
+
"@tanstack/react-router": "1.168.23",
|
|
153
|
+
"@tanstack/react-start-client": "1.166.40",
|
|
154
|
+
"@tanstack/react-start-rsc": "0.0.22",
|
|
155
|
+
"@tanstack/react-start-server": "1.166.41",
|
|
156
|
+
"@tanstack/router-utils": "1.161.7",
|
|
140
157
|
"@tanstack/start-client-core": "1.167.17",
|
|
158
|
+
"@tanstack/start-plugin-core": "1.168.0",
|
|
141
159
|
"@tanstack/start-server-core": "1.167.19"
|
|
142
160
|
},
|
|
143
161
|
"peerDependencies": {
|
|
162
|
+
"@rsbuild/core": "^2.0.0",
|
|
144
163
|
"react": ">=18.0.0 || >=19.0.0",
|
|
145
164
|
"react-dom": ">=18.0.0 || >=19.0.0",
|
|
146
165
|
"vite": ">=7.0.0"
|
|
147
166
|
},
|
|
148
167
|
"peerDependenciesMeta": {
|
|
168
|
+
"@rsbuild/core": {
|
|
169
|
+
"optional": true
|
|
170
|
+
},
|
|
149
171
|
"@vitejs/plugin-rsc": {
|
|
150
172
|
"optional": true
|
|
151
173
|
}
|
|
152
174
|
},
|
|
153
175
|
"devDependencies": {
|
|
176
|
+
"@rsbuild/core": "^2.0.0",
|
|
154
177
|
"@tanstack/intent": "^0.0.14",
|
|
155
178
|
"@types/node": ">=20"
|
|
156
179
|
},
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import {
|
|
2
|
+
START_ENVIRONMENT_NAMES,
|
|
3
|
+
tanStackStartRsbuild,
|
|
4
|
+
} from '@tanstack/start-plugin-core'
|
|
5
|
+
import { reactStartDefaultEntryPaths } from './shared'
|
|
6
|
+
import type { TanStackStartRsbuildPluginCoreOptions } from '@tanstack/start-plugin-core/rsbuild/types'
|
|
7
|
+
import type { TanStackStartRsbuildInputConfig } from '@tanstack/start-plugin-core'
|
|
8
|
+
import type { RsbuildPlugin } from '@rsbuild/core'
|
|
9
|
+
|
|
10
|
+
export function tanstackStart(
|
|
11
|
+
options?: TanStackStartRsbuildInputConfig & { rsc?: { enabled?: boolean } },
|
|
12
|
+
): RsbuildPlugin {
|
|
13
|
+
const rscEnabled = options?.rsc?.enabled ?? false
|
|
14
|
+
|
|
15
|
+
let corePluginOpts: TanStackStartRsbuildPluginCoreOptions = {
|
|
16
|
+
framework: 'react',
|
|
17
|
+
defaultEntryPaths: reactStartDefaultEntryPaths,
|
|
18
|
+
providerEnvironmentName: START_ENVIRONMENT_NAMES.server,
|
|
19
|
+
ssrIsProvider: true,
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (rscEnabled) {
|
|
23
|
+
const rscConfig = configureRscRsbuild()
|
|
24
|
+
corePluginOpts = {
|
|
25
|
+
...corePluginOpts,
|
|
26
|
+
providerEnvironmentName: rscConfig.providerEnvironmentName,
|
|
27
|
+
ssrIsProvider: false,
|
|
28
|
+
serializationAdapters: rscConfig.serializationAdapters,
|
|
29
|
+
rsc: true,
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return tanStackStartRsbuild(corePluginOpts, options)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Configure RSC options for the rsbuild adapter.
|
|
38
|
+
*
|
|
39
|
+
* Returns provider env, serialization adapters, and core RSC options.
|
|
40
|
+
*
|
|
41
|
+
* The SSR resolver strategy is intentionally NOT changed from 'default' —
|
|
42
|
+
* in the rspack layered model, SSR and RSC live in the same
|
|
43
|
+
* compilation so they share the same resolver file. No forwarding needed.
|
|
44
|
+
*/
|
|
45
|
+
function configureRscRsbuild(): {
|
|
46
|
+
providerEnvironmentName: TanStackStartRsbuildPluginCoreOptions['providerEnvironmentName']
|
|
47
|
+
serializationAdapters: TanStackStartRsbuildPluginCoreOptions['serializationAdapters']
|
|
48
|
+
} {
|
|
49
|
+
return {
|
|
50
|
+
providerEnvironmentName: START_ENVIRONMENT_NAMES.server,
|
|
51
|
+
serializationAdapters: [
|
|
52
|
+
{
|
|
53
|
+
client: {
|
|
54
|
+
module: '@tanstack/react-start/rsc/serialization/client',
|
|
55
|
+
export: 'rscSerializationAdapter',
|
|
56
|
+
isFactory: true,
|
|
57
|
+
},
|
|
58
|
+
server: {
|
|
59
|
+
module: '@tanstack/react-start/rsc/serialization/server',
|
|
60
|
+
export: 'rscSerializationAdapter',
|
|
61
|
+
isFactory: true,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tanstack/react-start-rsc/rsbuild/browser-decode'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tanstack/react-start-rsc/rsbuild/ssr-decode'
|