@markless/router 0.4.0 → 0.6.0
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/create-server-entry-DaYssO9x.js +1331 -0
- package/dist/debug-channel-CewnC9fH.js +2 -0
- package/dist/{debug-channel-CSzo-Zj8.js → debug-channel-Di6SppZv.js} +36 -17
- package/dist/index-BjxpxRL7.d.ts +248 -0
- package/dist/index.d.ts +2 -212
- package/dist/index.js +108 -40
- package/dist/protocol-constants-B4WxrZAS.js +26 -0
- package/dist/request-locals-z3rJTizs.js +90 -0
- package/dist/route-href-CGooO_g6.js +18 -0
- package/dist/route-manifest-DMizh42B.js +456 -0
- package/dist/typescript-plugin.cjs +9 -6
- package/dist/typescript-plugin.d.ts +3 -11194
- package/dist/typescript-plugin.js +9 -6
- package/dist/vite/route-href.d.ts +2 -3
- package/dist/vite/route-href.js +1 -17
- package/dist/vite/runtime/create-route-discovery.d.ts +3 -4
- package/dist/vite/runtime/create-route-discovery.js +1 -1
- package/dist/vite/runtime/create-server-entry.d.ts +27 -5
- package/dist/vite/runtime/create-server-entry.js +2 -400
- package/dist/vite/runtime/mdx-route.d.ts +1116 -17
- package/dist/vite/runtime/mdx-route.js +1097 -31
- package/dist/vite.d.ts +10 -6
- package/dist/vite.js +965 -203
- package/package.json +7 -6
- package/src/vite/entries/client-entry.ts +10 -1
- package/src/vite/entries/fragment-entry.ts +797 -0
- package/src/vite/entries/resume-entry.ts +41 -7
- package/dist/request-files-C-0LLSsx.js +0 -232
- package/dist/route-manifest-DPgGIyrS.js +0 -186
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markless/router",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Markless router: client-side navigation with SSR streaming and build-time preload maps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -57,21 +57,22 @@
|
|
|
57
57
|
"provenance": true
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
+
"@tsrx/yuku": "0.2.0",
|
|
60
61
|
"@virtualstate/navigation": "1.0.1-alpha.212",
|
|
61
62
|
"hast-util-to-html": "^9.0.5",
|
|
62
63
|
"nitro": "3.0.260429-beta",
|
|
63
64
|
"pathe": "^2.0.3",
|
|
64
65
|
"satteri": "0.6.3",
|
|
65
66
|
"ufo": "^1.6.4",
|
|
66
|
-
"
|
|
67
|
-
"@markless/
|
|
68
|
-
"@markless/web": "0.4.0"
|
|
67
|
+
"@markless/bundler": "0.6.0",
|
|
68
|
+
"@markless/web": "0.6.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@markless/analyzer": "0.
|
|
71
|
+
"@markless/analyzer": "0.6.0"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"
|
|
74
|
+
"typescript": "^5.9.3",
|
|
75
|
+
"vite": "8.2.2"
|
|
75
76
|
},
|
|
76
77
|
"peerDependenciesMeta": {
|
|
77
78
|
"vite": {
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
startRouteUpdateRenderer,
|
|
11
11
|
} from '@markless/router';
|
|
12
12
|
import { preloadRouteModule } from 'virtual:markless-router/route-preloads';
|
|
13
|
+
import { documentNavigation, startLinkIntentPreloading } from 'virtual:markless-router/options';
|
|
13
14
|
|
|
14
15
|
const routeDiscovery = createRouteDiscovery(
|
|
15
16
|
import.meta.glob(['/pages/**/*.tsrx', '/pages/**/*.mdx'], {
|
|
@@ -20,8 +21,15 @@ const routeDiscovery = createRouteDiscovery(
|
|
|
20
21
|
export const pageModules = routeDiscovery.pageModuleLoaders;
|
|
21
22
|
export const routeFileIds = routeDiscovery.routeFileIds;
|
|
22
23
|
const routeManifest = buildRouteManifestFromFileIds(routeFileIds);
|
|
24
|
+
if (__MARKLESS_ROUTER_LINK_INTENT__ && documentNavigation === 'client') {
|
|
25
|
+
startLinkIntentPreloading(document, (url) => {
|
|
26
|
+
const match = matchRouteManifest(url.pathname, routeManifest);
|
|
27
|
+
if (match) preloadRouteModule(match.route.file);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
23
30
|
|
|
24
31
|
void __marklessRouterStartSpaNavigation({
|
|
32
|
+
documentNavigation,
|
|
25
33
|
pageModuleLoaders: pageModules,
|
|
26
34
|
preloadRouteModule,
|
|
27
35
|
routeFileIds,
|
|
@@ -35,7 +43,7 @@ export async function navigateMarklessRouterLink(input: {
|
|
|
35
43
|
}) {
|
|
36
44
|
const url = parseSameOriginUrl(input.href, window.location.href);
|
|
37
45
|
const match = url && matchRouteManifest(url.pathname, routeManifest);
|
|
38
|
-
if (!url || !match) {
|
|
46
|
+
if (!url || !match || (documentNavigation === 'document' && !url.hash.startsWith('#/'))) {
|
|
39
47
|
window.location.assign(input.href);
|
|
40
48
|
return;
|
|
41
49
|
}
|
|
@@ -43,6 +51,7 @@ export async function navigateMarklessRouterLink(input: {
|
|
|
43
51
|
startRouteUpdateRenderer(document);
|
|
44
52
|
preloadRouteModule(match.route.file);
|
|
45
53
|
await __marklessRouterStartSpaNavigation({
|
|
54
|
+
documentNavigation,
|
|
46
55
|
pageModuleLoaders: pageModules,
|
|
47
56
|
preloadRouteModule,
|
|
48
57
|
routeFileIds,
|