@alignable/bifrost 0.0.39 → 0.1.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/chunk-2DSY3VFP.js +118 -0
- package/dist/chunk-2DSY3VFP.js.map +1 -0
- package/dist/chunk-5SP2QGEH.js +76 -0
- package/dist/chunk-5SP2QGEH.js.map +1 -0
- package/dist/chunk-ABLEI4J7.js +30 -0
- package/dist/chunk-ABLEI4J7.js.map +1 -0
- package/dist/{chunk-CXNEKD7R.js → chunk-K4H777XA.js} +2 -2
- package/dist/chunk-K4H777XA.js.map +1 -0
- package/dist/chunk-OXCN6F2S.js +10 -0
- package/dist/chunk-OXCN6F2S.js.map +1 -0
- package/dist/chunk-RSVASTEA.js +63 -0
- package/dist/chunk-RSVASTEA.js.map +1 -0
- package/dist/{proxy/pages/wrapped/onRenderHtml.js → chunk-SAMMNBO4.js} +14 -16
- package/dist/chunk-SAMMNBO4.js.map +1 -0
- package/dist/chunk-X2R7ODLQ.js +14 -0
- package/dist/chunk-X2R7ODLQ.js.map +1 -0
- package/dist/{chunk-4YPY5NIX.js → chunk-X3MUHPJ3.js} +18 -18
- package/dist/chunk-X3MUHPJ3.js.map +1 -0
- package/dist/index.d.ts +4 -5
- package/dist/index.js.map +1 -1
- package/dist/internal-837e7a40.d.ts +128 -0
- package/dist/renderer/+config.d.ts +60 -6
- package/dist/renderer/+config.js +40 -20
- package/dist/renderer/+config.js.map +1 -1
- package/dist/renderer/bifrost/onRenderClient.d.ts +9 -0
- package/dist/renderer/bifrost/onRenderClient.js +15 -0
- package/dist/renderer/bifrost/onRenderHtml.d.ts +20 -0
- package/dist/renderer/bifrost/onRenderHtml.js +13 -0
- package/dist/renderer/bifrost/onRenderHtml.js.map +1 -0
- package/dist/renderer/configs/bifrost.d.ts +50 -0
- package/dist/renderer/configs/bifrost.js +7 -0
- package/dist/renderer/configs/bifrost.js.map +1 -0
- package/dist/renderer/configs/wrapped.d.ts +25 -0
- package/dist/renderer/configs/wrapped.js +7 -0
- package/dist/renderer/configs/wrapped.js.map +1 -0
- package/dist/renderer/onBeforeRoute.d.ts +5 -4
- package/dist/renderer/onBeforeRoute.js +1 -3
- package/dist/renderer/onBeforeRoute.js.map +1 -1
- package/dist/renderer/onRenderClient.d.ts +4 -5
- package/dist/renderer/onRenderClient.js +16 -52
- package/dist/renderer/onRenderClient.js.map +1 -1
- package/dist/renderer/onRenderHtml.d.ts +21 -5
- package/dist/renderer/onRenderHtml.js +17 -63
- package/dist/renderer/onRenderHtml.js.map +1 -1
- package/dist/renderer/usePageContext.d.ts +3 -4
- package/dist/renderer/utils/PassthruLayout.d.ts +5 -0
- package/dist/renderer/utils/PassthruLayout.js +7 -0
- package/dist/renderer/utils/PassthruLayout.js.map +1 -0
- package/dist/renderer/utils/buildHead.d.ts +3 -4
- package/dist/renderer/{getConfigOrPageContext.d.ts → utils/getConfigOrPageContext.d.ts} +3 -4
- package/dist/renderer/utils/getConfigOrPageContext.js +7 -0
- package/dist/renderer/utils/getConfigOrPageContext.js.map +1 -0
- package/dist/renderer/wrapped/onRenderClient.d.ts +9 -0
- package/dist/renderer/wrapped/onRenderClient.js +13 -0
- package/dist/renderer/wrapped/onRenderClient.js.map +1 -0
- package/dist/renderer/wrapped/onRenderHtml.d.ts +25 -0
- package/dist/renderer/wrapped/onRenderHtml.js +12 -0
- package/dist/renderer/wrapped/onRenderHtml.js.map +1 -0
- package/package.json +9 -47
- package/dist/chunk-4YPY5NIX.js.map +0 -1
- package/dist/chunk-CXNEKD7R.js.map +0 -1
- package/dist/chunk-HZZHKVWB.js +0 -15
- package/dist/chunk-HZZHKVWB.js.map +0 -1
- package/dist/controller-16e58bbd.d.ts +0 -7
- package/dist/internal-44398797.d.ts +0 -109
- package/dist/proxy/pages/Page.d.ts +0 -3
- package/dist/proxy/pages/Page.js +0 -8
- package/dist/proxy/pages/Page.js.map +0 -1
- package/dist/proxy/pages/passthru/+config.d.ts +0 -8
- package/dist/proxy/pages/passthru/+config.js +0 -12
- package/dist/proxy/pages/passthru/+config.js.map +0 -1
- package/dist/proxy/pages/passthru/onRenderHtml.d.ts +0 -12
- package/dist/proxy/pages/passthru/onRenderHtml.js +0 -10
- package/dist/proxy/pages/passthru/onRenderHtml.js.map +0 -1
- package/dist/proxy/pages/wrapped/+config.d.ts +0 -25
- package/dist/proxy/pages/wrapped/+config.js +0 -19
- package/dist/proxy/pages/wrapped/+config.js.map +0 -1
- package/dist/proxy/pages/wrapped/onBeforeRender.d.ts +0 -24
- package/dist/proxy/pages/wrapped/onBeforeRender.js +0 -30
- package/dist/proxy/pages/wrapped/onBeforeRender.js.map +0 -1
- package/dist/proxy/pages/wrapped/onRenderClient.d.ts +0 -10
- package/dist/proxy/pages/wrapped/onRenderClient.js +0 -74
- package/dist/proxy/pages/wrapped/onRenderClient.js.map +0 -1
- package/dist/proxy/pages/wrapped/onRenderHtml.d.ts +0 -20
- package/dist/proxy/pages/wrapped/onRenderHtml.js.map +0 -1
- package/dist/proxy/pages/wrapped/restorationVisit/+config.d.ts +0 -24
- package/dist/proxy/pages/wrapped/restorationVisit/+config.js +0 -18
- package/dist/proxy/pages/wrapped/restorationVisit/+config.js.map +0 -1
- package/dist/proxy/pages/wrapped/restorationVisit/onRenderClient.d.ts +0 -10
- package/dist/proxy/pages/wrapped/restorationVisit/onRenderClient.js +0 -54
- package/dist/proxy/pages/wrapped/restorationVisit/onRenderClient.js.map +0 -1
- package/dist/proxy/pages/wrapped/restorationVisit/route.d.ts +0 -3
- package/dist/proxy/pages/wrapped/restorationVisit/route.js +0 -8
- package/dist/proxy/pages/wrapped/restorationVisit/route.js.map +0 -1
- package/dist/renderer/getConfigOrPageContext.js +0 -7
- /package/dist/renderer/{getConfigOrPageContext.js.map → bifrost/onRenderClient.js.map} +0 -0
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { e as Snapshot } from '../internal-837e7a40.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'vike/types';
|
|
4
|
+
import './configs/bifrost.js';
|
|
5
|
+
import './configs/wrapped.js';
|
|
2
6
|
|
|
3
7
|
declare const onBeforeRoute: () => {
|
|
4
8
|
pageContext: {
|
|
5
9
|
snapshot: Snapshot;
|
|
6
|
-
_pageId: string;
|
|
7
10
|
isBackwardNavigation?: undefined;
|
|
8
11
|
};
|
|
9
12
|
} | {
|
|
10
13
|
pageContext: {
|
|
11
14
|
isBackwardNavigation: boolean;
|
|
12
15
|
snapshot?: undefined;
|
|
13
|
-
_pageId?: undefined;
|
|
14
16
|
};
|
|
15
17
|
} | {
|
|
16
18
|
pageContext: {
|
|
17
19
|
snapshot?: undefined;
|
|
18
|
-
_pageId?: undefined;
|
|
19
20
|
isBackwardNavigation?: undefined;
|
|
20
21
|
};
|
|
21
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../renderer/onBeforeRoute.ts"],"sourcesContent":["// do NOT import turbolinks in this file. It is used on server side.\n\nconst onBeforeRoute = () => {\n if (typeof window !== \"undefined\") {\n const Turbolinks = window.Turbolinks;\n\n const currentVisit = Turbolinks.controller.currentVisit;\n if (!currentVisit || currentVisit.state === \"completed\") {\n // old/nonexistent currentVisit means VPS is doing history navigation. Ideally we might turn off VPS' onpopstate listener.\n const snapshot = Turbolinks.controller.getCachedSnapshotForLocation(\n window.location.href\n );\n Turbolinks.controller.historyPoppedToLocationWithRestorationIdentifier(\n window.location.href,\n \"\"\n );\n\n if (!!snapshot) {\n return {\n pageContext: {\n snapshot,\n
|
|
1
|
+
{"version":3,"sources":["../../renderer/onBeforeRoute.ts"],"sourcesContent":["// do NOT import turbolinks in this file. It is used on server side.\n\nconst onBeforeRoute = () => {\n if (typeof window !== \"undefined\") {\n const Turbolinks = window.Turbolinks;\n\n const currentVisit = Turbolinks.controller.currentVisit;\n if (!currentVisit || currentVisit.state === \"completed\") {\n // old/nonexistent currentVisit means VPS is doing history navigation. Ideally we might turn off VPS' onpopstate listener.\n const snapshot = Turbolinks.controller.getCachedSnapshotForLocation(\n window.location.href\n );\n Turbolinks.controller.historyPoppedToLocationWithRestorationIdentifier(\n window.location.href,\n \"\"\n );\n\n if (!!snapshot) {\n return {\n pageContext: {\n snapshot,\n },\n };\n } else {\n return {\n pageContext: { isBackwardNavigation: true },\n };\n }\n }\n }\n return { pageContext: {} };\n};\n\nexport default onBeforeRoute;\n"],"mappings":";AAEA,IAAM,gBAAgB,MAAM;AAC1B,MAAI,OAAO,WAAW,aAAa;AACjC,UAAM,aAAa,OAAO;AAE1B,UAAM,eAAe,WAAW,WAAW;AAC3C,QAAI,CAAC,gBAAgB,aAAa,UAAU,aAAa;AAEvD,YAAM,WAAW,WAAW,WAAW;AAAA,QACrC,OAAO,SAAS;AAAA,MAClB;AACA,iBAAW,WAAW;AAAA,QACpB,OAAO,SAAS;AAAA,QAChB;AAAA,MACF;AAEA,UAAI,CAAC,CAAC,UAAU;AACd,eAAO;AAAA,UACL,aAAa;AAAA,YACX;AAAA,UACF;AAAA,QACF;AAAA,MACF,OAAO;AACL,eAAO;AAAA,UACL,aAAa,EAAE,sBAAsB,KAAK;AAAA,QAC5C;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACA,SAAO,EAAE,aAAa,CAAC,EAAE;AAC3B;AAEA,IAAO,wBAAQ;","names":[]}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { f as PageContextNoProxyClient, g as PageContextProxyClient } from '../internal-837e7a40.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'vike/types';
|
|
4
|
-
import '
|
|
5
|
-
import './
|
|
6
|
-
import '../controller-16e58bbd.js';
|
|
4
|
+
import './configs/bifrost.js';
|
|
5
|
+
import './configs/wrapped.js';
|
|
7
6
|
|
|
8
|
-
declare function onRenderClient(pageContext: PageContextNoProxyClient): Promise<void>;
|
|
7
|
+
declare function onRenderClient(pageContext: PageContextNoProxyClient | PageContextProxyClient): Promise<void>;
|
|
9
8
|
|
|
10
9
|
export { onRenderClient as default };
|
|
@@ -1,68 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../chunk-
|
|
2
|
+
wrappedOnRenderClient
|
|
3
|
+
} from "../chunk-2DSY3VFP.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from "../chunk-4YPY5NIX.js";
|
|
5
|
+
bifrostOnRenderClient
|
|
6
|
+
} from "../chunk-RSVASTEA.js";
|
|
8
7
|
import {
|
|
9
|
-
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
} from "../chunk-CXNEKD7R.js";
|
|
8
|
+
Turbolinks
|
|
9
|
+
} from "../chunk-X3MUHPJ3.js";
|
|
10
|
+
import "../chunk-OXCN6F2S.js";
|
|
11
|
+
import "../chunk-RQ34EW7E.js";
|
|
12
|
+
import "../chunk-JHLK62FM.js";
|
|
13
|
+
import "../chunk-VYXAWOXV.js";
|
|
14
|
+
import "../chunk-K4H777XA.js";
|
|
17
15
|
import "../chunk-PESUYCE4.js";
|
|
18
16
|
import "../chunk-IYGONC4I.js";
|
|
19
17
|
import "../chunk-EYYCKU6F.js";
|
|
20
18
|
|
|
21
19
|
// renderer/onRenderClient.tsx
|
|
22
|
-
import React from "react";
|
|
23
|
-
import { createRoot } from "react-dom/client";
|
|
24
20
|
Turbolinks.start();
|
|
25
|
-
var PassThruLayout = ({
|
|
26
|
-
children
|
|
27
|
-
}) => /* @__PURE__ */ React.createElement(React.Fragment, null, children);
|
|
28
21
|
async function onRenderClient(pageContext) {
|
|
29
|
-
if (pageContext.redirectTo) {
|
|
22
|
+
if ("redirectTo" in pageContext && pageContext.redirectTo) {
|
|
30
23
|
Turbolinks.visit(pageContext.redirectTo);
|
|
31
24
|
return;
|
|
32
25
|
}
|
|
33
|
-
if (pageContext.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const { Page, pageProps } = pageContext;
|
|
38
|
-
const { Layout = PassThruLayout } = pageContext.config;
|
|
39
|
-
const layoutProps = getPageContextOrConfig(pageContext, "layoutProps") || {};
|
|
40
|
-
const bodyAttrs = getPageContextOrConfig(pageContext, "bodyAttrs") || [];
|
|
41
|
-
if (!Page)
|
|
42
|
-
throw new Error("Client-side render() hook expects Page to be exported");
|
|
43
|
-
const page = /* @__PURE__ */ React.createElement(PageShell, { pageContext }, /* @__PURE__ */ React.createElement(Layout, { ...layoutProps }, /* @__PURE__ */ React.createElement(Page, { ...pageProps })));
|
|
44
|
-
if (pageContext.isHydration) {
|
|
45
|
-
await runClientInit(pageContext.configEntries);
|
|
46
|
-
renderReact(page, pageContext.isHydration);
|
|
47
|
-
} else {
|
|
48
|
-
const head = document.createElement("head");
|
|
49
|
-
createRoot(head).render(
|
|
50
|
-
documentPropsToReact(
|
|
51
|
-
getPageContextOrConfig(pageContext, "documentProps") || {}
|
|
52
|
-
)
|
|
53
|
-
);
|
|
54
|
-
pageContext.config.scripts?.forEach((s) => {
|
|
55
|
-
head.insertAdjacentHTML("beforeend", s);
|
|
56
|
-
});
|
|
57
|
-
requestAnimationFrame(() => {
|
|
58
|
-
Turbolinks._vpsOnRenderClient(head, false, false, () => {
|
|
59
|
-
document.body.getAttributeNames().forEach((n) => document.body.removeAttribute(n));
|
|
60
|
-
bodyAttrs.forEach(
|
|
61
|
-
({ name, value }) => document.body.setAttribute(name, value)
|
|
62
|
-
);
|
|
63
|
-
renderReact(page, pageContext.isHydration);
|
|
64
|
-
});
|
|
65
|
-
});
|
|
26
|
+
if (pageContext.config.proxyMode === "wrapped") {
|
|
27
|
+
return await wrappedOnRenderClient(pageContext);
|
|
28
|
+
} else if (pageContext.config.proxyMode === false) {
|
|
29
|
+
return await bifrostOnRenderClient(pageContext);
|
|
66
30
|
}
|
|
67
31
|
}
|
|
68
32
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../renderer/onRenderClient.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../renderer/onRenderClient.tsx"],"sourcesContent":["import {\n PageContextNoProxyClient,\n PageContextProxyClient,\n} from \"../types/internal.js\";\nimport { Turbolinks } from \"../lib/turbolinks/index.js\";\nimport { wrappedOnRenderClient } from \"./wrapped/onRenderClient.js\";\nimport { bifrostOnRenderClient } from \"./bifrost/onRenderClient.js\";\n\nTurbolinks.start();\n\nexport default async function onRenderClient(\n pageContext: PageContextNoProxyClient | PageContextProxyClient\n) {\n if (\"redirectTo\" in pageContext && pageContext.redirectTo) {\n Turbolinks.visit(pageContext.redirectTo);\n return;\n }\n if (pageContext.config.proxyMode === \"wrapped\") {\n return await wrappedOnRenderClient(pageContext as PageContextProxyClient);\n } else if (pageContext.config.proxyMode === false) {\n return await bifrostOnRenderClient(pageContext as PageContextNoProxyClient);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAQA,WAAW,MAAM;AAEjB,eAAO,eACL,aACA;AACA,MAAI,gBAAgB,eAAe,YAAY,YAAY;AACzD,eAAW,MAAM,YAAY,UAAU;AACvC;AAAA,EACF;AACA,MAAI,YAAY,OAAO,cAAc,WAAW;AAC9C,WAAO,MAAM,sBAAsB,WAAqC;AAAA,EAC1E,WAAW,YAAY,OAAO,cAAc,OAAO;AACjD,WAAO,MAAM,sBAAsB,WAAuC;AAAA,EAC5E;AACF;","names":[]}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
+
import { h as PageContextNoProxyServer, i as PageContextProxyServer, a as AugmentMe } from '../internal-837e7a40.js';
|
|
1
2
|
import * as vike_dist_esm_node_runtime_html_renderHtml_js from 'vike/dist/esm/node/runtime/html/renderHtml.js';
|
|
2
|
-
import { f as PageContextNoProxyServer } from '../internal-44398797.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'vike/types';
|
|
5
|
-
import '
|
|
6
|
-
import './
|
|
7
|
-
import '../controller-16e58bbd.js';
|
|
5
|
+
import './configs/bifrost.js';
|
|
6
|
+
import './configs/wrapped.js';
|
|
8
7
|
|
|
9
|
-
declare function onRenderHtml(pageContext: PageContextNoProxyServer): Promise<{
|
|
8
|
+
declare function onRenderHtml(pageContext: PageContextNoProxyServer | PageContextProxyServer): Promise<{
|
|
10
9
|
pageContext: {
|
|
11
10
|
redirectTo: string;
|
|
12
11
|
};
|
|
@@ -16,6 +15,23 @@ declare function onRenderHtml(pageContext: PageContextNoProxyServer): Promise<{
|
|
|
16
15
|
pageContext: {
|
|
17
16
|
redirectTo?: undefined;
|
|
18
17
|
};
|
|
18
|
+
} | {
|
|
19
|
+
documentHtml: string;
|
|
20
|
+
pageContext: {
|
|
21
|
+
layout?: undefined;
|
|
22
|
+
layoutProps?: undefined;
|
|
23
|
+
};
|
|
24
|
+
} | {
|
|
25
|
+
documentHtml: vike_dist_esm_node_runtime_html_renderHtml_js.TemplateWrapped;
|
|
26
|
+
pageContext: {
|
|
27
|
+
layout: string;
|
|
28
|
+
layoutProps: AugmentMe.LayoutProps;
|
|
29
|
+
};
|
|
30
|
+
} | {
|
|
31
|
+
documentHtml?: undefined;
|
|
32
|
+
pageContext?: undefined;
|
|
33
|
+
} | {
|
|
34
|
+
pageContext: {};
|
|
19
35
|
}>;
|
|
20
36
|
|
|
21
37
|
export { onRenderHtml as default };
|
|
@@ -1,75 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../chunk-
|
|
2
|
+
wrappedOnRenderHtml
|
|
3
|
+
} from "../chunk-SAMMNBO4.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
bifrostOnRenderHtml
|
|
6
|
+
} from "../chunk-5SP2QGEH.js";
|
|
7
|
+
import "../chunk-RQ34EW7E.js";
|
|
8
|
+
import "../chunk-JHLK62FM.js";
|
|
9
|
+
import "../chunk-VYXAWOXV.js";
|
|
10
|
+
import "../chunk-K4H777XA.js";
|
|
10
11
|
import "../chunk-PESUYCE4.js";
|
|
11
12
|
import "../chunk-IYGONC4I.js";
|
|
12
13
|
import "../chunk-EYYCKU6F.js";
|
|
13
14
|
|
|
14
15
|
// renderer/onRenderHtml.tsx
|
|
15
|
-
import ReactDOMServer from "react-dom/server";
|
|
16
|
-
import React from "react";
|
|
17
|
-
import { escapeInject, dangerouslySkipEscape } from "vike/server";
|
|
18
16
|
async function onRenderHtml(pageContext) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
switch (pageContext.config.proxyMode) {
|
|
18
|
+
case "wrapped":
|
|
19
|
+
return await wrappedOnRenderHtml(pageContext);
|
|
20
|
+
case "passthru":
|
|
21
|
+
return {
|
|
22
|
+
pageContext: {}
|
|
23
|
+
};
|
|
24
|
+
default:
|
|
25
|
+
return await bifrostOnRenderHtml(pageContext);
|
|
26
26
|
}
|
|
27
|
-
const { Layout } = pageContext.config;
|
|
28
|
-
const layoutProps = getPageContextOrConfig(pageContext, "layoutProps") || {};
|
|
29
|
-
if (!Page)
|
|
30
|
-
throw new Error("Server-side render() hook expects Page to be exported");
|
|
31
|
-
if (!Layout)
|
|
32
|
-
throw new Error("Server-side render() hook expects Layout to be exported");
|
|
33
|
-
const pageHtml = ReactDOMServer.renderToString(
|
|
34
|
-
/* @__PURE__ */ React.createElement(PageShell, { pageContext }, /* @__PURE__ */ React.createElement(Layout, { ...layoutProps }, /* @__PURE__ */ React.createElement(Page, { ...pageProps })))
|
|
35
|
-
);
|
|
36
|
-
const headHtml = ReactDOMServer.renderToString(
|
|
37
|
-
documentPropsToReact(
|
|
38
|
-
getPageContextOrConfig(pageContext, "documentProps") || {}
|
|
39
|
-
)
|
|
40
|
-
);
|
|
41
|
-
const bodyAttrs = getPageContextOrConfig(pageContext, "bodyAttrs") || [];
|
|
42
|
-
const { favicon } = pageContext.config;
|
|
43
|
-
const faviconTag = !favicon ? "" : escapeInject`<link rel="icon" href="${favicon}" />`;
|
|
44
|
-
const documentHtml = escapeInject`<!DOCTYPE html>
|
|
45
|
-
<html lang="en">
|
|
46
|
-
<head>
|
|
47
|
-
${faviconTag}
|
|
48
|
-
${dangerouslySkipEscape(headHtml)}
|
|
49
|
-
${dangerouslySkipEscape(
|
|
50
|
-
Object.values(pageContext.config.scripts || {}).join("")
|
|
51
|
-
)}
|
|
52
|
-
${dangerouslySkipEscape(`<script>
|
|
53
|
-
window.Turbolinks = {controller:{restorationIdentifier: ''}};
|
|
54
|
-
addEventListener("DOMContentLoaded", () => {
|
|
55
|
-
const event = new Event("turbolinks:load", { bubbles: true, cancelable: true });
|
|
56
|
-
event.data = {url: window.location.href};
|
|
57
|
-
document.dispatchEvent(event);
|
|
58
|
-
})
|
|
59
|
-
</script>`)}
|
|
60
|
-
</head>
|
|
61
|
-
<body ${dangerouslySkipEscape(
|
|
62
|
-
bodyAttrs.map(({ name, value }) => `${name}="${value}"`).join(" ")
|
|
63
|
-
)}>
|
|
64
|
-
<div id="page-view">${dangerouslySkipEscape(pageHtml)}</div>
|
|
65
|
-
</body>
|
|
66
|
-
</html>`;
|
|
67
|
-
return {
|
|
68
|
-
documentHtml,
|
|
69
|
-
pageContext: {
|
|
70
|
-
// We can add some `pageContext` here, which is useful if we want to do page redirection https://vike.com/page-redirection
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
27
|
}
|
|
74
28
|
export {
|
|
75
29
|
onRenderHtml as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../renderer/onRenderHtml.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../renderer/onRenderHtml.tsx"],"sourcesContent":["import {\n PageContextNoProxyServer,\n PageContextProxyServer,\n} from \"../types/internal.js\";\nimport { bifrostOnRenderHtml } from \"./bifrost/onRenderHtml\";\nimport { wrappedOnRenderHtml } from \"./wrapped/onRenderHtml\";\n\nexport default async function onRenderHtml(\n pageContext: PageContextNoProxyServer | PageContextProxyServer\n) {\n switch (pageContext.config.proxyMode) {\n case \"wrapped\":\n return await wrappedOnRenderHtml(pageContext as PageContextProxyServer);\n case \"passthru\":\n return {\n pageContext: {},\n };\n default:\n return await bifrostOnRenderHtml(pageContext as PageContextNoProxyServer);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAOA,eAAO,aACL,aACA;AACA,UAAQ,YAAY,OAAO,WAAW;AAAA,IACpC,KAAK;AACH,aAAO,MAAM,oBAAoB,WAAqC;AAAA,IACxE,KAAK;AACH,aAAO;AAAA,QACL,aAAa,CAAC;AAAA,MAChB;AAAA,IACF;AACE,aAAO,MAAM,oBAAoB,WAAuC;AAAA,EAC5E;AACF;","names":[]}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { c as PageContext } from '../internal-
|
|
2
|
+
import { c as PageContext } from '../internal-837e7a40.js';
|
|
3
3
|
import 'vike/types';
|
|
4
|
-
import '
|
|
5
|
-
import './
|
|
6
|
-
import '../controller-16e58bbd.js';
|
|
4
|
+
import './configs/bifrost.js';
|
|
5
|
+
import './configs/wrapped.js';
|
|
7
6
|
|
|
8
7
|
declare function PageContextProvider({ pageContext, children, }: {
|
|
9
8
|
pageContext: PageContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { D as DocumentProps } from '../../internal-
|
|
2
|
+
import { D as DocumentProps } from '../../internal-837e7a40.js';
|
|
3
3
|
import 'vike/types';
|
|
4
|
-
import '
|
|
5
|
-
import '../
|
|
6
|
-
import '../../controller-16e58bbd.js';
|
|
4
|
+
import '../configs/bifrost.js';
|
|
5
|
+
import '../configs/wrapped.js';
|
|
7
6
|
|
|
8
7
|
declare function documentPropsToReact({ title, description, viewport, metaTags, alternates, }: DocumentProps): React.ReactElement;
|
|
9
8
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { j as PageContextNoProxy } from '../../internal-837e7a40.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'vike/types';
|
|
4
|
-
import '../
|
|
5
|
-
import '
|
|
6
|
-
import '../controller-16e58bbd.js';
|
|
4
|
+
import '../configs/bifrost.js';
|
|
5
|
+
import '../configs/wrapped.js';
|
|
7
6
|
|
|
8
7
|
type ConfigOrContext = PageContextNoProxy | PageContextNoProxy["config"];
|
|
9
8
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { g as PageContextProxyClient } from '../../internal-837e7a40.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'vike/types';
|
|
4
|
+
import '../configs/bifrost.js';
|
|
5
|
+
import '../configs/wrapped.js';
|
|
6
|
+
|
|
7
|
+
declare function wrappedOnRenderClient(pageContext: PageContextProxyClient): Promise<void>;
|
|
8
|
+
|
|
9
|
+
export { wrappedOnRenderClient };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
wrappedOnRenderClient
|
|
3
|
+
} from "../../chunk-2DSY3VFP.js";
|
|
4
|
+
import "../../chunk-X3MUHPJ3.js";
|
|
5
|
+
import "../../chunk-RQ34EW7E.js";
|
|
6
|
+
import "../../chunk-JHLK62FM.js";
|
|
7
|
+
import "../../chunk-PESUYCE4.js";
|
|
8
|
+
import "../../chunk-IYGONC4I.js";
|
|
9
|
+
import "../../chunk-EYYCKU6F.js";
|
|
10
|
+
export {
|
|
11
|
+
wrappedOnRenderClient
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=onRenderClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { i as PageContextProxyServer, a as AugmentMe } from '../../internal-837e7a40.js';
|
|
2
|
+
import * as vike_dist_esm_node_runtime_html_renderHtml_js from 'vike/dist/esm/node/runtime/html/renderHtml.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import 'vike/types';
|
|
5
|
+
import '../configs/bifrost.js';
|
|
6
|
+
import '../configs/wrapped.js';
|
|
7
|
+
|
|
8
|
+
declare function wrappedOnRenderHtml(pageContext: PageContextProxyServer): Promise<{
|
|
9
|
+
documentHtml: string;
|
|
10
|
+
pageContext: {
|
|
11
|
+
layout?: undefined;
|
|
12
|
+
layoutProps?: undefined;
|
|
13
|
+
};
|
|
14
|
+
} | {
|
|
15
|
+
documentHtml: vike_dist_esm_node_runtime_html_renderHtml_js.TemplateWrapped;
|
|
16
|
+
pageContext: {
|
|
17
|
+
layout: string;
|
|
18
|
+
layoutProps: AugmentMe.LayoutProps;
|
|
19
|
+
};
|
|
20
|
+
} | {
|
|
21
|
+
documentHtml?: undefined;
|
|
22
|
+
pageContext?: undefined;
|
|
23
|
+
}>;
|
|
24
|
+
|
|
25
|
+
export { wrappedOnRenderHtml };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
wrappedOnRenderHtml
|
|
3
|
+
} from "../../chunk-SAMMNBO4.js";
|
|
4
|
+
import "../../chunk-RQ34EW7E.js";
|
|
5
|
+
import "../../chunk-JHLK62FM.js";
|
|
6
|
+
import "../../chunk-PESUYCE4.js";
|
|
7
|
+
import "../../chunk-IYGONC4I.js";
|
|
8
|
+
import "../../chunk-EYYCKU6F.js";
|
|
9
|
+
export {
|
|
10
|
+
wrappedOnRenderHtml
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=onRenderHtml.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alignable/bifrost",
|
|
3
3
|
"repository": "https://github.com/Alignable/bifrost.git",
|
|
4
|
-
"version": "0.0
|
|
4
|
+
"version": "0.1.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
|
-
"./
|
|
8
|
+
"./config": {
|
|
9
9
|
"types": "./dist/renderer/+config.d.ts",
|
|
10
10
|
"default": "./dist/renderer/+config.js"
|
|
11
11
|
},
|
|
@@ -21,46 +21,6 @@
|
|
|
21
21
|
"types": "./dist/renderer/onBeforeRoute.d.ts",
|
|
22
22
|
"default": "./dist/renderer/onBeforeRoute.js"
|
|
23
23
|
},
|
|
24
|
-
"./proxy/pages/Page": {
|
|
25
|
-
"types": "./dist/proxy/pages/Page.d.ts",
|
|
26
|
-
"default": "./dist/proxy/pages/Page.js"
|
|
27
|
-
},
|
|
28
|
-
"./proxy/pages/wrapped/+config": {
|
|
29
|
-
"types": "./dist/proxy/pages/wrapped/+config.d.ts",
|
|
30
|
-
"default": "./dist/proxy/pages/wrapped/+config.js"
|
|
31
|
-
},
|
|
32
|
-
"./proxy/pages/wrapped/onRenderClient": {
|
|
33
|
-
"types": "./dist/proxy/pages/wrapped/onRenderClient.d.ts",
|
|
34
|
-
"default": "./dist/proxy/pages/wrapped/onRenderClient.js"
|
|
35
|
-
},
|
|
36
|
-
"./proxy/pages/wrapped/onRenderHtml": {
|
|
37
|
-
"types": "./dist/proxy/pages/wrapped/onRenderHtml.d.ts",
|
|
38
|
-
"default": "./dist/proxy/pages/wrapped/onRenderHtml.js"
|
|
39
|
-
},
|
|
40
|
-
"./proxy/pages/wrapped/onBeforeRender": {
|
|
41
|
-
"types": "./dist/proxy/pages/wrapped/onBeforeRender.d.ts",
|
|
42
|
-
"default": "./dist/proxy/pages/wrapped/onBeforeRender.js"
|
|
43
|
-
},
|
|
44
|
-
"./proxy/pages/wrapped/restorationVisit/+config": {
|
|
45
|
-
"types": "./dist/proxy/pages/wrapped/restorationVisit/+config.d.ts",
|
|
46
|
-
"default": "./dist/proxy/pages/wrapped/restorationVisit/+config.js"
|
|
47
|
-
},
|
|
48
|
-
"./proxy/pages/wrapped/restorationVisit/route": {
|
|
49
|
-
"types": "./dist/proxy/pages/wrapped/restorationVisit/route.d.ts",
|
|
50
|
-
"default": "./dist/proxy/pages/wrapped/restorationVisit/route.js"
|
|
51
|
-
},
|
|
52
|
-
"./proxy/pages/wrapped/restorationVisit/onRenderClient": {
|
|
53
|
-
"types": "./dist/proxy/pages/wrapped/restorationVisit/onRenderClient.d.ts",
|
|
54
|
-
"default": "./dist/proxy/pages/wrapped/restorationVisit/onRenderClient.js"
|
|
55
|
-
},
|
|
56
|
-
"./proxy/pages/passthru/+config": {
|
|
57
|
-
"types": "./dist/proxy/pages/passthru/+config.d.ts",
|
|
58
|
-
"default": "./dist/proxy/pages/passthru/+config.js"
|
|
59
|
-
},
|
|
60
|
-
"./proxy/pages/passthru/onRenderHtml": {
|
|
61
|
-
"types": "./dist/proxy/pages/passthru/onRenderHtml.d.ts",
|
|
62
|
-
"default": "./dist/proxy/pages/passthru/onRenderHtml.js"
|
|
63
|
-
},
|
|
64
24
|
".": {
|
|
65
25
|
"types": "./dist/index.d.ts",
|
|
66
26
|
"default": "./dist/index.js"
|
|
@@ -69,8 +29,10 @@
|
|
|
69
29
|
},
|
|
70
30
|
"typesVersions": {
|
|
71
31
|
"*": {
|
|
72
|
-
"
|
|
73
|
-
"./dist
|
|
32
|
+
"config": [
|
|
33
|
+
"./dist/renderer/+config.d.ts"
|
|
34
|
+
],
|
|
35
|
+
".": [
|
|
74
36
|
"./dist/index.d.ts"
|
|
75
37
|
]
|
|
76
38
|
}
|
|
@@ -91,14 +53,14 @@
|
|
|
91
53
|
"react-dom": "^18.x.x",
|
|
92
54
|
"tough-cookie": "^4.1.2",
|
|
93
55
|
"uuid": "^9.0.0",
|
|
94
|
-
"vike": "0.4.
|
|
56
|
+
"vike": "0.4.193"
|
|
95
57
|
},
|
|
96
58
|
"peerDependencies": {
|
|
97
59
|
"jsdom": "^22.1.0",
|
|
98
60
|
"react": "^18.x.x",
|
|
99
61
|
"react-dom": "^18.x.x",
|
|
100
62
|
"typescript": ">=4.7",
|
|
101
|
-
"vike": "0.4.
|
|
63
|
+
"vike": "0.4.193"
|
|
102
64
|
},
|
|
103
65
|
"devDependencies": {
|
|
104
66
|
"@types/jsdom": "^21.1.2",
|
|
@@ -109,6 +71,6 @@
|
|
|
109
71
|
"tsup": "^7.1.0",
|
|
110
72
|
"turbolinks": "5.3.0-beta.1",
|
|
111
73
|
"typescript": "^5.0.4",
|
|
112
|
-
"vite": "^
|
|
74
|
+
"vite": "^5.1.0"
|
|
113
75
|
}
|
|
114
76
|
}
|