@octanejs/tanstack-start 0.1.52 → 0.2.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octanejs/tanstack-start",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "TanStack Start for Octane, including file-route generation, server functions, SSR streaming, hydration, and Vite or Rsbuild integration.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -117,10 +117,10 @@
|
|
|
117
117
|
"@babel/core": "7.29.7",
|
|
118
118
|
"@babel/template": "^7.27.2",
|
|
119
119
|
"@babel/types": "^7.28.5",
|
|
120
|
-
"@tanstack/router-core": "1.171.
|
|
120
|
+
"@tanstack/router-core": "1.171.34",
|
|
121
121
|
"@tanstack/router-utils": "1.162.2",
|
|
122
|
-
"@tanstack/start-client-core": "1.170.
|
|
123
|
-
"@tanstack/start-server-core": "1.169.
|
|
122
|
+
"@tanstack/start-client-core": "1.170.34",
|
|
123
|
+
"@tanstack/start-server-core": "1.169.39",
|
|
124
124
|
"@tanstack/virtual-file-routes": "1.162.0",
|
|
125
125
|
"chokidar": "^5.0.0",
|
|
126
126
|
"exsolve": "^1.0.7",
|
|
@@ -139,12 +139,12 @@
|
|
|
139
139
|
"vitefu": "^1.1.1",
|
|
140
140
|
"xmlbuilder2": "^4.0.3",
|
|
141
141
|
"zod": "^4.4.3",
|
|
142
|
-
"@octanejs/rspack-plugin": "0.1.
|
|
143
|
-
"@octanejs/tanstack-router": "0.1
|
|
142
|
+
"@octanejs/rspack-plugin": "0.1.57",
|
|
143
|
+
"@octanejs/tanstack-router": "0.2.1"
|
|
144
144
|
},
|
|
145
145
|
"peerDependencies": {
|
|
146
146
|
"@rsbuild/core": "^2.0.0",
|
|
147
|
-
"octane": "^0.
|
|
147
|
+
"octane": "^0.9.0",
|
|
148
148
|
"vite": ">=7.0.0"
|
|
149
149
|
},
|
|
150
150
|
"peerDependenciesMeta": {
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"@types/node": "^24.13.3",
|
|
161
161
|
"vite": "^8.1.5",
|
|
162
162
|
"vitest": "^4.1.10",
|
|
163
|
-
"octane": "0.
|
|
163
|
+
"octane": "0.9.0"
|
|
164
164
|
},
|
|
165
165
|
"scripts": {
|
|
166
166
|
"test": "cd ../.. && vitest run --project tanstack-start --project tanstack-start-rsbuild"
|
|
@@ -39,33 +39,24 @@ function handleRouteUpdate(routeId, newRoute, shouldApplyRouteUpdate = true) {
|
|
|
39
39
|
syncHotRouteExport(oldRoute);
|
|
40
40
|
router.resolvePathCache.clear();
|
|
41
41
|
const filter = (m) => m.routeId === oldRoute.id;
|
|
42
|
+
// router-core 1.171.34 keys stores by routeId (`byRoute`/`getMatchStore`) and
|
|
43
|
+
// dropped the pending/cached match pools, so HMR patches the active match only;
|
|
44
|
+
// a full reload still covers pending/cached matches.
|
|
42
45
|
const activeMatch = router.stores.matches.get().find(filter);
|
|
43
|
-
|
|
44
|
-
const cachedMatches = router.stores.cachedMatches.get().filter(filter);
|
|
45
|
-
if (activeMatch || pendingMatch || cachedMatches.length > 0) {
|
|
46
|
+
if (activeMatch) {
|
|
46
47
|
if (removedKeys.has('loader') || removedKeys.has('beforeLoad')) {
|
|
47
|
-
const matchIds = [
|
|
48
|
-
activeMatch?.id,
|
|
49
|
-
pendingMatch?.id,
|
|
50
|
-
...cachedMatches.map((match) => match.id),
|
|
51
|
-
].filter(Boolean);
|
|
52
48
|
router.batch(() => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
next.context = rebuildMatchContextWithoutBeforeLoad(next);
|
|
65
|
-
}
|
|
66
|
-
return next;
|
|
67
|
-
});
|
|
68
|
-
}
|
|
49
|
+
const store = router.stores.getMatchStore(activeMatch.routeId);
|
|
50
|
+
if (store)
|
|
51
|
+
store.set((prev) => {
|
|
52
|
+
const next = { ...prev };
|
|
53
|
+
if (removedKeys.has('loader')) next.loaderData = void 0;
|
|
54
|
+
if (removedKeys.has('beforeLoad')) {
|
|
55
|
+
next.__beforeLoadContext = void 0;
|
|
56
|
+
next.context = rebuildMatchContextWithoutBeforeLoad(next);
|
|
57
|
+
}
|
|
58
|
+
return next;
|
|
59
|
+
});
|
|
69
60
|
});
|
|
70
61
|
}
|
|
71
62
|
router.invalidate({
|
|
@@ -81,28 +72,15 @@ function handleRouteUpdate(routeId, newRoute, shouldApplyRouteUpdate = true) {
|
|
|
81
72
|
newRoute._fullPath = liveRoute._fullPath;
|
|
82
73
|
newRoute._to = liveRoute._to;
|
|
83
74
|
}
|
|
84
|
-
function getStoreMatch(
|
|
85
|
-
return (
|
|
86
|
-
router.stores.pendingMatchStores.get(matchId)?.get() ||
|
|
87
|
-
router.stores.matchStores.get(matchId)?.get() ||
|
|
88
|
-
router.stores.cachedMatchStores.get(matchId)?.get()
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
function getMatchList(matchId) {
|
|
92
|
-
const pendingMatches = router.stores.pendingMatches.get();
|
|
93
|
-
if (pendingMatches.some((match) => match.id === matchId)) return pendingMatches;
|
|
94
|
-
const activeMatches = router.stores.matches.get();
|
|
95
|
-
if (activeMatches.some((match) => match.id === matchId)) return activeMatches;
|
|
96
|
-
const cachedMatches = router.stores.cachedMatches.get();
|
|
97
|
-
if (cachedMatches.some((match) => match.id === matchId)) return cachedMatches;
|
|
98
|
-
return [];
|
|
75
|
+
function getStoreMatch(routeId) {
|
|
76
|
+
return router.stores.getMatchStore(routeId)?.get();
|
|
99
77
|
}
|
|
100
78
|
function getParentMatch(match) {
|
|
101
|
-
const
|
|
102
|
-
const matchIndex =
|
|
79
|
+
const matches = router.stores.matches.get();
|
|
80
|
+
const matchIndex = matches.findIndex((item) => item.routeId === match.routeId);
|
|
103
81
|
if (matchIndex <= 0) return;
|
|
104
|
-
const parentMatch =
|
|
105
|
-
return getStoreMatch(parentMatch.
|
|
82
|
+
const parentMatch = matches[matchIndex - 1];
|
|
83
|
+
return getStoreMatch(parentMatch.routeId) || parentMatch;
|
|
106
84
|
}
|
|
107
85
|
function rebuildMatchContextWithoutBeforeLoad(match) {
|
|
108
86
|
const parentMatch = getParentMatch(match);
|
|
@@ -7,7 +7,7 @@ import { hydrateStart as hydrateStartCore } from '@tanstack/start-client-core/cl
|
|
|
7
7
|
* document with an empty match tree.
|
|
8
8
|
*/
|
|
9
9
|
export function waitForRouterMatches(router) {
|
|
10
|
-
const matchesId = router.stores.
|
|
10
|
+
const matchesId = router.stores.ids;
|
|
11
11
|
if (matchesId.get().length > 0) return Promise.resolve();
|
|
12
12
|
|
|
13
13
|
return new Promise((resolve) => {
|