@bleedingdev/modern-js-renderer-solid 3.9.3-ultramodern.8 → 3.9.3-ultramodern.9
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/actions.js +2 -2
- package/dist/esm/application-router.js +7 -2
- package/dist/esm/entry-client.js +1 -0
- package/dist/esm/federation-ssr.js +17 -9
- package/dist/esm/federation.js +8 -4
- package/dist/esm/i18n/LocalizedLink.js +28 -50
- package/dist/esm/i18n/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/route-completion.js +2 -1
- package/dist/esm/router-binding/Asset.js +3 -2
- package/dist/esm/router-binding/Matches.js +19 -12
- package/dist/esm/router-binding/PROVENANCE.json +1 -1
- package/dist/esm/router-binding/RouterProvider.js +2 -1
- package/dist/esm/router-binding/Transitioner.js +10 -4
- package/dist/esm/router-binding/fileRoute.js +1 -1
- package/dist/esm/router-binding/headContentUtils.js +9 -3
- package/dist/esm/router-binding/index.js +1 -1
- package/dist/esm/router-binding/link.js +2 -2
- package/dist/esm/router-binding/registryTransfer.js +16 -3
- package/dist/esm/router-binding/router.js +2 -1
- package/dist/esm/router-binding/routerOptions.js +0 -0
- package/dist/esm/router-binding/useLoaderData.js +1 -2
- package/dist/esm/router-binding/useNavigate.js +8 -2
- package/dist/esm/router-binding/useParams.js +1 -3
- package/dist/esm/router-binding/useSearch.js +1 -3
- package/dist/esm-node/actions.js +2 -2
- package/dist/esm-node/application-router.js +7 -2
- package/dist/esm-node/entry-client.js +1 -0
- package/dist/esm-node/federation-ssr.js +17 -9
- package/dist/esm-node/federation.js +8 -4
- package/dist/esm-node/i18n/LocalizedLink.js +43 -97
- package/dist/esm-node/i18n/index.js +1 -1
- package/dist/esm-node/index.js +1 -1
- package/dist/esm-node/plugin/profile.js +2 -1
- package/dist/esm-node/route-completion.js +2 -1
- package/dist/esm-node/router-binding/Asset.js +3 -2
- package/dist/esm-node/router-binding/Matches.js +30 -30
- package/dist/esm-node/router-binding/PROVENANCE.json +1 -1
- package/dist/esm-node/router-binding/RouterProvider.js +2 -1
- package/dist/esm-node/router-binding/Transitioner.js +10 -4
- package/dist/esm-node/router-binding/fileRoute.js +1 -1
- package/dist/esm-node/router-binding/headContentUtils.js +9 -3
- package/dist/esm-node/router-binding/index.js +1 -1
- package/dist/esm-node/router-binding/link.js +2 -2
- package/dist/esm-node/router-binding/registryTransfer.js +16 -3
- package/dist/esm-node/router-binding/router.js +2 -1
- package/dist/esm-node/router-binding/routerOptions.js +1 -0
- package/dist/esm-node/router-binding/useLoaderData.js +1 -2
- package/dist/esm-node/router-binding/useNavigate.js +8 -2
- package/dist/esm-node/router-binding/useParams.js +1 -3
- package/dist/esm-node/router-binding/useSearch.js +1 -3
- package/dist/types/federation-ssr.d.ts +3 -5
- package/dist/types/i18n/LocalizedLink.d.ts +5 -33
- package/dist/types/i18n/index.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/router-binding/RouterProvider.d.ts +2 -1
- package/dist/types/router-binding/index.d.ts +3 -2
- package/dist/types/router-binding/registryTransfer.d.ts +2 -0
- package/dist/types/router-binding/routerOptions.d.ts +6 -0
- package/dist/types/router.d.ts +3 -3
- package/package.json +19 -10
- package/src/actions.tsx +5 -1
- package/src/application-router.tsx +9 -3
- package/src/entry-client.tsx +1 -0
- package/src/federation-ssr.ts +32 -13
- package/src/federation.tsx +9 -5
- package/src/i18n/LocalizedLink.tsx +44 -83
- package/src/i18n/index.ts +1 -5
- package/src/index.ts +1 -1
- package/src/plugin/profile.ts +3 -1
- package/src/route-completion.tsx +5 -1
- package/src/router-binding/Asset.tsx +10 -9
- package/src/router-binding/Matches.tsx +10 -10
- package/src/router-binding/PROVENANCE.json +1 -1
- package/src/router-binding/RouterProvider.tsx +4 -5
- package/src/router-binding/Transitioner.tsx +6 -1
- package/src/router-binding/fileRoute.ts +1 -1
- package/src/router-binding/headContentUtils.tsx +5 -3
- package/src/router-binding/index.tsx +1 -4
- package/src/router-binding/link.tsx +2 -2
- package/src/router-binding/registryTransfer.ts +23 -6
- package/src/router-binding/route.tsx +1 -1
- package/src/router-binding/router.ts +2 -0
- package/src/router-binding/routerOptions.ts +26 -0
- package/src/router-binding/useLoaderData.tsx +4 -3
- package/src/router-binding/useNavigate.tsx +5 -3
- package/src/router-binding/useParams.tsx +1 -3
- package/src/router-binding/useSearch.tsx +1 -3
- package/src/router.ts +3 -3
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
import { remoteBrowserAssets } from "@modern-js/renderer-core/federation";
|
|
2
1
|
const FEDERATED_ASSET_PREFIX = "ultramodern-federation:";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
if (!assets || !scope
|
|
2
|
+
const capturedAssets = new WeakMap();
|
|
3
|
+
function captureFederatedServerAssets(scope, id, assets) {
|
|
4
|
+
const instance = scope.instance;
|
|
5
|
+
if (!assets || !scope.hydrationModule || !instance?.name) return;
|
|
7
6
|
const hydration = `${scope.hydrationModule}?id=${encodeURIComponent(id)}&host=${encodeURIComponent(instance.name)}`;
|
|
8
|
-
|
|
7
|
+
let records = capturedAssets.get(scope);
|
|
8
|
+
if (!records) {
|
|
9
|
+
records = new Map();
|
|
10
|
+
capturedAssets.set(scope, records);
|
|
11
|
+
}
|
|
12
|
+
const baseKey = federatedAssetKey(id);
|
|
13
|
+
let key = baseKey;
|
|
14
|
+
for(let revision = 1; records.has(key); revision += 1)key = `${baseKey}:${revision}`;
|
|
15
|
+
records.set(key, {
|
|
9
16
|
hydration,
|
|
10
17
|
assets
|
|
11
|
-
};
|
|
18
|
+
});
|
|
19
|
+
return key;
|
|
12
20
|
}
|
|
13
21
|
function federatedAssetKey(id) {
|
|
14
22
|
return `${FEDERATED_ASSET_PREFIX}${id}`;
|
|
@@ -64,7 +72,7 @@ function withFederatedAssets(manifest, scope) {
|
|
|
64
72
|
const modules = manifest;
|
|
65
73
|
const resolve = (key)=>{
|
|
66
74
|
if (!key.startsWith(FEDERATED_ASSET_PREFIX)) return resolveStaticAssets(modules, key);
|
|
67
|
-
const remote =
|
|
75
|
+
const remote = capturedAssets.get(scope)?.get(key);
|
|
68
76
|
if (!remote) return null;
|
|
69
77
|
return {
|
|
70
78
|
js: [
|
|
@@ -81,4 +89,4 @@ function withFederatedAssets(manifest, scope) {
|
|
|
81
89
|
resolveSync: resolve
|
|
82
90
|
};
|
|
83
91
|
}
|
|
84
|
-
export { FEDERATED_ASSET_PREFIX,
|
|
92
|
+
export { FEDERATED_ASSET_PREFIX, captureFederatedServerAssets, federatedAssetKey, withFederatedAssets };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { loadFederatedModule } from "@modern-js/renderer-core/federation";
|
|
2
2
|
import { isServer } from "@solidjs/web";
|
|
3
3
|
import { FederationContext } from "./federation-context.js";
|
|
4
|
-
import {
|
|
4
|
+
import { captureFederatedServerAssets } from "./federation-ssr.js";
|
|
5
5
|
import * as __rspack_external_solid_js_0ac0db99 from "solid-js";
|
|
6
6
|
const DEFAULT_SERVER_TIMEOUT = 3e3;
|
|
7
7
|
function withTimeout(promise, timeout, label) {
|
|
@@ -31,16 +31,20 @@ function federatedComponent(remote, options = {}) {
|
|
|
31
31
|
const timeout = options.timeout ?? (isServer ? DEFAULT_SERVER_TIMEOUT : void 0);
|
|
32
32
|
const load = (scope)=>(0, __rspack_external_solid_js_0ac0db99.lazy)(async ()=>{
|
|
33
33
|
if (isServer && !id) throw new Error("A federatedComponent loader renders in the browser only; use a remote id to server-render it");
|
|
34
|
-
const module = await withTimeout(Promise.resolve().then(()=>id ? loadFederatedModule(scope.instance, id) : remote())
|
|
34
|
+
const { module, assets } = await withTimeout(Promise.resolve().then(()=>id ? loadFederatedModule(scope.instance, id) : remote().then((module)=>({
|
|
35
|
+
module,
|
|
36
|
+
assets: void 0
|
|
37
|
+
}))), timeout, id ?? "loader");
|
|
35
38
|
const component = module?.default;
|
|
36
39
|
if ("function" != typeof component) throw new TypeError("A federated Solid module must default-export a component");
|
|
37
40
|
if (!isServer || !id) return {
|
|
38
41
|
default: component
|
|
39
42
|
};
|
|
40
|
-
|
|
43
|
+
const assetKey = captureFederatedServerAssets(scope, id, assets);
|
|
44
|
+
if (!assetKey) throw new Error(`Cannot server-render ${id}: the host has no server federation state for its browser assets`);
|
|
41
45
|
return {
|
|
42
46
|
default: component,
|
|
43
|
-
$$moduleUrl:
|
|
47
|
+
$$moduleUrl: assetKey
|
|
44
48
|
};
|
|
45
49
|
});
|
|
46
50
|
const remotes = new WeakMap();
|
|
@@ -1,86 +1,42 @@
|
|
|
1
1
|
import { memo, mergeProps } from "@solidjs/web";
|
|
2
|
-
import {
|
|
2
|
+
import { configuredLanguage, localizePath } from "@modern-js/i18n-runtime-extensions/paths";
|
|
3
3
|
import { Link, useLocation, useRouter } from "../router.js";
|
|
4
4
|
import { I18nContext } from "./context.js";
|
|
5
5
|
import * as __rspack_external_solid_js_0ac0db99 from "solid-js";
|
|
6
|
-
var _m$ = Symbol(), _m$2 = Symbol(), _m$3 = Symbol(), _m$4 = Symbol(), _m$5 = Symbol();
|
|
6
|
+
var _m$ = Symbol(), _m$2 = Symbol(), _m$3 = Symbol(), _m$4 = Symbol(), _m$5 = Symbol(), _m$6 = Symbol();
|
|
7
7
|
var _d$ = {
|
|
8
8
|
get () {
|
|
9
|
-
const
|
|
9
|
+
const router = this[_m$];
|
|
10
10
|
const props = this[_m$2];
|
|
11
|
-
|
|
11
|
+
const pathname = this[_m$3];
|
|
12
|
+
return memo(()=>!!router.options.rewrite)() ? props.to : pathname();
|
|
12
13
|
},
|
|
13
14
|
enumerable: true,
|
|
14
15
|
configurable: true
|
|
15
16
|
}, _d$2 = {
|
|
16
17
|
get () {
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const href = this[_m$3];
|
|
27
|
-
return memo(()=>!!masked())() ? {
|
|
28
|
-
to: href()
|
|
18
|
+
const router = this[_m$];
|
|
19
|
+
const externalTarget = this[_m$4];
|
|
20
|
+
const pathname = this[_m$3];
|
|
21
|
+
const props = this[_m$2];
|
|
22
|
+
return memo(()=>!!(router.options.rewrite && !externalTarget()))() ? {
|
|
23
|
+
to: pathname(),
|
|
24
|
+
inheritSearch: true,
|
|
25
|
+
hash: props.hash,
|
|
26
|
+
state: props.state
|
|
29
27
|
} : void 0;
|
|
30
28
|
},
|
|
31
29
|
enumerable: true,
|
|
32
30
|
configurable: true
|
|
33
|
-
}, _d$
|
|
31
|
+
}, _d$3 = {
|
|
34
32
|
get () {
|
|
35
|
-
const crossLanguage = this[_m$4];
|
|
36
33
|
const targetLanguage = this[_m$5];
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
enumerable: true,
|
|
40
|
-
configurable: true
|
|
41
|
-
}, _d$5 = {
|
|
42
|
-
get () {
|
|
43
|
-
const props = this[_m$2];
|
|
44
|
-
return props.class;
|
|
45
|
-
},
|
|
46
|
-
enumerable: true,
|
|
47
|
-
configurable: true
|
|
48
|
-
}, _d$6 = {
|
|
49
|
-
get () {
|
|
50
|
-
const props = this[_m$2];
|
|
51
|
-
return props.activeProps;
|
|
34
|
+
const context = this[_m$6];
|
|
35
|
+
return memo(()=>targetLanguage() === context.language())() ? void 0 : targetLanguage();
|
|
52
36
|
},
|
|
53
37
|
enumerable: true,
|
|
54
38
|
configurable: true
|
|
55
|
-
}, _d$
|
|
56
|
-
get () {
|
|
57
|
-
const props = this[_m$2];
|
|
58
|
-
return props.inactiveProps;
|
|
59
|
-
},
|
|
60
|
-
enumerable: true,
|
|
61
|
-
configurable: true
|
|
62
|
-
}, _d$8 = {
|
|
63
|
-
get () {
|
|
64
|
-
const props = this[_m$2];
|
|
65
|
-
return props.activeOptions;
|
|
66
|
-
},
|
|
67
|
-
enumerable: true,
|
|
68
|
-
configurable: true
|
|
69
|
-
}, _d$9 = {
|
|
70
|
-
get () {
|
|
71
|
-
const props = this[_m$2];
|
|
72
|
-
return props.replace;
|
|
73
|
-
},
|
|
74
|
-
enumerable: true,
|
|
75
|
-
configurable: true
|
|
76
|
-
}, _d$10 = {
|
|
77
|
-
get () {
|
|
78
|
-
const props = this[_m$2];
|
|
79
|
-
return props.preload;
|
|
80
|
-
},
|
|
81
|
-
enumerable: true,
|
|
82
|
-
configurable: true
|
|
83
|
-
}, _d$11 = {
|
|
39
|
+
}, _d$4 = {
|
|
84
40
|
get () {
|
|
85
41
|
const props = this[_m$2];
|
|
86
42
|
return props.children;
|
|
@@ -88,55 +44,45 @@ var _d$ = {
|
|
|
88
44
|
enumerable: true,
|
|
89
45
|
configurable: true
|
|
90
46
|
};
|
|
91
|
-
function _P$(_p, _p2, _p3, _p4, _p5) {
|
|
47
|
+
function _P$(_p, _p2, _p3, _p4, _p5, _p6) {
|
|
92
48
|
this[_m$] = _p;
|
|
93
49
|
this[_m$2] = _p2;
|
|
94
50
|
this[_m$3] = _p3;
|
|
95
51
|
this[_m$4] = _p4;
|
|
96
52
|
this[_m$5] = _p5;
|
|
53
|
+
this[_m$6] = _p6;
|
|
97
54
|
Object.defineProperty(this, "to", _d$);
|
|
98
|
-
Object.defineProperty(this, "
|
|
99
|
-
Object.defineProperty(this, "
|
|
100
|
-
Object.defineProperty(this, "
|
|
101
|
-
Object.defineProperty(this, "class", _d$5);
|
|
102
|
-
Object.defineProperty(this, "activeProps", _d$6);
|
|
103
|
-
Object.defineProperty(this, "inactiveProps", _d$7);
|
|
104
|
-
Object.defineProperty(this, "activeOptions", _d$8);
|
|
105
|
-
Object.defineProperty(this, "replace", _d$9);
|
|
106
|
-
Object.defineProperty(this, "preload", _d$10);
|
|
107
|
-
Object.defineProperty(this, "children", _d$11);
|
|
55
|
+
Object.defineProperty(this, "mask", _d$2);
|
|
56
|
+
Object.defineProperty(this, "hreflang", _d$3);
|
|
57
|
+
Object.defineProperty(this, "children", _d$4);
|
|
108
58
|
}
|
|
109
59
|
_P$.prototype = Object.prototype;
|
|
110
60
|
function LocalizedLink(props) {
|
|
111
61
|
const context = __rspack_external_solid_js_0ac0db99.useContext(I18nContext);
|
|
112
62
|
const router = useRouter();
|
|
113
|
-
const rewrite = Boolean(router.options.rewrite);
|
|
114
|
-
const targetLanguage = ()=>void 0 === props.language ? context.language() : configuredLanguage(props.language, context.languages);
|
|
115
|
-
const href = __rspack_external_solid_js_0ac0db99.createMemo(()=>localizePath(props.to, targetLanguage(), {
|
|
116
|
-
languages: [
|
|
117
|
-
...context.languages
|
|
118
|
-
],
|
|
119
|
-
localisedUrls: context.localisedUrls
|
|
120
|
-
}));
|
|
121
|
-
const crossLanguage = ()=>targetLanguage() !== context.language();
|
|
122
|
-
const masked = ()=>rewrite && crossLanguage();
|
|
123
|
-
const dataAttributes = Object.defineProperties({}, Object.fromEntries(Object.keys(props).filter((key)=>key.startsWith("data-")).map((key)=>[
|
|
124
|
-
key,
|
|
125
|
-
{
|
|
126
|
-
enumerable: true,
|
|
127
|
-
get: ()=>props[key]
|
|
128
|
-
}
|
|
129
|
-
])));
|
|
130
|
-
return Link(mergeProps(dataAttributes, new _P$(masked, props, href, crossLanguage, targetLanguage)));
|
|
131
|
-
}
|
|
132
|
-
function useIsLocalizedActive(canonicalTarget) {
|
|
133
|
-
const context = __rspack_external_solid_js_0ac0db99.useContext(I18nContext);
|
|
134
63
|
const location = useLocation();
|
|
135
|
-
|
|
64
|
+
const options = __rspack_external_solid_js_0ac0db99.omit(props, "to", "language", "children");
|
|
65
|
+
const targetLanguage = ()=>void 0 === props.language ? context.language() : configuredLanguage(props.language, context.languages);
|
|
66
|
+
const externalTarget = ()=>props.to.startsWith("//") || URL.canParse(props.to);
|
|
67
|
+
const canonicalTarget = ()=>({
|
|
68
|
+
to: props.to,
|
|
69
|
+
from: props.from,
|
|
70
|
+
params: props.params,
|
|
71
|
+
unsafeRelative: props.unsafeRelative
|
|
72
|
+
});
|
|
73
|
+
const pathname = __rspack_external_solid_js_0ac0db99.createMemo(()=>{
|
|
74
|
+
if (externalTarget()) return props.to;
|
|
75
|
+
const target = router.buildLocation({
|
|
76
|
+
...canonicalTarget(),
|
|
77
|
+
_fromLocation: location()
|
|
78
|
+
});
|
|
79
|
+
return localizePath(target.pathname, targetLanguage(), {
|
|
136
80
|
languages: [
|
|
137
81
|
...context.languages
|
|
138
82
|
],
|
|
139
83
|
localisedUrls: context.localisedUrls
|
|
140
|
-
})
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
return Link(mergeProps(options, new _P$(router, props, pathname, externalTarget, targetLanguage, context)));
|
|
141
87
|
}
|
|
142
|
-
export { LocalizedLink
|
|
88
|
+
export { LocalizedLink };
|
|
@@ -3,6 +3,6 @@ export { I18N_SSR_HANDOFF_ELEMENT_ID, createI18nSsrHandoffInlineData, readI18nSs
|
|
|
3
3
|
export { createI18nUrlRewrite } from "@modern-js/i18n-runtime-extensions/urlRewrite";
|
|
4
4
|
export { I18nContext } from "./context.js";
|
|
5
5
|
export { I18nProvider } from "./I18nProvider.js";
|
|
6
|
-
export { LocalizedLink
|
|
6
|
+
export { LocalizedLink } from "./LocalizedLink.js";
|
|
7
7
|
export { createLatestLanguageSync } from "./languageSync.js";
|
|
8
8
|
export { useI18n } from "./useI18n.js";
|
package/dist/esm-node/index.js
CHANGED
|
@@ -4,7 +4,7 @@ const SOLID_RENDERER_PROFILE = {
|
|
|
4
4
|
web: "2.0.0-rc.15",
|
|
5
5
|
router: "@modern-js/renderer-solid/router@3.8.3",
|
|
6
6
|
routerSource: "4fbd65c5c3b40be87a6248867c22021c1c19bba8",
|
|
7
|
-
routerCore: "1.171.
|
|
7
|
+
routerCore: "1.171.38",
|
|
8
8
|
history: "1.162.5",
|
|
9
9
|
publicRouteData: {
|
|
10
10
|
containers: [
|
|
@@ -22,7 +22,7 @@ const solidProfile = {
|
|
|
22
22
|
name: '@modern-js/renderer-solid',
|
|
23
23
|
version: '3.8.3',
|
|
24
24
|
coreName: '@tanstack/router-core',
|
|
25
|
-
coreVersion: '1.171.
|
|
25
|
+
coreVersion: '1.171.38'
|
|
26
26
|
},
|
|
27
27
|
sourceExtensions: [
|
|
28
28
|
'.tsx',
|
|
@@ -32,6 +32,7 @@ const solidProfile = {
|
|
|
32
32
|
],
|
|
33
33
|
jsxImportSource: '@solidjs/web',
|
|
34
34
|
dependencies: {
|
|
35
|
+
'@tanstack/router-core': 'https://github.com/BleedingDev/router/releases/download/ultramodern-router-core-585d3233f7f5/tanstack-router-core-1.171.38.tgz',
|
|
35
36
|
'solid-js': '2.0.0-rc.15',
|
|
36
37
|
'@solidjs/web': '2.0.0-rc.15',
|
|
37
38
|
'@solidjs/signals': '2.0.0-rc.15',
|
|
@@ -2,7 +2,7 @@ import { DataProtocolError } from "@modern-js/renderer-core/data";
|
|
|
2
2
|
import { Dynamic } from "@solidjs/web";
|
|
3
3
|
import { createEffect, createMemo, createSignal, onCleanup } from "solid-js";
|
|
4
4
|
import { createRouter, preparePublicContextData, useMatch } from "./router-binding/index.js";
|
|
5
|
-
import { registerPublicRouteDataOwner } from "./router-binding/registryTransfer.js";
|
|
5
|
+
import { assertNativeSerializationOptions, registerPublicRouteDataOwner } from "./router-binding/registryTransfer.js";
|
|
6
6
|
var _m$ = Symbol();
|
|
7
7
|
var _d$ = {
|
|
8
8
|
get () {
|
|
@@ -28,6 +28,7 @@ function registerRouteCompletionScope(route, scope) {
|
|
|
28
28
|
routeScopes.set(route, scope);
|
|
29
29
|
}
|
|
30
30
|
const createApplicationRouter = (options)=>{
|
|
31
|
+
assertNativeSerializationOptions(options);
|
|
31
32
|
const scope = options.routeTree ? routeScopes.get(options.routeTree) : void 0;
|
|
32
33
|
if (!scope) assertManagedRouteData(options.routeTree);
|
|
33
34
|
if (scope && options.routeTree) registerPublicRouteDataOwner(options.routeTree, scope.hydrationOwner, scope.privateRoots);
|
|
@@ -80,9 +80,10 @@ function HeadElement(props) {
|
|
|
80
80
|
case "style":
|
|
81
81
|
{
|
|
82
82
|
const attrs = {
|
|
83
|
-
...props.attrs
|
|
84
|
-
innerHTML: "string" == typeof props.children ? props.children : void 0
|
|
83
|
+
...props.attrs
|
|
85
84
|
};
|
|
85
|
+
delete attrs.innerHTML;
|
|
86
|
+
if ("string" == typeof props.children) attrs.innerHTML = props.children;
|
|
86
87
|
element = ssrElement("style", attrs, void 0, true);
|
|
87
88
|
break;
|
|
88
89
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { memo } from "@solidjs/web";
|
|
1
|
+
import { memo, mergeProps } from "@solidjs/web";
|
|
2
2
|
import { replaceEqualDeep } from "@tanstack/router-core";
|
|
3
3
|
import { CatchBoundary, ErrorComponent } from "./CatchBoundary.js";
|
|
4
4
|
import { Match } from "./Match.js";
|
|
@@ -53,38 +53,30 @@ function _P$3(_p4, _p5) {
|
|
|
53
53
|
}
|
|
54
54
|
_P$3.prototype = Object.prototype;
|
|
55
55
|
var _d$4 = {
|
|
56
|
-
get () {
|
|
57
|
-
return "production" !== process.env.NODE_ENV ? (error)=>{
|
|
58
|
-
console.warn("Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!");
|
|
59
|
-
console.warn(`Warning: ${error.message || error.toString()}`);
|
|
60
|
-
} : void 0;
|
|
61
|
-
},
|
|
62
|
-
enumerable: true,
|
|
63
|
-
configurable: true
|
|
64
|
-
};
|
|
65
|
-
function _P$4(_p6, _p7, _p8) {
|
|
66
|
-
this.getResetKey = _p6;
|
|
67
|
-
this.render = _p7;
|
|
68
|
-
this.errorComponent = _p8;
|
|
69
|
-
Object.defineProperty(this, "onCatch", _d$4);
|
|
70
|
-
}
|
|
71
|
-
_P$4.prototype = Object.prototype;
|
|
72
|
-
var _d$5 = {
|
|
73
56
|
get () {
|
|
74
57
|
const router = this[_m$];
|
|
75
58
|
const matchContent = this[_m$2];
|
|
76
|
-
return CatchBoundary(
|
|
59
|
+
return CatchBoundary(mergeProps({
|
|
60
|
+
getResetKey: ()=>router.stores.matches.get(),
|
|
61
|
+
render: matchContent,
|
|
62
|
+
errorComponent: ErrorComponent
|
|
63
|
+
}, ()=>"production" !== process.env.NODE_ENV ? {
|
|
64
|
+
onCatch: (error)=>{
|
|
65
|
+
console.warn("Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!");
|
|
66
|
+
console.warn(`Warning: ${error.message || error.toString()}`);
|
|
67
|
+
}
|
|
68
|
+
} : {}));
|
|
77
69
|
},
|
|
78
70
|
enumerable: true,
|
|
79
71
|
configurable: true
|
|
80
72
|
};
|
|
81
|
-
function _P$
|
|
82
|
-
this[_m$] =
|
|
83
|
-
this[_m$2] =
|
|
84
|
-
this.value =
|
|
85
|
-
Object.defineProperty(this, "children", _d$
|
|
73
|
+
function _P$4(_p6, _p7, _p8) {
|
|
74
|
+
this[_m$] = _p6;
|
|
75
|
+
this[_m$2] = _p7;
|
|
76
|
+
this.value = _p8;
|
|
77
|
+
Object.defineProperty(this, "children", _d$4);
|
|
86
78
|
}
|
|
87
|
-
_P$
|
|
79
|
+
_P$4.prototype = Object.prototype;
|
|
88
80
|
const NearestMatchContext = nearestMatchContext;
|
|
89
81
|
function Matches() {
|
|
90
82
|
const router = useRouter();
|
|
@@ -103,7 +95,7 @@ function MatchesInner() {
|
|
|
103
95
|
routeId: currentRouteId
|
|
104
96
|
})));
|
|
105
97
|
if (router.options.disableGlobalCatchBoundary) return NearestMatchContext(new _P$3(matchContent, nearestMatch));
|
|
106
|
-
return NearestMatchContext(new _P$
|
|
98
|
+
return NearestMatchContext(new _P$4(router, matchContent, nearestMatch));
|
|
107
99
|
}
|
|
108
100
|
function useMatchRoute() {
|
|
109
101
|
const router = useRouter();
|
|
@@ -113,10 +105,18 @@ function useMatchRoute() {
|
|
|
113
105
|
router.stores.resolvedLocation.get();
|
|
114
106
|
router.stores.status.get();
|
|
115
107
|
return router.matchRoute(rest, {
|
|
116
|
-
pending
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
108
|
+
...void 0 !== pending ? {
|
|
109
|
+
pending
|
|
110
|
+
} : {},
|
|
111
|
+
...void 0 !== caseSensitive ? {
|
|
112
|
+
caseSensitive
|
|
113
|
+
} : {},
|
|
114
|
+
...void 0 !== fuzzy ? {
|
|
115
|
+
fuzzy
|
|
116
|
+
} : {},
|
|
117
|
+
...void 0 !== includeSearch ? {
|
|
118
|
+
includeSearch
|
|
119
|
+
} : {}
|
|
120
120
|
});
|
|
121
121
|
});
|
|
122
122
|
}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"utils.ts": "a398c76ac378efe6f8b9aa859a5335d4f07cc692a31754fa93c8bf3e5df0b6ff"
|
|
68
68
|
},
|
|
69
69
|
"localChanges": [
|
|
70
|
-
"The public router surface omits InjectedHtmlEntry, isPlainArray and isPlainObject, which router-core 1.171.37 no longer exports. SSR
|
|
70
|
+
"The public router surface omits InjectedHtmlEntry, isPlainArray and isPlainObject, which router-core 1.171.37 no longer exports. Managed SSR uses immutable public route data and native Solid 2 promise serialization. Custom serializationAdapters are unsupported and rejected before router construction or document commitment; the local public option types do not admit them.",
|
|
71
71
|
"Authored JSX types import @solidjs/web and have explicit return annotations for Solid 2 declaration generation.",
|
|
72
72
|
"Hydration state and keyed match transfer use Solid 2 RC.13 public isHydrating, isHydratable, getHydrationWriter and takeHydrationValue APIs.",
|
|
73
73
|
"Explicit public beforeLoad results transfer after canonical validation; private request context stays in owner closures. Initial hydration inherits checked server beforeLoad contributions, invokes the native client route-context callback and preserves client options context without rerunning initial beforeLoad callbacks or loaders.",
|
|
@@ -2,7 +2,7 @@ import { mergeProps } from "@solidjs/web";
|
|
|
2
2
|
import { isServer } from "@tanstack/router-core/isServer";
|
|
3
3
|
import { setupFlightDataConsumer } from "./flightData.js";
|
|
4
4
|
import { Matches } from "./Matches.js";
|
|
5
|
-
import { requireManagedPublicRouter, serializeMatchTransfer } from "./registryTransfer.js";
|
|
5
|
+
import { assertNativeSerializationOptions, requireManagedPublicRouter, serializeMatchTransfer } from "./registryTransfer.js";
|
|
6
6
|
import { routerContext } from "./routerContext.js";
|
|
7
7
|
import { SafeFragment } from "./SafeFragment.js";
|
|
8
8
|
import * as __rspack_external_solid_js_0ac0db99 from "solid-js";
|
|
@@ -61,6 +61,7 @@ function _P$3(_p7, _p8, _p9) {
|
|
|
61
61
|
_P$3.prototype = Object.prototype;
|
|
62
62
|
const RouterContext = routerContext;
|
|
63
63
|
function RouterContextProvider({ router, children, ...rest }) {
|
|
64
|
+
assertNativeSerializationOptions(rest);
|
|
64
65
|
requireManagedPublicRouter(router);
|
|
65
66
|
if (Object.keys(rest).length > 0) __rspack_external_solid_js_0ac0db99.runWithOwner(null, ()=>{
|
|
66
67
|
router.update({
|
|
@@ -93,10 +93,16 @@ function Rendered() {
|
|
|
93
93
|
const router = useRouter();
|
|
94
94
|
__rspack_external_solid_js_0ac0db99.onSettled(()=>{
|
|
95
95
|
const resolvedLocation = getResolvedLocation(router);
|
|
96
|
-
if (resolvedLocation)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
if (resolvedLocation) {
|
|
97
|
+
const { fromLocation, ...changeInfo } = getLocationChangeInfo(resolvedLocation, resolvedLocation);
|
|
98
|
+
router.emit({
|
|
99
|
+
type: "onRendered",
|
|
100
|
+
...changeInfo,
|
|
101
|
+
...void 0 !== fromLocation ? {
|
|
102
|
+
fromLocation
|
|
103
|
+
} : {}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
100
106
|
});
|
|
101
107
|
return null;
|
|
102
108
|
}
|
|
@@ -91,7 +91,9 @@ const useTags = (assetCrossOrigin)=>{
|
|
|
91
91
|
...manifest.inlineStyle.attrs,
|
|
92
92
|
nonce
|
|
93
93
|
},
|
|
94
|
-
|
|
94
|
+
...void 0 !== manifest.inlineStyle.children ? {
|
|
95
|
+
children: manifest.inlineStyle.children
|
|
96
|
+
} : {},
|
|
95
97
|
inlineCss: true
|
|
96
98
|
});
|
|
97
99
|
return tags;
|
|
@@ -114,7 +116,9 @@ const useTags = (assetCrossOrigin)=>{
|
|
|
114
116
|
...attrs,
|
|
115
117
|
nonce
|
|
116
118
|
},
|
|
117
|
-
children
|
|
119
|
+
...null != children ? {
|
|
120
|
+
children: String(children)
|
|
121
|
+
} : {}
|
|
118
122
|
})));
|
|
119
123
|
const headScripts = __rspack_external_solid_js_0ac0db99.createMemo(()=>activeMatches().flatMap((match)=>match.headScripts ?? []).filter((script)=>void 0 !== script).map(({ children, ...attrs })=>({
|
|
120
124
|
tag: "script",
|
|
@@ -122,7 +126,9 @@ const useTags = (assetCrossOrigin)=>{
|
|
|
122
126
|
...attrs,
|
|
123
127
|
nonce
|
|
124
128
|
},
|
|
125
|
-
children
|
|
129
|
+
...null != children ? {
|
|
130
|
+
children: String(children)
|
|
131
|
+
} : {}
|
|
126
132
|
})));
|
|
127
133
|
return __rspack_external_solid_js_0ac0db99.createMemo(()=>{
|
|
128
134
|
const next = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from "./history.js";
|
|
2
2
|
export { createBrowserHistory, createHashHistory, createHistory, createMemoryHistory } from "@tanstack/history";
|
|
3
|
-
export { DEFAULT_PROTOCOL_ALLOWLIST, SearchParamError, cleanPath, composeRewrites, createControlledPromise,
|
|
3
|
+
export { DEFAULT_PROTOCOL_ALLOWLIST, SearchParamError, cleanPath, composeRewrites, createControlledPromise, deepEqual, defaultParseSearch, defaultStringifySearch, defer, functionalUpdate, interpolatePath, isMatch, isNotFound, isRedirect, joinPaths, lazyFn, notFound, parseSearchWith, redirect, replaceEqualDeep, resolvePath, retainSearchParams, rootRouteId, stringifySearchWith, stripSearchParams, trimPath, trimPathLeft, trimPathRight } from "@tanstack/router-core";
|
|
4
4
|
export { Asset } from "./Asset.js";
|
|
5
5
|
export { Await, useAwaited } from "./awaited.js";
|
|
6
6
|
export { CatchBoundary, ErrorComponent } from "./CatchBoundary.js";
|
|
@@ -267,8 +267,8 @@ function useLinkProps(options) {
|
|
|
267
267
|
configurable: true
|
|
268
268
|
});
|
|
269
269
|
const defineGetters = (getters)=>{
|
|
270
|
-
for (const key of Object.
|
|
271
|
-
get
|
|
270
|
+
for (const [key, get] of Object.entries(getters))Object.defineProperty(linkProps, key, {
|
|
271
|
+
get,
|
|
272
272
|
enumerable: true,
|
|
273
273
|
configurable: true
|
|
274
274
|
});
|
|
@@ -12,7 +12,16 @@ function registerPublicRouteDataOwner(routeTree, owner, privateContexts = []) {
|
|
|
12
12
|
privateContexts: privateContexts.map((value)=>new WeakRef(value))
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
+
function assertNativeSerializationOptions(options) {
|
|
16
|
+
if ("serializationAdapters" in options) {
|
|
17
|
+
const error = new DataProtocolError("Solid serializationAdapters are unsupported by the immutable public-data profile; return public records, arrays and scalars instead");
|
|
18
|
+
const owner = getRequestEvent()?.locals.session;
|
|
19
|
+
owner?.fail(error);
|
|
20
|
+
throw error;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
15
23
|
function requireManagedPublicRouter(router) {
|
|
24
|
+
assertNativeSerializationOptions(router.options);
|
|
16
25
|
const owner = getRequestEvent()?.locals.session;
|
|
17
26
|
if (!owner || publicRouteDataOwners.get(router.options.routeTree)?.owner.deref()) return;
|
|
18
27
|
const error = new DataProtocolError("Custom native Solid routers are unsupported by UltraModern SSR. Use the managed filesystem route tree and application router public-data boundary.");
|
|
@@ -129,10 +138,13 @@ function primeRouterFromRegistry(router) {
|
|
|
129
138
|
try {
|
|
130
139
|
for (const [index, match] of matches.entries()){
|
|
131
140
|
const entry = entries[index];
|
|
141
|
+
const beforeLoadContext = preparePublicContextData(entry.beforeLoadContext, owner, privateContexts);
|
|
132
142
|
const checked = {
|
|
133
143
|
...entry,
|
|
134
144
|
loaderData: prepareHydratedLoaderData(entry.loaderData, owner, privateContexts),
|
|
135
|
-
|
|
145
|
+
...void 0 !== beforeLoadContext ? {
|
|
146
|
+
beforeLoadContext
|
|
147
|
+
} : {},
|
|
136
148
|
error: preparePublicContextData(entry.error, owner, privateContexts)
|
|
137
149
|
};
|
|
138
150
|
entries[index] = checked;
|
|
@@ -196,7 +208,8 @@ function applyTransferredMatch(match, entry) {
|
|
|
196
208
|
__beforeLoadContext: entry.beforeLoadContext
|
|
197
209
|
};
|
|
198
210
|
if ("loaderData" in entry) next.loaderData = entry.loaderData;
|
|
199
|
-
if ("ssr" in entry)
|
|
211
|
+
if ("ssr" in entry) if (void 0 === entry.ssr) delete next.ssr;
|
|
212
|
+
else next.ssr = entry.ssr;
|
|
200
213
|
return next;
|
|
201
214
|
}
|
|
202
215
|
function isRouteDataErrorSnapshot(value) {
|
|
@@ -207,4 +220,4 @@ function nativeContextField(match, key) {
|
|
|
207
220
|
if (descriptor?.get || descriptor?.set) throw new DataProtocolError("Native route context must not contain accessor fields");
|
|
208
221
|
return descriptor?.value;
|
|
209
222
|
}
|
|
210
|
-
export { MATCH_KEY_PREFIX, installPublicContextPublication, prepareRouterMatchTransfer, primeRouterFromRegistry, registerPublicRouteDataOwner, requireManagedPublicRouter, serializeMatchTransfer };
|
|
223
|
+
export { MATCH_KEY_PREFIX, assertNativeSerializationOptions, installPublicContextPublication, prepareRouterMatchTransfer, primeRouterFromRegistry, registerPublicRouteDataOwner, requireManagedPublicRouter, serializeMatchTransfer };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { RouterCore } from "@tanstack/router-core";
|
|
2
2
|
import { isServer } from "@tanstack/router-core/isServer";
|
|
3
|
-
import { installPublicContextPublication, primeRouterFromRegistry } from "./registryTransfer.js";
|
|
3
|
+
import { assertNativeSerializationOptions, installPublicContextPublication, primeRouterFromRegistry } from "./registryTransfer.js";
|
|
4
4
|
import { getStoreFactory } from "./routerStores.js";
|
|
5
5
|
const createRouter = (options)=>new Router(options);
|
|
6
6
|
class Router extends RouterCore {
|
|
7
7
|
constructor(options){
|
|
8
|
+
assertNativeSerializationOptions(options);
|
|
8
9
|
super(options, getStoreFactory);
|
|
9
10
|
installPublicContextPublication(this);
|
|
10
11
|
if (!(isServer ?? this.isServer)) primeRouterFromRegistry(this);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -2,10 +2,16 @@ import { useRouter } from "./useRouter.js";
|
|
|
2
2
|
import * as __rspack_external_solid_js_0ac0db99 from "solid-js";
|
|
3
3
|
function useNavigate(_defaultOpts) {
|
|
4
4
|
const router = useRouter();
|
|
5
|
-
|
|
5
|
+
const navigate = (options)=>{
|
|
6
|
+
const from = options.from ?? _defaultOpts?.from;
|
|
7
|
+
return router.navigate({
|
|
6
8
|
...options,
|
|
7
|
-
|
|
9
|
+
...void 0 === from ? {} : {
|
|
10
|
+
from
|
|
11
|
+
}
|
|
8
12
|
});
|
|
13
|
+
};
|
|
14
|
+
return navigate;
|
|
9
15
|
}
|
|
10
16
|
function Navigate(props) {
|
|
11
17
|
const { navigate } = useRouter();
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { useMatch } from "./useMatch.js";
|
|
2
2
|
function useParams(opts) {
|
|
3
3
|
return useMatch({
|
|
4
|
-
|
|
5
|
-
strict: opts.strict,
|
|
6
|
-
shouldThrow: opts.shouldThrow,
|
|
4
|
+
...opts,
|
|
7
5
|
select: (match)=>{
|
|
8
6
|
const params = false === opts.strict ? match.params : match._strictParams;
|
|
9
7
|
return opts.select ? opts.select(params) : params;
|