vike-lite-react 1.0.16 → 1.0.18
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/{PageContextProvider-DfE3nMiU.mjs → PageContextProvider-CTiW2Vsa.mjs} +2 -2
- package/dist/__internal/client/onRenderClient.mjs +1 -1
- package/dist/__internal/server/onRenderHtml.d.mts +2 -2
- package/dist/__internal/server/onRenderHtml.mjs +19 -25
- package/dist/{globalContext-6JEqyfKe.mjs → globalContext-CuAgMUAs.mjs} +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as PageContextReactContext } from "./globalContext-
|
|
1
|
+
import { t as PageContextReactContext } from "./globalContext-CuAgMUAs.mjs";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
//#region src/
|
|
3
|
+
//#region src/__internal/shared/PageContextProvider.tsx
|
|
4
4
|
function PageContextProvider({ value, children }) {
|
|
5
5
|
return /* @__PURE__ */ jsx(PageContextReactContext.Provider, {
|
|
6
6
|
value,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as PageContextProvider } from "../../PageContextProvider-
|
|
1
|
+
import { t as PageContextProvider } from "../../PageContextProvider-CTiW2Vsa.mjs";
|
|
2
2
|
import { Component, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { createRoot, hydrateRoot } from "react-dom/client";
|
|
4
4
|
import { matchRoute, stripBase } from "vike-lite/__internal/shared";
|
|
@@ -9,6 +9,6 @@ interface ReactRenderContext extends RenderContext {
|
|
|
9
9
|
}>;
|
|
10
10
|
hydration: boolean;
|
|
11
11
|
}
|
|
12
|
-
declare function onRenderHtml({ pageContext, Page, Head, Layout, pageTitleTag, serializedContext, assets, hydration }: ReactRenderContext):
|
|
12
|
+
declare function onRenderHtml({ pageContext, Page, Head, Layout, pageTitleTag, serializedContext, assets: { cssLinks, jsPreloads, entryClient }, hydration, nonce }: ReactRenderContext): any;
|
|
13
13
|
//#endregion
|
|
14
|
-
export {
|
|
14
|
+
export { onRenderHtml };
|
|
@@ -1,35 +1,29 @@
|
|
|
1
|
-
import { t as PageContextProvider } from "../../PageContextProvider-
|
|
1
|
+
import { t as PageContextProvider } from "../../PageContextProvider-CTiW2Vsa.mjs";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { renderToString } from "react-dom/server";
|
|
4
|
+
import { renderHtmlShell } from "vike-lite/__internal/server";
|
|
4
5
|
//#region src/__internal/server/onRenderHtml.tsx
|
|
5
|
-
function onRenderHtml({ pageContext, Page, Head, Layout, pageTitleTag, serializedContext, assets, hydration }) {
|
|
6
|
-
const { cssLinks, jsPreloads, entryClient } = assets;
|
|
6
|
+
function onRenderHtml({ pageContext, Page, Head, Layout, pageTitleTag, serializedContext, assets: { cssLinks, jsPreloads, entryClient }, hydration, nonce }) {
|
|
7
7
|
const providerValue = {
|
|
8
8
|
pageContext,
|
|
9
9
|
setPageContext: () => {}
|
|
10
10
|
};
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
value: providerValue,
|
|
28
|
-
children: Layout ? /* @__PURE__ */ jsx(Layout, { children: /* @__PURE__ */ jsx(Page, {}) }) : /* @__PURE__ */ jsx(Page, {})
|
|
29
|
-
})) : ""}</div>
|
|
30
|
-
<script type="module" src="${entryClient}"><\/script>
|
|
31
|
-
</body>
|
|
32
|
-
</html>`;
|
|
11
|
+
return renderHtmlShell({
|
|
12
|
+
pageTitleTag,
|
|
13
|
+
cssLinks,
|
|
14
|
+
jsPreloads,
|
|
15
|
+
headHtml: Head ? renderToString(/* @__PURE__ */ jsx(PageContextProvider, {
|
|
16
|
+
value: providerValue,
|
|
17
|
+
children: /* @__PURE__ */ jsx(Head, {})
|
|
18
|
+
})) : "",
|
|
19
|
+
appHtml: hydration ? renderToString(/* @__PURE__ */ jsx(PageContextProvider, {
|
|
20
|
+
value: providerValue,
|
|
21
|
+
children: Layout ? /* @__PURE__ */ jsx(Layout, { children: /* @__PURE__ */ jsx(Page, {}) }) : /* @__PURE__ */ jsx(Page, {})
|
|
22
|
+
})) : "",
|
|
23
|
+
serializedContext,
|
|
24
|
+
entryClient,
|
|
25
|
+
nonce
|
|
26
|
+
});
|
|
33
27
|
}
|
|
34
28
|
//#endregion
|
|
35
29
|
export { onRenderHtml };
|
package/dist/index.d.mts
CHANGED
|
@@ -12,7 +12,7 @@ declare function useHydrated(): boolean;
|
|
|
12
12
|
//#region src/hooks/useUrl.d.ts
|
|
13
13
|
declare function useUrl(): URL;
|
|
14
14
|
//#endregion
|
|
15
|
-
//#region src/
|
|
15
|
+
//#region src/shared/globalContext.d.ts
|
|
16
16
|
interface PageContextValue {
|
|
17
17
|
pageContext: PageContextClient;
|
|
18
18
|
setPageContext: (updater: (prev: PageContextClient) => PageContextClient) => void;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as PageContextReactContext } from "./globalContext-
|
|
1
|
+
import { t as PageContextReactContext } from "./globalContext-CuAgMUAs.mjs";
|
|
2
2
|
import { useCallback, useContext, useEffect, useMemo, useState } from "react";
|
|
3
3
|
//#region src/hooks/useData.tsx
|
|
4
4
|
function useData() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vike-lite-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"jsdom": "^29.1.1",
|
|
67
67
|
"react": "^19.2.7",
|
|
68
68
|
"react-dom": "^19.2.7",
|
|
69
|
-
"tsdown": "^0.22.
|
|
70
|
-
"vike-lite": "1.15.
|
|
69
|
+
"tsdown": "^0.22.11",
|
|
70
|
+
"vike-lite": "1.15.17",
|
|
71
71
|
"vite": "^8.1.5",
|
|
72
72
|
"vitest": "^4.1.10"
|
|
73
73
|
},
|