@bleedingdev/modern-js-renderer-solid 3.9.3-ultramodern.7 → 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 +3 -4
- 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 +5 -5
- package/dist/esm/manifest.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 +3 -3
- 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 +3 -5
- 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 +5 -5
- package/dist/esm-node/manifest.js +1 -1
- package/dist/esm-node/plugin/index.js +1 -4
- package/dist/esm-node/plugin/profile.js +10 -11
- 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/CatchBoundary.js +3 -3
- package/dist/esm-node/router-binding/Matches.js +30 -30
- package/dist/esm-node/router-binding/PROVENANCE.json +3 -3
- 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 +5 -5
- package/dist/types/manifest.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 +29 -22
- 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 +5 -5
- package/src/manifest.ts +1 -1
- package/src/plugin/index.ts +0 -3
- package/src/plugin/preserve-import-loader.cjs +1 -1
- package/src/plugin/profile.ts +10 -10
- 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 +3 -3
- 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
package/dist/esm-node/actions.js
CHANGED
|
@@ -67,9 +67,9 @@ function createRouteAction(options) {
|
|
|
67
67
|
const identity = Object.freeze({
|
|
68
68
|
...options.rendererIdentity
|
|
69
69
|
});
|
|
70
|
-
const client = createDataClient(routeId, identity, {
|
|
70
|
+
const client = createDataClient(routeId, identity, options.fetch ? {
|
|
71
71
|
fetch: options.fetch
|
|
72
|
-
});
|
|
72
|
+
} : {});
|
|
73
73
|
const requestURL = getRequestEvent()?.request.url;
|
|
74
74
|
const url = ()=>{
|
|
75
75
|
const base = "u" < typeof window ? requestURL : window.location.href;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mergeProps, useHead } from "@solidjs/web";
|
|
1
|
+
import { getRequestEvent, mergeProps, useHead } from "@solidjs/web";
|
|
2
2
|
import { DataProtocolError } from "@modern-js/renderer-core/data";
|
|
3
3
|
import { ownApplicationRouteData } from "./route-completion.js";
|
|
4
4
|
import { toHeadTags, useTags } from "./router-binding/headContentUtils.js";
|
|
@@ -10,7 +10,12 @@ function ApplicationHead() {
|
|
|
10
10
|
return null;
|
|
11
11
|
}
|
|
12
12
|
function ApplicationRouter(props) {
|
|
13
|
-
if (Object.hasOwn(props, "context"))
|
|
13
|
+
if (Object.hasOwn(props, "context")) {
|
|
14
|
+
const error = new DataProtocolError("Set public Solid router context in createApplicationRouter; ApplicationRouter context overrides are unsupported");
|
|
15
|
+
const session = getRequestEvent()?.locals.session;
|
|
16
|
+
session?.fail(error);
|
|
17
|
+
throw error;
|
|
18
|
+
}
|
|
14
19
|
const { router, ...rest } = props;
|
|
15
20
|
ownApplicationRouteData(router);
|
|
16
21
|
return RouterContextProvider(mergeProps({
|
|
@@ -6,6 +6,7 @@ function startNativeClient(options) {
|
|
|
6
6
|
startNativeClientEntry(options, {
|
|
7
7
|
readBootstrap: readSolidDocumentBootstrap,
|
|
8
8
|
createRouter: (application, routerOptions)=>createNativeRouter(application, routerOptions, solidRouterFactory),
|
|
9
|
+
disposeRouter: (router)=>router.history.destroy(),
|
|
9
10
|
async prepareRouter (router, hydrating) {
|
|
10
11
|
if (!hydrating) await router.load();
|
|
11
12
|
},
|
|
@@ -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
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const SOLID_RENDERER_PROFILE = {
|
|
2
2
|
renderer: "solid",
|
|
3
|
-
solid: "2.0.0-rc.
|
|
4
|
-
web: "2.0.0-rc.
|
|
3
|
+
solid: "2.0.0-rc.15",
|
|
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.
|
|
8
|
-
history: "1.162.
|
|
7
|
+
routerCore: "1.171.38",
|
|
8
|
+
history: "1.162.5",
|
|
9
9
|
publicRouteData: {
|
|
10
10
|
containers: [
|
|
11
11
|
"plain-record",
|
|
@@ -28,7 +28,7 @@ const SOLID_RENDERER_PROFILE = {
|
|
|
28
28
|
providerOverrides: "unsupported"
|
|
29
29
|
},
|
|
30
30
|
nativePromiseMetadata: {
|
|
31
|
-
runtime: "2.0.0-rc.
|
|
31
|
+
runtime: "2.0.0-rc.15",
|
|
32
32
|
fields: [
|
|
33
33
|
"s",
|
|
34
34
|
"v"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { nativeModuleManifestFilename, readRendererIdentity } from "@modern-js/renderer-core/identity";
|
|
2
|
-
const SOLID_COMPILER_VERSION = "2.0.0-rc.
|
|
2
|
+
const SOLID_COMPILER_VERSION = "2.0.0-rc.15";
|
|
3
3
|
function solidModuleManifestFilename(entryName) {
|
|
4
4
|
return nativeModuleManifestFilename("solid", entryName);
|
|
5
5
|
}
|
|
@@ -27,8 +27,6 @@ const rendererAdapter = defineRendererAdapter({
|
|
|
27
27
|
'solid-js',
|
|
28
28
|
'@solidjs/web',
|
|
29
29
|
'@solidjs/signals',
|
|
30
|
-
'seroval',
|
|
31
|
-
'seroval-plugins',
|
|
32
30
|
'@modern-js/renderer-solid',
|
|
33
31
|
'@modern-js/renderer-solid/client',
|
|
34
32
|
'@modern-js/renderer-solid/router',
|
|
@@ -63,8 +61,7 @@ const rendererAdapter = defineRendererAdapter({
|
|
|
63
61
|
'@solidjs/signals': profile.hydration.version
|
|
64
62
|
},
|
|
65
63
|
devDependencies: {
|
|
66
|
-
[profile.compiler.name]: profile.compiler.version
|
|
67
|
-
'@solidjs/babel-plugin': profile.compiler.version
|
|
64
|
+
[profile.compiler.name]: profile.compiler.version
|
|
68
65
|
}
|
|
69
66
|
}),
|
|
70
67
|
generateAppSources: generateSolidAppSources
|
|
@@ -2,7 +2,7 @@ const solidProfile = {
|
|
|
2
2
|
renderer: 'solid',
|
|
3
3
|
status: 'preview',
|
|
4
4
|
protocolVersion: 1,
|
|
5
|
-
minimumNode: '26.
|
|
5
|
+
minimumNode: '26.12.0',
|
|
6
6
|
hmr: {
|
|
7
7
|
editedBoundary: 'may-reset',
|
|
8
8
|
unaffectedComponents: 'preserved',
|
|
@@ -12,17 +12,17 @@ const solidProfile = {
|
|
|
12
12
|
},
|
|
13
13
|
compiler: {
|
|
14
14
|
name: '@solidjs/compiler',
|
|
15
|
-
version: '2.0.0-rc.
|
|
15
|
+
version: '2.0.0-rc.15'
|
|
16
16
|
},
|
|
17
17
|
hydration: {
|
|
18
18
|
name: '@solidjs/web',
|
|
19
|
-
version: '2.0.0-rc.
|
|
19
|
+
version: '2.0.0-rc.15'
|
|
20
20
|
},
|
|
21
21
|
router: {
|
|
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,13 +32,12 @@ const solidProfile = {
|
|
|
32
32
|
],
|
|
33
33
|
jsxImportSource: '@solidjs/web',
|
|
34
34
|
dependencies: {
|
|
35
|
-
'
|
|
36
|
-
'
|
|
37
|
-
'@solidjs/
|
|
38
|
-
'@solidjs/
|
|
39
|
-
'@
|
|
40
|
-
|
|
41
|
-
'seroval-plugins': '1.6.8'
|
|
35
|
+
'@tanstack/router-core': 'https://github.com/BleedingDev/router/releases/download/ultramodern-router-core-585d3233f7f5/tanstack-router-core-1.171.38.tgz',
|
|
36
|
+
'solid-js': '2.0.0-rc.15',
|
|
37
|
+
'@solidjs/web': '2.0.0-rc.15',
|
|
38
|
+
'@solidjs/signals': '2.0.0-rc.15',
|
|
39
|
+
'@solidjs/compiler': '2.0.0-rc.15',
|
|
40
|
+
'@modern-js/renderer-solid': '3.8.3'
|
|
42
41
|
},
|
|
43
42
|
capabilities: {
|
|
44
43
|
worker: true,
|
|
@@ -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 { Dynamic, escape as web_escape, memo, scope, ssr, ssrHydrationKey, ssrStyleProperty } from "@solidjs/web";
|
|
1
|
+
import { Dynamic, escape as web_escape, memo, scope, ssr, ssrHydrationKey, ssrStyleProperties, ssrStyleProperty } from "@solidjs/web";
|
|
2
2
|
import { renderInNonRouteComponentContext } from "./nonRouteComponentContext.js";
|
|
3
3
|
import * as __rspack_external_solid_js_0ac0db99 from "solid-js";
|
|
4
4
|
var _tmpl$ = [
|
|
@@ -128,9 +128,9 @@ function ErrorComponent({ error }) {
|
|
|
128
128
|
var _v$6, _v$7;
|
|
129
129
|
return _c$2() ? (_v$6 = ssrHydrationKey(), _v$7 = scope(()=>web_escape(error.message)), ssr(_tmpl$3, _v$6, _v$7)) : web_escape(null);
|
|
130
130
|
};
|
|
131
|
-
})()), ssr(_tmpl$2, _v$4,
|
|
131
|
+
})()), ssr(_tmpl$2, _v$4, ssrStyleProperties("font-size:", ".7em", "border:", "1px solid red", "border-radius:", ".25rem", "padding:", ".3rem", "color:", "red", "overflow:", "auto"), _v$5)) : web_escape(null);
|
|
132
132
|
};
|
|
133
133
|
})());
|
|
134
|
-
return ssr(_tmpl$, _v$,
|
|
134
|
+
return ssr(_tmpl$, _v$, ssrStyleProperties("padding:", ".5rem", "max-width:", "100%"), ssrStyleProperties("display:", "flex", "align-items:", "center", "gap:", ".5rem"), ssrStyleProperty("font-size:", "1rem"), ssrStyleProperties("appearance:", "none", "font-size:", ".6em", "border:", "1px solid currentColor", "padding:", ".1rem .2rem", "font-weight:", "bold", "border-radius:", ".25rem"), _v$2, ssrStyleProperty("height:", ".25rem"), _v$3);
|
|
135
135
|
}
|
|
136
136
|
export { CatchBoundary, ErrorComponent };
|
|
@@ -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
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"sourcePath": "packages/solid-router/src",
|
|
15
15
|
"upstreamPackage": "@tanstack/solid-router",
|
|
16
16
|
"upstreamVersion": "1.170.36",
|
|
17
|
-
"routerCoreVersion": "1.171.
|
|
17
|
+
"routerCoreVersion": "1.171.37",
|
|
18
18
|
"files": ["Scripts.tsx", "link.tsx"],
|
|
19
19
|
"adaptation": "Native body-script composition and positional search equality are ported from the matching router-core release. The owned binding retains Solid 2 RC.13 JSX, NoHydration, keyed public match transfer and its module-keyed client-assets resolver."
|
|
20
20
|
}
|
|
@@ -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.
|
|
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.",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
],
|
|
84
84
|
"nativeProtocolLimitations": [
|
|
85
85
|
{
|
|
86
|
-
"runtime": "@solidjs/web@2.0.0-rc.
|
|
86
|
+
"runtime": "@solidjs/web@2.0.0-rc.15 with Seroval 1.6.8",
|
|
87
87
|
"trigger": "Direct native writer injection of a rejected whole-match Promise before the client binding loads",
|
|
88
88
|
"observed": "Native inline resolver scripts reject registry Promises without a rejection handler; browser page errors occur before router construction. Binding claims cannot retroactively handle those errors.",
|
|
89
89
|
"supportedProducer": "The maintained match producer writes only settled synchronous records and excludes pending matches. Critical public-data failures are rejected before headers; unsupported deferred values fail the owning session and abort native serialization.",
|
|
@@ -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
|
}
|