@bleedingdev/modern-js-renderer-solid 3.9.3-ultramodern.1 → 3.9.3-ultramodern.10
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/create.js +22 -21
- 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/create.ts +22 -21
- 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/actions.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getNextElement, getRequestEvent, runHydrationEvents, spread, template } from "@solidjs/web";
|
|
2
2
|
import { createDataClient } from "@modern-js/renderer-core/data";
|
|
3
3
|
import { assertRendererIdentity, identityCacheKey } from "@modern-js/renderer-core/identity";
|
|
4
4
|
import { createSignal, getOwner, omit, onCleanup, untrack } from "solid-js";
|
|
@@ -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;
|
|
@@ -263,7 +263,6 @@ function ActionForm(props) {
|
|
|
263
263
|
props.action.submitForm(event.currentTarget, event.submitter);
|
|
264
264
|
};
|
|
265
265
|
var _el$ = getNextElement(_tmpl$);
|
|
266
|
-
claimElement(_el$);
|
|
267
266
|
spread(_el$, [
|
|
268
267
|
()=>omit(props, "action"),
|
|
269
268
|
{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createComponent, mergeProps, useHead } from "@solidjs/web";
|
|
1
|
+
import { createComponent, 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 createComponent(RouterContextProvider, mergeProps({
|
package/dist/esm/entry-client.js
CHANGED
|
@@ -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 };
|
package/dist/esm/federation.js
CHANGED
|
@@ -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,74 +1,52 @@
|
|
|
1
1
|
import { createComponent, 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
6
|
function LocalizedLink(props) {
|
|
7
7
|
const context = __rspack_external_solid_js_0ac0db99.useContext(I18nContext);
|
|
8
8
|
const router = useRouter();
|
|
9
|
-
const
|
|
9
|
+
const location = useLocation();
|
|
10
|
+
const options = __rspack_external_solid_js_0ac0db99.omit(props, "to", "language", "children");
|
|
10
11
|
const targetLanguage = ()=>void 0 === props.language ? context.language() : configuredLanguage(props.language, context.languages);
|
|
11
|
-
const
|
|
12
|
+
const externalTarget = ()=>props.to.startsWith("//") || URL.canParse(props.to);
|
|
13
|
+
const canonicalTarget = ()=>({
|
|
14
|
+
to: props.to,
|
|
15
|
+
from: props.from,
|
|
16
|
+
params: props.params,
|
|
17
|
+
unsafeRelative: props.unsafeRelative
|
|
18
|
+
});
|
|
19
|
+
const pathname = __rspack_external_solid_js_0ac0db99.createMemo(()=>{
|
|
20
|
+
if (externalTarget()) return props.to;
|
|
21
|
+
const target = router.buildLocation({
|
|
22
|
+
...canonicalTarget(),
|
|
23
|
+
_fromLocation: location()
|
|
24
|
+
});
|
|
25
|
+
return localizePath(target.pathname, targetLanguage(), {
|
|
12
26
|
languages: [
|
|
13
27
|
...context.languages
|
|
14
28
|
],
|
|
15
29
|
localisedUrls: context.localisedUrls
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const dataAttributes = Object.defineProperties({}, Object.fromEntries(Object.keys(props).filter((key)=>key.startsWith("data-")).map((key)=>[
|
|
20
|
-
key,
|
|
21
|
-
{
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: ()=>props[key]
|
|
24
|
-
}
|
|
25
|
-
])));
|
|
26
|
-
return createComponent(Link, mergeProps(dataAttributes, {
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
return createComponent(Link, mergeProps(options, {
|
|
27
33
|
get to () {
|
|
28
|
-
return memo(()=>!!
|
|
29
|
-
},
|
|
30
|
-
get href () {
|
|
31
|
-
return memo(()=>!!masked())() ? void 0 : href();
|
|
34
|
+
return memo(()=>!!router.options.rewrite)() ? props.to : pathname();
|
|
32
35
|
},
|
|
33
36
|
get mask () {
|
|
34
|
-
return memo(()=>!!
|
|
35
|
-
to:
|
|
37
|
+
return memo(()=>!!(router.options.rewrite && !externalTarget()))() ? {
|
|
38
|
+
to: pathname(),
|
|
39
|
+
inheritSearch: true,
|
|
40
|
+
hash: props.hash,
|
|
41
|
+
state: props.state
|
|
36
42
|
} : void 0;
|
|
37
43
|
},
|
|
38
44
|
get hreflang () {
|
|
39
|
-
return memo(()
|
|
40
|
-
},
|
|
41
|
-
get class () {
|
|
42
|
-
return props.class;
|
|
43
|
-
},
|
|
44
|
-
get activeProps () {
|
|
45
|
-
return props.activeProps;
|
|
46
|
-
},
|
|
47
|
-
get inactiveProps () {
|
|
48
|
-
return props.inactiveProps;
|
|
49
|
-
},
|
|
50
|
-
get activeOptions () {
|
|
51
|
-
return props.activeOptions;
|
|
52
|
-
},
|
|
53
|
-
get replace () {
|
|
54
|
-
return props.replace;
|
|
55
|
-
},
|
|
56
|
-
get preload () {
|
|
57
|
-
return props.preload;
|
|
45
|
+
return memo(()=>targetLanguage() === context.language())() ? void 0 : targetLanguage();
|
|
58
46
|
},
|
|
59
47
|
get children () {
|
|
60
48
|
return props.children;
|
|
61
49
|
}
|
|
62
50
|
}));
|
|
63
51
|
}
|
|
64
|
-
|
|
65
|
-
const context = __rspack_external_solid_js_0ac0db99.useContext(I18nContext);
|
|
66
|
-
const location = useLocation();
|
|
67
|
-
return ()=>canonicalPath(location().pathname, {
|
|
68
|
-
languages: [
|
|
69
|
-
...context.languages
|
|
70
|
-
],
|
|
71
|
-
localisedUrls: context.localisedUrls
|
|
72
|
-
}) === canonicalTarget;
|
|
73
|
-
}
|
|
74
|
-
export { LocalizedLink, useIsLocalizedActive };
|
|
52
|
+
export { LocalizedLink };
|
package/dist/esm/i18n/index.js
CHANGED
|
@@ -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/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"
|
package/dist/esm/manifest.js
CHANGED
|
@@ -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
|
}
|
|
@@ -2,7 +2,7 @@ import { Dynamic, createComponent } from "@solidjs/web";
|
|
|
2
2
|
import { DataProtocolError } from "@modern-js/renderer-core/data";
|
|
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
|
const routeScopes = new WeakMap();
|
|
7
7
|
const routerScopes = new WeakMap();
|
|
8
8
|
function assertManagedRouteData(route) {
|
|
@@ -14,6 +14,7 @@ function registerRouteCompletionScope(route, scope) {
|
|
|
14
14
|
routeScopes.set(route, scope);
|
|
15
15
|
}
|
|
16
16
|
const createApplicationRouter = (options)=>{
|
|
17
|
+
assertNativeSerializationOptions(options);
|
|
17
18
|
const scope = options.routeTree ? routeScopes.get(options.routeTree) : void 0;
|
|
18
19
|
if (!scope) assertManagedRouteData(options.routeTree);
|
|
19
20
|
if (scope && options.routeTree) registerPublicRouteDataOwner(options.routeTree, scope.hydrationOwner, scope.privateRoots);
|
|
@@ -75,9 +75,10 @@ function HeadElement(props) {
|
|
|
75
75
|
case "style":
|
|
76
76
|
{
|
|
77
77
|
const attrs = {
|
|
78
|
-
...props.attrs
|
|
79
|
-
innerHTML: "string" == typeof props.children ? props.children : void 0
|
|
78
|
+
...props.attrs
|
|
80
79
|
};
|
|
80
|
+
delete attrs.innerHTML;
|
|
81
|
+
if ("string" == typeof props.children) attrs.innerHTML = props.children;
|
|
81
82
|
element = (()=>{
|
|
82
83
|
var _el$ = getNextElement(_tmpl$);
|
|
83
84
|
spread(_el$, attrs, false);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createComponent, memo } from "@solidjs/web";
|
|
1
|
+
import { createComponent, 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";
|
|
@@ -47,17 +47,16 @@ function MatchesInner() {
|
|
|
47
47
|
return createComponent(NearestMatchContext, {
|
|
48
48
|
value: nearestMatch,
|
|
49
49
|
get children () {
|
|
50
|
-
return createComponent(CatchBoundary, {
|
|
50
|
+
return createComponent(CatchBoundary, mergeProps({
|
|
51
51
|
getResetKey: ()=>router.stores.matches.get(),
|
|
52
52
|
render: matchContent,
|
|
53
|
-
errorComponent: ErrorComponent
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
errorComponent: ErrorComponent
|
|
54
|
+
}, ()=>"production" !== process.env.NODE_ENV ? {
|
|
55
|
+
onCatch: (error)=>{
|
|
56
56
|
console.warn("Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!");
|
|
57
57
|
console.warn(`Warning: ${error.message || error.toString()}`);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
});
|
|
58
|
+
}
|
|
59
|
+
} : {}));
|
|
61
60
|
}
|
|
62
61
|
});
|
|
63
62
|
}
|
|
@@ -69,10 +68,18 @@ function useMatchRoute() {
|
|
|
69
68
|
router.stores.resolvedLocation.get();
|
|
70
69
|
router.stores.status.get();
|
|
71
70
|
return router.matchRoute(rest, {
|
|
72
|
-
pending
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
...void 0 !== pending ? {
|
|
72
|
+
pending
|
|
73
|
+
} : {},
|
|
74
|
+
...void 0 !== caseSensitive ? {
|
|
75
|
+
caseSensitive
|
|
76
|
+
} : {},
|
|
77
|
+
...void 0 !== fuzzy ? {
|
|
78
|
+
fuzzy
|
|
79
|
+
} : {},
|
|
80
|
+
...void 0 !== includeSearch ? {
|
|
81
|
+
includeSearch
|
|
82
|
+
} : {}
|
|
76
83
|
});
|
|
77
84
|
});
|
|
78
85
|
}
|
|
@@ -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,12 +2,13 @@ import { createComponent, 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";
|
|
9
9
|
const RouterContext = routerContext;
|
|
10
10
|
function RouterContextProvider({ router, children, ...rest }) {
|
|
11
|
+
assertNativeSerializationOptions(rest);
|
|
11
12
|
requireManagedPublicRouter(router);
|
|
12
13
|
if (Object.keys(rest).length > 0) __rspack_external_solid_js_0ac0db99.runWithOwner(null, ()=>{
|
|
13
14
|
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";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dynamic,
|
|
1
|
+
import { Dynamic, createComponent, getNextElement, insert, mergeProps, runHydrationEvents, scope, spread, template } from "@solidjs/web";
|
|
2
2
|
import { deepEqual, exactPathTest, functionalUpdate, getUrlScheme, hasKeys, isDangerousProtocol, preloadWarning, removeTrailingSlash } from "@tanstack/router-core";
|
|
3
3
|
import { isServer } from "@tanstack/router-core/isServer";
|
|
4
4
|
import { useHydrated } from "./ClientOnly.js";
|
|
@@ -237,8 +237,8 @@ function useLinkProps(options) {
|
|
|
237
237
|
configurable: true
|
|
238
238
|
});
|
|
239
239
|
const defineGetters = (getters)=>{
|
|
240
|
-
for (const key of Object.
|
|
241
|
-
get
|
|
240
|
+
for (const [key, get] of Object.entries(getters))Object.defineProperty(linkProps, key, {
|
|
241
|
+
get,
|
|
242
242
|
enumerable: true,
|
|
243
243
|
configurable: true
|
|
244
244
|
});
|
|
@@ -333,7 +333,6 @@ const Link = (props)=>{
|
|
|
333
333
|
]);
|
|
334
334
|
var _el$ = getNextElement(_tmpl$);
|
|
335
335
|
var _el$2 = _el$.firstChild;
|
|
336
|
-
claimElement(_el$2);
|
|
337
336
|
spread(_el$2, svgLinkProps, true);
|
|
338
337
|
insert(_el$2, scope(()=>children()));
|
|
339
338
|
runHydrationEvents();
|
|
@@ -341,7 +340,6 @@ const Link = (props)=>{
|
|
|
341
340
|
}
|
|
342
341
|
if (!local._asChild) {
|
|
343
342
|
var _el$3 = getNextElement(_tmpl$2);
|
|
344
|
-
claimElement(_el$3);
|
|
345
343
|
spread(_el$3, linkProps, true);
|
|
346
344
|
insert(_el$3, scope(()=>children()));
|
|
347
345
|
runHydrationEvents();
|
|
@@ -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);
|
|
File without changes
|
|
@@ -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;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { useMatch } from "./useMatch.js";
|
|
2
2
|
function useSearch(opts) {
|
|
3
3
|
return useMatch({
|
|
4
|
-
|
|
5
|
-
strict: opts.strict,
|
|
6
|
-
shouldThrow: opts.shouldThrow,
|
|
4
|
+
...opts,
|
|
7
5
|
select: (match)=>{
|
|
8
6
|
const search = match.search;
|
|
9
7
|
return opts.select ? opts.select(search) : search;
|