@bleedingdev/modern-js-plugin-tanstack 3.2.0-ultramodern.102 → 3.2.0-ultramodern.104
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/cjs/cli/index.js +9 -5
- package/dist/cjs/cli/routeSplitting.js +14 -10
- package/dist/cjs/cli/tanstackTypes.js +9 -5
- package/dist/cjs/cli.js +12 -8
- package/dist/cjs/runtime/DefaultNotFound.js +9 -5
- package/dist/cjs/runtime/basepathRewrite.js +12 -8
- package/dist/cjs/runtime/dataMutation.js +9 -5
- package/dist/cjs/runtime/hooks.js +9 -5
- package/dist/cjs/runtime/hydrationBoundary.js +9 -5
- package/dist/cjs/runtime/index.js +9 -5
- package/dist/cjs/runtime/lifecycle.js +15 -11
- package/dist/cjs/runtime/outlet.js +10 -6
- package/dist/cjs/runtime/plugin.js +42 -41
- package/dist/cjs/runtime/plugin.node.js +10 -6
- package/dist/cjs/runtime/plugin.worker.js +9 -5
- package/dist/cjs/runtime/prefetchLink.js +10 -6
- package/dist/cjs/runtime/routeTree.js +9 -5
- package/dist/cjs/runtime/rsc/ClientSlot.js +9 -5
- package/dist/cjs/runtime/rsc/CompositeComponent.js +9 -5
- package/dist/cjs/runtime/rsc/ReplayableStream.js +14 -9
- package/dist/cjs/runtime/rsc/RscNodeRenderer.js +9 -5
- package/dist/cjs/runtime/rsc/SlotContext.js +9 -5
- package/dist/cjs/runtime/rsc/client.js +9 -5
- package/dist/cjs/runtime/rsc/createRscProxy.js +9 -5
- package/dist/cjs/runtime/rsc/index.js +9 -5
- package/dist/cjs/runtime/rsc/payloadRouter.js +9 -5
- package/dist/cjs/runtime/rsc/server.js +9 -5
- package/dist/cjs/runtime/rsc/slotUsageSanitizer.js +9 -5
- package/dist/cjs/runtime/rsc/symbols.js +20 -15
- package/dist/cjs/runtime/types.js +13 -9
- package/dist/cjs/runtime/utils.js +9 -5
- package/dist/cjs/runtime.js +9 -5
- package/dist/esm/runtime/outlet.mjs +1 -1
- package/dist/esm/runtime/plugin.mjs +33 -36
- package/dist/esm/runtime/plugin.node.mjs +1 -1
- package/dist/esm/runtime/prefetchLink.mjs +1 -1
- package/dist/esm-node/runtime/outlet.mjs +1 -1
- package/dist/esm-node/runtime/plugin.mjs +33 -36
- package/dist/esm-node/runtime/plugin.node.mjs +1 -1
- package/dist/esm-node/runtime/prefetchLink.mjs +1 -1
- package/dist/types/runtime/hooks.d.ts +9 -24
- package/package.json +9 -9
- package/src/runtime/outlet.tsx +13 -7
- package/src/runtime/plugin.node.tsx +2 -1
- package/src/runtime/plugin.tsx +62 -51
- package/src/runtime/prefetchLink.tsx +1 -1
- package/src/runtime/routeTree.ts +3 -3
- package/tests/router/prefetchLink.test.tsx +43 -7
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
|
@@ -23,10 +27,6 @@ var __webpack_require__ = {};
|
|
|
23
27
|
})();
|
|
24
28
|
var __webpack_exports__ = {};
|
|
25
29
|
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
REPLAYABLE_STREAM_MARKER: ()=>REPLAYABLE_STREAM_MARKER,
|
|
28
|
-
ReplayableStream: ()=>ReplayableStream
|
|
29
|
-
});
|
|
30
30
|
const REPLAYABLE_STREAM_MARKER = Symbol.for('modern.tanstack.rsc.ReplayableStream');
|
|
31
31
|
class ReplayableStream {
|
|
32
32
|
start() {
|
|
@@ -130,6 +130,11 @@ class ReplayableStream {
|
|
|
130
130
|
}
|
|
131
131
|
_REPLAYABLE_STREAM_MARKER = REPLAYABLE_STREAM_MARKER;
|
|
132
132
|
var _REPLAYABLE_STREAM_MARKER;
|
|
133
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
134
|
+
ReplayableStream: ()=>ReplayableStream
|
|
135
|
+
}, {
|
|
136
|
+
REPLAYABLE_STREAM_MARKER: REPLAYABLE_STREAM_MARKER
|
|
137
|
+
});
|
|
133
138
|
exports.REPLAYABLE_STREAM_MARKER = __webpack_exports__.REPLAYABLE_STREAM_MARKER;
|
|
134
139
|
exports.ReplayableStream = __webpack_exports__.ReplayableStream;
|
|
135
140
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
var __webpack_require__ = {};
|
|
4
4
|
(()=>{
|
|
5
|
-
__webpack_require__.d = (exports1,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
6
|
+
var define = (defs, kind)=>{
|
|
7
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
[kind]: defs[key]
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
define(getters, "get");
|
|
13
|
+
define(values, "value");
|
|
10
14
|
};
|
|
11
15
|
})();
|
|
12
16
|
(()=>{
|
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
var __webpack_require__ = {};
|
|
4
4
|
(()=>{
|
|
5
|
-
__webpack_require__.d = (exports1,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
6
|
+
var define = (defs, kind)=>{
|
|
7
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
[kind]: defs[key]
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
define(getters, "get");
|
|
13
|
+
define(values, "value");
|
|
10
14
|
};
|
|
11
15
|
})();
|
|
12
16
|
(()=>{
|
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
var __webpack_require__ = {};
|
|
4
4
|
(()=>{
|
|
5
|
-
__webpack_require__.d = (exports1,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
6
|
+
var define = (defs, kind)=>{
|
|
7
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
[kind]: defs[key]
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
define(getters, "get");
|
|
13
|
+
define(values, "value");
|
|
10
14
|
};
|
|
11
15
|
})();
|
|
12
16
|
(()=>{
|
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
var __webpack_require__ = {};
|
|
4
4
|
(()=>{
|
|
5
|
-
__webpack_require__.d = (exports1,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
6
|
+
var define = (defs, kind)=>{
|
|
7
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
[kind]: defs[key]
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
define(getters, "get");
|
|
13
|
+
define(values, "value");
|
|
10
14
|
};
|
|
11
15
|
})();
|
|
12
16
|
(()=>{
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
|
@@ -23,16 +27,6 @@ var __webpack_require__ = {};
|
|
|
23
27
|
})();
|
|
24
28
|
var __webpack_exports__ = {};
|
|
25
29
|
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
RENDERABLE_RSC: ()=>RENDERABLE_RSC,
|
|
28
|
-
RSC_PROXY_GET_TREE: ()=>RSC_PROXY_GET_TREE,
|
|
29
|
-
RSC_PROXY_PATH: ()=>RSC_PROXY_PATH,
|
|
30
|
-
RSC_SLOT_USAGES: ()=>RSC_SLOT_USAGES,
|
|
31
|
-
RSC_SLOT_USAGES_STREAM: ()=>RSC_SLOT_USAGES_STREAM,
|
|
32
|
-
SERVER_COMPONENT_STREAM: ()=>SERVER_COMPONENT_STREAM,
|
|
33
|
-
isRenderableServerComponent: ()=>isRenderableServerComponent,
|
|
34
|
-
isServerComponent: ()=>isServerComponent
|
|
35
|
-
});
|
|
36
30
|
const SERVER_COMPONENT_STREAM = Symbol.for('modern.tanstack.rsc.stream');
|
|
37
31
|
const RENDERABLE_RSC = Symbol.for('modern.tanstack.rsc.renderable');
|
|
38
32
|
const RSC_PROXY_GET_TREE = Symbol.for('modern.tanstack.rsc.proxy.getTree');
|
|
@@ -49,6 +43,17 @@ function isRenderableServerComponent(value) {
|
|
|
49
43
|
if ('object' != typeof value && 'function' != typeof value) return false;
|
|
50
44
|
return RENDERABLE_RSC in value && true === value[RENDERABLE_RSC];
|
|
51
45
|
}
|
|
46
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
47
|
+
isRenderableServerComponent: ()=>isRenderableServerComponent,
|
|
48
|
+
isServerComponent: ()=>isServerComponent
|
|
49
|
+
}, {
|
|
50
|
+
RENDERABLE_RSC: RENDERABLE_RSC,
|
|
51
|
+
RSC_PROXY_GET_TREE: RSC_PROXY_GET_TREE,
|
|
52
|
+
RSC_PROXY_PATH: RSC_PROXY_PATH,
|
|
53
|
+
RSC_SLOT_USAGES: RSC_SLOT_USAGES,
|
|
54
|
+
RSC_SLOT_USAGES_STREAM: RSC_SLOT_USAGES_STREAM,
|
|
55
|
+
SERVER_COMPONENT_STREAM: SERVER_COMPONENT_STREAM
|
|
56
|
+
});
|
|
52
57
|
exports.RENDERABLE_RSC = __webpack_exports__.RENDERABLE_RSC;
|
|
53
58
|
exports.RSC_PROXY_GET_TREE = __webpack_exports__.RSC_PROXY_GET_TREE;
|
|
54
59
|
exports.RSC_PROXY_PATH = __webpack_exports__.RSC_PROXY_PATH;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
|
@@ -23,16 +27,16 @@ var __webpack_require__ = {};
|
|
|
23
27
|
})();
|
|
24
28
|
var __webpack_exports__ = {};
|
|
25
29
|
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
getModernTanstackRouterFastDefaults: ()=>getModernTanstackRouterFastDefaults,
|
|
28
|
-
modernTanstackRouterFastDefaults: ()=>modernTanstackRouterFastDefaults
|
|
29
|
-
});
|
|
30
30
|
const modernTanstackRouterFastDefaults = {
|
|
31
31
|
defaultStructuralSharing: true
|
|
32
32
|
};
|
|
33
33
|
const getModernTanstackRouterFastDefaults = (config = {})=>({
|
|
34
34
|
defaultStructuralSharing: config.defaultStructuralSharing ?? modernTanstackRouterFastDefaults.defaultStructuralSharing
|
|
35
35
|
});
|
|
36
|
+
__webpack_require__.d(__webpack_exports__, {}, {
|
|
37
|
+
getModernTanstackRouterFastDefaults: getModernTanstackRouterFastDefaults,
|
|
38
|
+
modernTanstackRouterFastDefaults: modernTanstackRouterFastDefaults
|
|
39
|
+
});
|
|
36
40
|
exports.getModernTanstackRouterFastDefaults = __webpack_exports__.getModernTanstackRouterFastDefaults;
|
|
37
41
|
exports.modernTanstackRouterFastDefaults = __webpack_exports__.modernTanstackRouterFastDefaults;
|
|
38
42
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
@@ -10,11 +10,15 @@ var __webpack_require__ = {};
|
|
|
10
10
|
};
|
|
11
11
|
})();
|
|
12
12
|
(()=>{
|
|
13
|
-
__webpack_require__.d = (exports1,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
+
var define = (defs, kind)=>{
|
|
15
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
[kind]: defs[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
define(getters, "get");
|
|
21
|
+
define(values, "value");
|
|
18
22
|
};
|
|
19
23
|
})();
|
|
20
24
|
(()=>{
|
package/dist/cjs/runtime.js
CHANGED
|
@@ -24,11 +24,15 @@ function __webpack_require__(moduleId) {
|
|
|
24
24
|
};
|
|
25
25
|
})();
|
|
26
26
|
(()=>{
|
|
27
|
-
__webpack_require__.d = (exports1,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
28
|
+
var define = (defs, kind)=>{
|
|
29
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
[kind]: defs[key]
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
define(getters, "get");
|
|
35
|
+
define(values, "value");
|
|
32
36
|
};
|
|
33
37
|
})();
|
|
34
38
|
(()=>{
|
|
@@ -5,7 +5,7 @@ const outlet_Outlet = /*#__PURE__*/ memo(function() {
|
|
|
5
5
|
return /*#__PURE__*/ jsx(Outlet, {});
|
|
6
6
|
});
|
|
7
7
|
function withModernRouteMatchContext(component, _routeId) {
|
|
8
|
-
if (
|
|
8
|
+
if (null == component) return component;
|
|
9
9
|
const Component = component;
|
|
10
10
|
const WrappedRouteComponent = (props)=>/*#__PURE__*/ createElement(Component, props);
|
|
11
11
|
const preloadable = component;
|
|
@@ -62,49 +62,46 @@ function getCachedRouteModule(routeId) {
|
|
|
62
62
|
if ("u" < typeof window) return;
|
|
63
63
|
return window[routeModulesKey]?.[routeId];
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
function preloadHydratedRouteComponents(router) {
|
|
66
66
|
const preloadableRouter = router;
|
|
67
67
|
const routesById = preloadableRouter.routesById || {};
|
|
68
68
|
const matches = preloadableRouter.stores.matches.get();
|
|
69
|
-
|
|
70
|
-
if (
|
|
69
|
+
return Promise.all(matches.map((match)=>{
|
|
70
|
+
if (void 0 === match.routeId || '' === match.routeId) return;
|
|
71
71
|
const route = routesById[match.routeId];
|
|
72
72
|
const component = route?.options?.component;
|
|
73
73
|
const preload = component?.load || component?.preload;
|
|
74
74
|
if ('function' != typeof preload) return;
|
|
75
75
|
return Promise.resolve(preload.call(component)).then((routeModule)=>{
|
|
76
76
|
const modernRouteId = route?.options?.staticData?.modernRouteId;
|
|
77
|
-
const
|
|
78
|
-
|
|
77
|
+
const cachedRouteModule = 'string' == typeof modernRouteId && '' !== modernRouteId ? getCachedRouteModule(modernRouteId) : void 0;
|
|
78
|
+
const resolvedComponent = pickRouteModuleComponent(cachedRouteModule ?? routeModule);
|
|
79
|
+
if (void 0 !== resolvedComponent && 'string' == typeof modernRouteId && '' !== modernRouteId) route.options.component = withModernRouteMatchContext(resolvedComponent, modernRouteId);
|
|
79
80
|
});
|
|
80
|
-
}));
|
|
81
|
+
})).then(()=>void 0);
|
|
81
82
|
}
|
|
82
83
|
function getTanstackSsrHydrationRecord(router) {
|
|
83
|
-
|
|
84
|
-
if (
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
hydrationRecord.status = 'fulfilled';
|
|
96
|
-
return value;
|
|
97
|
-
}, (error)=>{
|
|
98
|
-
hydrationRecord.status = 'rejected';
|
|
99
|
-
hydrationRecord.error = error;
|
|
100
|
-
throw error;
|
|
101
|
-
});
|
|
102
|
-
} catch (error) {
|
|
84
|
+
const existingHydrationRecord = routerHydrationRecords.get(router);
|
|
85
|
+
if (void 0 !== existingHydrationRecord) return existingHydrationRecord;
|
|
86
|
+
const hydrationRecord = {
|
|
87
|
+
promise: Promise.resolve(),
|
|
88
|
+
status: 'pending'
|
|
89
|
+
};
|
|
90
|
+
routerHydrationRecords.set(router, hydrationRecord);
|
|
91
|
+
try {
|
|
92
|
+
hydrationRecord.promise = hydrate(router).then((value)=>preloadHydratedRouteComponents(router).then(()=>value)).then((value)=>{
|
|
93
|
+
hydrationRecord.status = 'fulfilled';
|
|
94
|
+
return value;
|
|
95
|
+
}, (error)=>{
|
|
103
96
|
hydrationRecord.status = 'rejected';
|
|
104
97
|
hydrationRecord.error = error;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
98
|
+
throw error;
|
|
99
|
+
});
|
|
100
|
+
} catch (error) {
|
|
101
|
+
hydrationRecord.status = 'rejected';
|
|
102
|
+
hydrationRecord.error = error;
|
|
103
|
+
hydrationRecord.promise = Promise.reject(error);
|
|
104
|
+
hydrationRecord.promise.catch(()=>{});
|
|
108
105
|
}
|
|
109
106
|
return hydrationRecord;
|
|
110
107
|
}
|
|
@@ -231,13 +228,13 @@ const tanstackRouterPlugin = (userConfig = {})=>{
|
|
|
231
228
|
});
|
|
232
229
|
return cachedRouter;
|
|
233
230
|
};
|
|
234
|
-
api.onBeforeRender(
|
|
231
|
+
api.onBeforeRender((context)=>{
|
|
235
232
|
const mergedConfig = getMergedConfig();
|
|
236
|
-
if ("u" > typeof window && window._SSR_DATA && mergedConfig.unstable_reloadOnURLMismatch) {
|
|
233
|
+
if ("u" > typeof window && void 0 !== window._SSR_DATA && mergedConfig.unstable_reloadOnURLMismatch) {
|
|
237
234
|
const { ssrContext } = context;
|
|
238
235
|
const currentPathname = normalizePathname(window.location.pathname);
|
|
239
|
-
const initialPathname = ssrContext?.request?.pathname
|
|
240
|
-
if (initialPathname && initialPathname !== currentPathname) {
|
|
236
|
+
const initialPathname = 'string' == typeof ssrContext?.request?.pathname ? normalizePathname(ssrContext.request.pathname) : void 0;
|
|
237
|
+
if (void 0 !== initialPathname && '' !== initialPathname && initialPathname !== currentPathname) {
|
|
241
238
|
const errorMsg = `The initial URL ${initialPathname} and the URL ${currentPathname} to be hydrated do not match, reload.`;
|
|
242
239
|
console.error(errorMsg);
|
|
243
240
|
window.location.reload();
|
|
@@ -251,14 +248,14 @@ const tanstackRouterPlugin = (userConfig = {})=>{
|
|
|
251
248
|
useRouter: useRouter
|
|
252
249
|
};
|
|
253
250
|
const hasSSRBootstrap = "u" > typeof window && Boolean(window.$_TSR);
|
|
254
|
-
if (hasSSRBootstrap && getRouteObjects().length) {
|
|
251
|
+
if (hasSSRBootstrap && getRouteObjects().length > 0) {
|
|
255
252
|
const runtimeContext = context;
|
|
256
253
|
const router = getRouter(runtimeContext, getClientBasename(runtimeContext));
|
|
257
|
-
if (router)
|
|
254
|
+
if (null != router) return getTanstackSsrHydrationPromise(router).then(()=>void 0);
|
|
258
255
|
}
|
|
259
256
|
});
|
|
260
257
|
api.wrapRoot((App)=>{
|
|
261
|
-
if (
|
|
258
|
+
if (0 === getRouteObjects().length) return App;
|
|
262
259
|
const RouterWrapper = ()=>{
|
|
263
260
|
const runtimeContext = useContext(InternalRuntimeContext);
|
|
264
261
|
const _basename = getClientBasename(runtimeContext);
|
|
@@ -28,7 +28,7 @@ function isPreloadableRouteComponent(component) {
|
|
|
28
28
|
return 'function' == typeof preloadable.load || 'function' == typeof preloadable.preload;
|
|
29
29
|
}
|
|
30
30
|
function isReactLazyRouteComponent(component) {
|
|
31
|
-
return
|
|
31
|
+
return null != component && 'object' == typeof component && 'function' == typeof component._init && '_payload' in component;
|
|
32
32
|
}
|
|
33
33
|
async function preloadReactLazyRouteComponent(component) {
|
|
34
34
|
try {
|
|
@@ -4,7 +4,7 @@ function resolvePreloadFromPrefetch(prefetch, preload) {
|
|
|
4
4
|
if (void 0 !== preload) return preload;
|
|
5
5
|
if ('none' === prefetch) return false;
|
|
6
6
|
if ('intent' === prefetch || 'render' === prefetch || 'viewport' === prefetch) return prefetch;
|
|
7
|
-
return
|
|
7
|
+
return 'viewport';
|
|
8
8
|
}
|
|
9
9
|
const LinkComponentImpl = (props)=>{
|
|
10
10
|
const { prefetch, preload, ...rest } = props;
|
|
@@ -6,7 +6,7 @@ const outlet_Outlet = /*#__PURE__*/ memo(function() {
|
|
|
6
6
|
return /*#__PURE__*/ jsx(Outlet, {});
|
|
7
7
|
});
|
|
8
8
|
function withModernRouteMatchContext(component, _routeId) {
|
|
9
|
-
if (
|
|
9
|
+
if (null == component) return component;
|
|
10
10
|
const Component = component;
|
|
11
11
|
const WrappedRouteComponent = (props)=>/*#__PURE__*/ createElement(Component, props);
|
|
12
12
|
const preloadable = component;
|
|
@@ -63,49 +63,46 @@ function getCachedRouteModule(routeId) {
|
|
|
63
63
|
if ("u" < typeof window) return;
|
|
64
64
|
return window[routeModulesKey]?.[routeId];
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
function preloadHydratedRouteComponents(router) {
|
|
67
67
|
const preloadableRouter = router;
|
|
68
68
|
const routesById = preloadableRouter.routesById || {};
|
|
69
69
|
const matches = preloadableRouter.stores.matches.get();
|
|
70
|
-
|
|
71
|
-
if (
|
|
70
|
+
return Promise.all(matches.map((match)=>{
|
|
71
|
+
if (void 0 === match.routeId || '' === match.routeId) return;
|
|
72
72
|
const route = routesById[match.routeId];
|
|
73
73
|
const component = route?.options?.component;
|
|
74
74
|
const preload = component?.load || component?.preload;
|
|
75
75
|
if ('function' != typeof preload) return;
|
|
76
76
|
return Promise.resolve(preload.call(component)).then((routeModule)=>{
|
|
77
77
|
const modernRouteId = route?.options?.staticData?.modernRouteId;
|
|
78
|
-
const
|
|
79
|
-
|
|
78
|
+
const cachedRouteModule = 'string' == typeof modernRouteId && '' !== modernRouteId ? getCachedRouteModule(modernRouteId) : void 0;
|
|
79
|
+
const resolvedComponent = pickRouteModuleComponent(cachedRouteModule ?? routeModule);
|
|
80
|
+
if (void 0 !== resolvedComponent && 'string' == typeof modernRouteId && '' !== modernRouteId) route.options.component = withModernRouteMatchContext(resolvedComponent, modernRouteId);
|
|
80
81
|
});
|
|
81
|
-
}));
|
|
82
|
+
})).then(()=>void 0);
|
|
82
83
|
}
|
|
83
84
|
function getTanstackSsrHydrationRecord(router) {
|
|
84
|
-
|
|
85
|
-
if (
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
hydrationRecord.status = 'fulfilled';
|
|
97
|
-
return value;
|
|
98
|
-
}, (error)=>{
|
|
99
|
-
hydrationRecord.status = 'rejected';
|
|
100
|
-
hydrationRecord.error = error;
|
|
101
|
-
throw error;
|
|
102
|
-
});
|
|
103
|
-
} catch (error) {
|
|
85
|
+
const existingHydrationRecord = routerHydrationRecords.get(router);
|
|
86
|
+
if (void 0 !== existingHydrationRecord) return existingHydrationRecord;
|
|
87
|
+
const hydrationRecord = {
|
|
88
|
+
promise: Promise.resolve(),
|
|
89
|
+
status: 'pending'
|
|
90
|
+
};
|
|
91
|
+
routerHydrationRecords.set(router, hydrationRecord);
|
|
92
|
+
try {
|
|
93
|
+
hydrationRecord.promise = hydrate(router).then((value)=>preloadHydratedRouteComponents(router).then(()=>value)).then((value)=>{
|
|
94
|
+
hydrationRecord.status = 'fulfilled';
|
|
95
|
+
return value;
|
|
96
|
+
}, (error)=>{
|
|
104
97
|
hydrationRecord.status = 'rejected';
|
|
105
98
|
hydrationRecord.error = error;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
99
|
+
throw error;
|
|
100
|
+
});
|
|
101
|
+
} catch (error) {
|
|
102
|
+
hydrationRecord.status = 'rejected';
|
|
103
|
+
hydrationRecord.error = error;
|
|
104
|
+
hydrationRecord.promise = Promise.reject(error);
|
|
105
|
+
hydrationRecord.promise.catch(()=>{});
|
|
109
106
|
}
|
|
110
107
|
return hydrationRecord;
|
|
111
108
|
}
|
|
@@ -232,13 +229,13 @@ const tanstackRouterPlugin = (userConfig = {})=>{
|
|
|
232
229
|
});
|
|
233
230
|
return cachedRouter;
|
|
234
231
|
};
|
|
235
|
-
api.onBeforeRender(
|
|
232
|
+
api.onBeforeRender((context)=>{
|
|
236
233
|
const mergedConfig = getMergedConfig();
|
|
237
|
-
if ("u" > typeof window && window._SSR_DATA && mergedConfig.unstable_reloadOnURLMismatch) {
|
|
234
|
+
if ("u" > typeof window && void 0 !== window._SSR_DATA && mergedConfig.unstable_reloadOnURLMismatch) {
|
|
238
235
|
const { ssrContext } = context;
|
|
239
236
|
const currentPathname = normalizePathname(window.location.pathname);
|
|
240
|
-
const initialPathname = ssrContext?.request?.pathname
|
|
241
|
-
if (initialPathname && initialPathname !== currentPathname) {
|
|
237
|
+
const initialPathname = 'string' == typeof ssrContext?.request?.pathname ? normalizePathname(ssrContext.request.pathname) : void 0;
|
|
238
|
+
if (void 0 !== initialPathname && '' !== initialPathname && initialPathname !== currentPathname) {
|
|
242
239
|
const errorMsg = `The initial URL ${initialPathname} and the URL ${currentPathname} to be hydrated do not match, reload.`;
|
|
243
240
|
console.error(errorMsg);
|
|
244
241
|
window.location.reload();
|
|
@@ -252,14 +249,14 @@ const tanstackRouterPlugin = (userConfig = {})=>{
|
|
|
252
249
|
useRouter: useRouter
|
|
253
250
|
};
|
|
254
251
|
const hasSSRBootstrap = "u" > typeof window && Boolean(window.$_TSR);
|
|
255
|
-
if (hasSSRBootstrap && getRouteObjects().length) {
|
|
252
|
+
if (hasSSRBootstrap && getRouteObjects().length > 0) {
|
|
256
253
|
const runtimeContext = context;
|
|
257
254
|
const router = getRouter(runtimeContext, getClientBasename(runtimeContext));
|
|
258
|
-
if (router)
|
|
255
|
+
if (null != router) return getTanstackSsrHydrationPromise(router).then(()=>void 0);
|
|
259
256
|
}
|
|
260
257
|
});
|
|
261
258
|
api.wrapRoot((App)=>{
|
|
262
|
-
if (
|
|
259
|
+
if (0 === getRouteObjects().length) return App;
|
|
263
260
|
const RouterWrapper = ()=>{
|
|
264
261
|
const runtimeContext = useContext(InternalRuntimeContext);
|
|
265
262
|
const _basename = getClientBasename(runtimeContext);
|
|
@@ -29,7 +29,7 @@ function isPreloadableRouteComponent(component) {
|
|
|
29
29
|
return 'function' == typeof preloadable.load || 'function' == typeof preloadable.preload;
|
|
30
30
|
}
|
|
31
31
|
function isReactLazyRouteComponent(component) {
|
|
32
|
-
return
|
|
32
|
+
return null != component && 'object' == typeof component && 'function' == typeof component._init && '_payload' in component;
|
|
33
33
|
}
|
|
34
34
|
async function preloadReactLazyRouteComponent(component) {
|
|
35
35
|
try {
|