vike-solid 0.7.2 → 0.7.3-commit-704e0a7
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/+config.d.ts +12 -5
- package/dist/+config.js +12 -5
- package/dist/{Config-CVJUysUv.d.ts → Config-DOVdsmM1.d.ts} +11 -3
- package/dist/components/Config/Config-client.d.ts +2 -2
- package/dist/components/Config/Config-server.d.ts +2 -2
- package/dist/hooks/useConfig/useConfig-client.d.ts +2 -2
- package/dist/hooks/useConfig/useConfig-server.d.ts +2 -2
- package/dist/{renderer → integration}/onRenderClient.js +14 -8
- package/dist/{renderer → integration}/onRenderHtml.js +12 -8
- package/dist/vite-plugin-vike-solid.js +1 -1
- package/package.json +11 -10
package/dist/+config.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigEffect } from 'vike/types';
|
|
2
|
+
import './Config-DOVdsmM1.js';
|
|
2
3
|
import { JSX } from 'solid-js';
|
|
3
|
-
import './Config-CVJUysUv.js';
|
|
4
4
|
|
|
5
5
|
declare function ssrEffect({ configDefinedAt, configValue }: Parameters<ConfigEffect>[0]): ReturnType<ConfigEffect>;
|
|
6
6
|
|
|
@@ -13,13 +13,13 @@ declare global {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
declare const
|
|
16
|
+
declare const config: {
|
|
17
17
|
name: string;
|
|
18
18
|
require: {
|
|
19
19
|
vike: string;
|
|
20
20
|
};
|
|
21
|
-
onRenderHtml: "import:vike-solid/
|
|
22
|
-
onRenderClient: "import:vike-solid/
|
|
21
|
+
onRenderHtml: "import:vike-solid/__internal/integration/onRenderHtml:onRenderHtml";
|
|
22
|
+
onRenderClient: "import:vike-solid/__internal/integration/onRenderClient:onRenderClient";
|
|
23
23
|
clientRouting: true;
|
|
24
24
|
hydrationCanBeAborted: true;
|
|
25
25
|
passToClient: string[];
|
|
@@ -37,6 +37,13 @@ declare const _default: {
|
|
|
37
37
|
};
|
|
38
38
|
cumulative: true;
|
|
39
39
|
};
|
|
40
|
+
Wrapper: {
|
|
41
|
+
env: {
|
|
42
|
+
server: true;
|
|
43
|
+
client: true;
|
|
44
|
+
};
|
|
45
|
+
cumulative: true;
|
|
46
|
+
};
|
|
40
47
|
title: {
|
|
41
48
|
env: {
|
|
42
49
|
server: true;
|
|
@@ -105,4 +112,4 @@ declare const _default: {
|
|
|
105
112
|
};
|
|
106
113
|
};
|
|
107
114
|
|
|
108
|
-
export {
|
|
115
|
+
export { config };
|
package/dist/+config.js
CHANGED
|
@@ -19,15 +19,15 @@ function ssrEffect({
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
const config = {
|
|
23
23
|
name: "vike-solid",
|
|
24
24
|
require: {
|
|
25
|
-
vike: ">=0.4.
|
|
25
|
+
vike: ">=0.4.191"
|
|
26
26
|
},
|
|
27
27
|
// https://vike.dev/onRenderHtml
|
|
28
|
-
onRenderHtml: "import:vike-solid/
|
|
28
|
+
onRenderHtml: "import:vike-solid/__internal/integration/onRenderHtml:onRenderHtml",
|
|
29
29
|
// https://vike.dev/onRenderClient
|
|
30
|
-
onRenderClient: "import:vike-solid/
|
|
30
|
+
onRenderClient: "import:vike-solid/__internal/integration/onRenderClient:onRenderClient",
|
|
31
31
|
// https://vike.dev/clientRouting
|
|
32
32
|
clientRouting: true,
|
|
33
33
|
hydrationCanBeAborted: true,
|
|
@@ -47,6 +47,13 @@ var _config = {
|
|
|
47
47
|
},
|
|
48
48
|
cumulative: true
|
|
49
49
|
},
|
|
50
|
+
Wrapper: {
|
|
51
|
+
env: {
|
|
52
|
+
server: true,
|
|
53
|
+
client: true
|
|
54
|
+
},
|
|
55
|
+
cumulative: true
|
|
56
|
+
},
|
|
50
57
|
title: {
|
|
51
58
|
env: {
|
|
52
59
|
server: true,
|
|
@@ -115,4 +122,4 @@ var _config = {
|
|
|
115
122
|
}
|
|
116
123
|
};
|
|
117
124
|
|
|
118
|
-
export {
|
|
125
|
+
export { config };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { PageContextServer, PageContextClient, PageContext } from 'vike/types';
|
|
1
2
|
import { JSX, Component } from 'solid-js';
|
|
2
|
-
import { PageContext, PageContextServer, PageContextClient } from 'vike/types';
|
|
3
3
|
|
|
4
4
|
type TagAttributes = Record<string, string | number | boolean | undefined | null>;
|
|
5
5
|
|
|
@@ -28,6 +28,12 @@ declare global {
|
|
|
28
28
|
* https://vike.dev/Layout
|
|
29
29
|
*/
|
|
30
30
|
Layout?: Component;
|
|
31
|
+
/**
|
|
32
|
+
* A component wrapping the the root component `<Page>`.
|
|
33
|
+
*
|
|
34
|
+
* https://vike.dev/Wrapper
|
|
35
|
+
*/
|
|
36
|
+
Wrapper?: Component;
|
|
31
37
|
/**
|
|
32
38
|
* Set the page's tilte.
|
|
33
39
|
*
|
|
@@ -41,7 +47,7 @@ declare global {
|
|
|
41
47
|
*
|
|
42
48
|
* https://vike.dev/title
|
|
43
49
|
*/
|
|
44
|
-
title?: string | null | ((pageContext:
|
|
50
|
+
title?: string | null | ((pageContext: PageContext_) => string | null | undefined);
|
|
45
51
|
/**
|
|
46
52
|
* Set the page's description.
|
|
47
53
|
*
|
|
@@ -98,7 +104,7 @@ declare global {
|
|
|
98
104
|
*
|
|
99
105
|
* https://vike.dev/lang
|
|
100
106
|
*/
|
|
101
|
-
lang?: string | null | ((pageContext:
|
|
107
|
+
lang?: string | null | ((pageContext: PageContext_) => string | null | undefined);
|
|
102
108
|
/**
|
|
103
109
|
* Add tag attributes such as `<html class="dark">`.
|
|
104
110
|
*
|
|
@@ -140,6 +146,7 @@ declare global {
|
|
|
140
146
|
}
|
|
141
147
|
interface ConfigResolved {
|
|
142
148
|
Layout?: Array<Component>;
|
|
149
|
+
Wrapper?: Array<Component>;
|
|
143
150
|
Head?: Array<Head>;
|
|
144
151
|
bodyAttributes?: TagAttributes[];
|
|
145
152
|
htmlAttributes?: TagAttributes[];
|
|
@@ -147,6 +154,7 @@ declare global {
|
|
|
147
154
|
}
|
|
148
155
|
}
|
|
149
156
|
}
|
|
157
|
+
type PageContext_ = PageContext;
|
|
150
158
|
type Head = Component | JSX.Element;
|
|
151
159
|
type PickWithoutGetter<T, K extends keyof T> = {
|
|
152
160
|
[P in K]: Exclude<T[P], Function>;
|
|
@@ -3,6 +3,7 @@ import { i as includes, c as configsCumulative } from '../includes-B0OUVLz0.js';
|
|
|
3
3
|
import { PageContextProvider, usePageContext } from '../hooks/usePageContext.js';
|
|
4
4
|
import { createComputed, createComponent as createComponent$1 } from 'solid-js';
|
|
5
5
|
import { createStore, reconcile } from 'solid-js/store';
|
|
6
|
+
import { providePageContext } from 'vike/getPageContext';
|
|
6
7
|
import { a as applyHeadSettings } from '../applyHeadSettings-BwjKVYXB.js';
|
|
7
8
|
|
|
8
9
|
function isCallable(thing) {
|
|
@@ -31,7 +32,7 @@ function getPageElement(pageContext) {
|
|
|
31
32
|
const page = createComponent(PageContextProvider, {
|
|
32
33
|
pageContext: pageContext,
|
|
33
34
|
get children() {
|
|
34
|
-
return createComponent(
|
|
35
|
+
return createComponent(Wrapper, {
|
|
35
36
|
get children() {
|
|
36
37
|
return createComponent(Page, {});
|
|
37
38
|
}
|
|
@@ -40,23 +41,27 @@ function getPageElement(pageContext) {
|
|
|
40
41
|
});
|
|
41
42
|
return page;
|
|
42
43
|
}
|
|
43
|
-
function
|
|
44
|
+
function Wrapper(props) {
|
|
44
45
|
const pageContext = usePageContext();
|
|
45
|
-
const [
|
|
46
|
+
const [wrappers, setWrappers] = createStore([]);
|
|
46
47
|
createComputed(() => {
|
|
47
|
-
|
|
48
|
+
setWrappers(reconcile([
|
|
49
|
+
// Inner wrapping
|
|
50
|
+
...(pageContext.config.Layout || []),
|
|
51
|
+
// Outer wrapping
|
|
52
|
+
...(pageContext.config.Wrapper || [])]));
|
|
48
53
|
});
|
|
49
|
-
const
|
|
50
|
-
let item =
|
|
54
|
+
const renderWrappers = (i = 0) => {
|
|
55
|
+
let item = wrappers.at(-(i + 1));
|
|
51
56
|
if (!item) return props.children;
|
|
52
57
|
if (typeof item !== "function") item = Passthrough;
|
|
53
58
|
return createComponent$1(item, {
|
|
54
59
|
get children() {
|
|
55
|
-
return
|
|
60
|
+
return renderWrappers(i + 1);
|
|
56
61
|
}
|
|
57
62
|
});
|
|
58
63
|
};
|
|
59
|
-
return
|
|
64
|
+
return renderWrappers();
|
|
60
65
|
}
|
|
61
66
|
function Page() {
|
|
62
67
|
const pageContext = usePageContext();
|
|
@@ -74,6 +79,7 @@ async function callCumulativeHooks(values, pageContext) {
|
|
|
74
79
|
if (!values) return [];
|
|
75
80
|
const valuesPromises = values.map(val => {
|
|
76
81
|
if (typeof val === "function") {
|
|
82
|
+
providePageContext(pageContext);
|
|
77
83
|
// Hook
|
|
78
84
|
return val(pageContext);
|
|
79
85
|
} else {
|
|
@@ -31,7 +31,7 @@ function getPageElement(pageContext) {
|
|
|
31
31
|
const page = createComponent(PageContextProvider, {
|
|
32
32
|
pageContext: pageContext,
|
|
33
33
|
get children() {
|
|
34
|
-
return createComponent(
|
|
34
|
+
return createComponent(Wrapper, {
|
|
35
35
|
get children() {
|
|
36
36
|
return createComponent(Page, {});
|
|
37
37
|
}
|
|
@@ -40,23 +40,27 @@ function getPageElement(pageContext) {
|
|
|
40
40
|
});
|
|
41
41
|
return page;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function Wrapper(props) {
|
|
44
44
|
const pageContext = usePageContext();
|
|
45
|
-
const [
|
|
45
|
+
const [wrappers, setWrappers] = createStore([]);
|
|
46
46
|
createComputed(() => {
|
|
47
|
-
|
|
47
|
+
setWrappers(reconcile([
|
|
48
|
+
// Inner wrapping
|
|
49
|
+
...(pageContext.config.Layout || []),
|
|
50
|
+
// Outer wrapping
|
|
51
|
+
...(pageContext.config.Wrapper || [])]));
|
|
48
52
|
});
|
|
49
|
-
const
|
|
50
|
-
let item =
|
|
53
|
+
const renderWrappers = (i = 0) => {
|
|
54
|
+
let item = wrappers.at(-(i + 1));
|
|
51
55
|
if (!item) return props.children;
|
|
52
56
|
if (typeof item !== "function") item = Passthrough;
|
|
53
57
|
return createComponent$1(item, {
|
|
54
58
|
get children() {
|
|
55
|
-
return
|
|
59
|
+
return renderWrappers(i + 1);
|
|
56
60
|
}
|
|
57
61
|
});
|
|
58
62
|
};
|
|
59
|
-
return
|
|
63
|
+
return renderWrappers();
|
|
60
64
|
}
|
|
61
65
|
function Page() {
|
|
62
66
|
const pageContext = usePageContext();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vike-solid",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3-commit-704e0a7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "rollup -c rollup.config.js --watch",
|
|
@@ -15,25 +15,26 @@
|
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"solid-js": "^1.8.7",
|
|
18
|
-
"
|
|
18
|
+
"vite": ">=5.0.0",
|
|
19
|
+
"vike": ">=0.4.191"
|
|
19
20
|
},
|
|
20
21
|
"devDependencies": {
|
|
21
22
|
"@babel/core": "^7.25.2",
|
|
22
|
-
"@babel/preset-env": "^7.25.
|
|
23
|
+
"@babel/preset-env": "^7.25.4",
|
|
23
24
|
"@babel/preset-typescript": "^7.24.7",
|
|
24
25
|
"@brillout/release-me": "^0.4.0",
|
|
25
26
|
"@rollup/plugin-babel": "^6.0.4",
|
|
26
27
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
27
28
|
"@types/node": "^22.4.0",
|
|
28
29
|
"babel-preset-solid": "^1.8.19",
|
|
29
|
-
"bumpp": "^9.5.
|
|
30
|
-
"rollup": "^4.
|
|
30
|
+
"bumpp": "^9.5.2",
|
|
31
|
+
"rollup": "^4.21.0",
|
|
31
32
|
"rollup-plugin-dts": "^6.1.1",
|
|
32
33
|
"solid-js": "^1.8.21",
|
|
33
|
-
"tslib": "^2.
|
|
34
|
+
"tslib": "^2.7.0",
|
|
34
35
|
"typescript": "^5.5.4",
|
|
35
|
-
"vike": "^0.4.
|
|
36
|
-
"vite": "^5.4.
|
|
36
|
+
"vike": "^0.4.193",
|
|
37
|
+
"vite": "^5.4.2"
|
|
37
38
|
},
|
|
38
39
|
"exports": {
|
|
39
40
|
"./config": "./dist/+config.js",
|
|
@@ -53,8 +54,8 @@
|
|
|
53
54
|
"default": "./dist/components/Head/Head-server.js"
|
|
54
55
|
},
|
|
55
56
|
"./clientOnly": "./dist/helpers/clientOnly.js",
|
|
56
|
-
"./
|
|
57
|
-
"./
|
|
57
|
+
"./__internal/integration/onRenderHtml": "./dist/integration/onRenderHtml.js",
|
|
58
|
+
"./__internal/integration/onRenderClient": "./dist/integration/onRenderClient.js",
|
|
58
59
|
"./client": {
|
|
59
60
|
"types": "./client.d.ts"
|
|
60
61
|
}
|