File tree Expand file tree Collapse file tree 8 files changed +2068
-1808
lines changed Expand file tree Collapse file tree 8 files changed +2068
-1808
lines changed Original file line number Diff line number Diff line change 1
1
import { Router , createRouter } from '@roxi/routify'
2
2
import routes from './routes.default.js'
3
3
4
+ // remove previous routers to avoid bumping router names (/path => /1/path)
5
+ globalThis . __routify . reset ( )
4
6
export const router = createRouter ( { routes} )
5
7
export { Router , routes }
Original file line number Diff line number Diff line change 1
1
2
2
import * as module from '../src/App.svelte'
3
- import { renderModule } from '@roxi/routify/tools'
3
+ import { renderModule } from '@roxi/routify/tools/ssr4.js '
4
4
import { map } from './route-map.js'
5
5
6
6
export const render = url => renderModule ( module , { url, routesMap : map } )
Original file line number Diff line number Diff line change 1
1
2
2
export const map = {
3
- default : ( ) => import ( './routes.default.js' ) . then ( m => m . default )
3
+ ' default' : ( ) => import ( './routes.default.js' ) . then ( m => m . default )
4
4
}
Original file line number Diff line number Diff line change 1
1
2
2
3
- export default {
3
+ export const routes = {
4
4
"meta" : { } ,
5
5
"id" : "_default" ,
6
- "_regex" : { } ,
7
- "_paramKeys" : { } ,
6
+ "name" : "" ,
8
7
"file" : {
9
8
"path" : "src/routes" ,
10
9
"dir" : "src" ,
@@ -18,8 +17,6 @@ export default {
18
17
{
19
18
"meta" : { } ,
20
19
"id" : "_default_Advice_svelte" ,
21
- "_regex" : { } ,
22
- "_paramKeys" : { } ,
23
20
"name" : "Advice" ,
24
21
"file" : {
25
22
"path" : "src/routes/Advice.svelte" ,
@@ -34,8 +31,6 @@ export default {
34
31
{
35
32
"meta" : { } ,
36
33
"id" : "_default_Detail_svelte" ,
37
- "_regex" : { } ,
38
- "_paramKeys" : { } ,
39
34
"name" : "Detail" ,
40
35
"file" : {
41
36
"path" : "src/routes/Detail.svelte" ,
@@ -50,8 +45,6 @@ export default {
50
45
{
51
46
"meta" : { } ,
52
47
"id" : "_default_Index_svelte" ,
53
- "_regex" : { } ,
54
- "_paramKeys" : { } ,
55
48
"name" : "Index" ,
56
49
"file" : {
57
50
"path" : "src/routes/Index.svelte" ,
@@ -66,10 +59,10 @@ export default {
66
59
{
67
60
"meta" : {
68
61
"dynamic" : true ,
69
- "dynamicSpread" : true
62
+ "dynamicSpread" : true ,
63
+ "order" : false ,
64
+ "inline" : false
70
65
} ,
71
- "_regex" : { } ,
72
- "_paramKeys" : { } ,
73
66
"name" : "[...404]" ,
74
67
"file" : {
75
68
"path" : ".routify/components/[...404].svelte" ,
@@ -82,4 +75,5 @@ export default {
82
75
"children" : [ ]
83
76
}
84
77
]
85
- }
78
+ }
79
+ export default routes
Original file line number Diff line number Diff line change @@ -7,12 +7,12 @@ appInstance.routeMaps = map
7
7
// We need to import the App module since a router is likely declared here. This saves us pre-creating the router in the preload step below.
8
8
import * as module from '../src/App.svelte'
9
9
10
- Promise . all ( [
10
+ const preloadPromise = Promise . all ( [
11
11
module . load ?. ( ) ,
12
12
// PreloadUrl parses the url and preloads each url chunk in a router that matches its name. So for '/hello;widget=/world',
13
13
// it will preload '/hello' in the default router and '/world' in the 'widget' router.
14
14
// If the respective routers don't exist, preloadUrl will use routesMap to pre-create a router and match it with the url chunk.
15
15
preloadUrl ( { routesMap : map } )
16
16
] )
17
17
18
- export const app = import ( '../src/main.js' )
18
+ export const app = preloadPromise . then ( ( ) => import ( '../src/main.js' ) )
Original file line number Diff line number Diff line change 8
8
"start" : " npm run dev" ,
9
9
"dev" : " vite" ,
10
10
"build" : " vite build" ,
11
- "release" : " npm run routify && vite build" ,
12
11
"preview" : " vite preview" ,
13
12
"routify" : " npx @roxi/routify build && cp ./src/components/404.svelte .routify/components/[...404].svelte" ,
14
13
"gen-sitemap" : " node scripts/gen-sitemap.js" ,
31
30
"tailwind-merge" : " ^2.2.2"
32
31
},
33
32
"devDependencies" : {
34
- "@roxi/routify" : " ^ 3.0.0-next.160" ,
33
+ "@roxi/routify" : " 3.0.0-next.160" ,
35
34
"@sveltejs/vite-plugin-svelte" : " ^2.0.2" ,
36
35
"@tailwindcss/typography" : " ^0.5.9" ,
37
36
"@tsconfig/svelte" : " ^3.0.0" ,
Original file line number Diff line number Diff line change 4
4
"version" : " 2.0.0" ,
5
5
"author" : " nicejade" ,
6
6
"scripts" : {
7
- "build:client" : " lerna run release --scope=client" ,
7
+ "build:client" : " lerna run build --scope=client" ,
8
8
"build:server" : " lerna run build --scope=server" ,
9
9
"build" : " npm run build:client && npm run build:server" ,
10
10
"start" : " lerna run deploy --scope=server" ,
You can’t perform that action at this time.
0 commit comments