eddev 2.0.0-beta.77 → 2.0.0-beta.78

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.
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { OverlayProps } from "./types";
3
+ export declare function HydrationOverlay({ integrations }: OverlayProps): React.ReactPortal | null;
@@ -0,0 +1,98 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ // @ts-ignore
4
+ import beautify from "beautify";
5
+ import { createPortal } from "react-dom";
6
+ import { useEffect, useState } from "react";
7
+ import ReactDiffViewer, { DiffMethod } from "react-diff-viewer-continued";
8
+ import { hydrationDebug } from "../utils/hydration-debugger";
9
+ import { useSnapshot } from "valtio";
10
+ // Remove emotion-inserted style tags from the HTML string from the server
11
+ // as they get removed before hydration, so they shouldn't show in the diff
12
+ // (pollutes the diff and makes it unusable)
13
+ function removeEmotionStyleTags(htmlString = "") {
14
+ const regex = /<style\s+data-emotion(?:="[^"]*"|[^>])*>[\s\S]*?<\/style>/g;
15
+ return htmlString.replace(regex, "");
16
+ }
17
+ const DiffViewer = ReactDiffViewer.default
18
+ ? ReactDiffViewer.default
19
+ : ReactDiffViewer;
20
+ export function HydrationOverlay({ integrations }) {
21
+ const [SSRHtml, setSSRHtml] = useState("");
22
+ const [CSRHtml, setCSRHtml] = useState("");
23
+ const [showModal, setShowModal] = useState(true);
24
+ const [hasHydrationMismatch, setHasHydrationMismatch] = useState(false);
25
+ useEffect(() => {
26
+ // @ts-ignore
27
+ const ssrHtml = hydrationDebug.initialHTML;
28
+ // hydrationDebug.add({ error: new Error(), info: null })
29
+ // @ts-ignore
30
+ // window.BUILDER_HYDRATION_OVERLAY.CSR_HTML = document.querySelector("#_app")?.innerHTML
31
+ // @ts-ignore
32
+ const newCSRHtml = document.querySelector("#_app")?.innerHTML;
33
+ if (!ssrHtml || !newCSRHtml)
34
+ return;
35
+ const newSSR = beautify(ssrHtml, { format: "html" });
36
+ setSSRHtml(newSSR);
37
+ const newCSR = beautify(newCSRHtml, { format: "html" });
38
+ setCSRHtml(newCSR);
39
+ setShowModal(true);
40
+ // @ts-ignore
41
+ if (hydrationDebug.events.length > 0) {
42
+ console.log("Showing modal?");
43
+ setHasHydrationMismatch(true);
44
+ }
45
+ }, []);
46
+ const hideModal = () => {
47
+ setShowModal(false);
48
+ };
49
+ const renderModal = showModal && hasHydrationMismatch && typeof document !== "undefined";
50
+ const events = useSnapshot(hydrationDebug.events);
51
+ if (!renderModal) {
52
+ return null;
53
+ }
54
+ const renderOverlay = () => {
55
+ return (_jsx("div", { style: {
56
+ position: "absolute",
57
+ top: 0,
58
+ left: 0,
59
+ right: 0,
60
+ bottom: 0,
61
+ zIndex: 999998,
62
+ background: "rgba(0,0,0,0.5)",
63
+ cursor: "pointer",
64
+ display: "flex",
65
+ flexDirection: "column",
66
+ fontFamily: "monospace",
67
+ direction: "ltr",
68
+ }, onClick: hideModal, children: _jsx("div", { style: {
69
+ zIndex: 999999,
70
+ margin: "4rem 6rem",
71
+ backgroundColor: "white",
72
+ borderRadius: "0.5rem",
73
+ overflow: "auto",
74
+ cursor: "auto",
75
+ color: "#212529",
76
+ }, onClick: (e) => {
77
+ e.stopPropagation();
78
+ }, children: _jsxs("div", { style: { display: "flex", flexDirection: "column" }, children: [_jsxs("div", { style: {
79
+ display: "flex",
80
+ justifyContent: "space-between",
81
+ borderBottom: "1px solid black",
82
+ alignItems: "center",
83
+ }, children: [_jsx("div", { style: {
84
+ fontSize: "2rem",
85
+ fontWeight: "bold",
86
+ padding: "1rem",
87
+ }, children: "Hydration Mismatch Occurred" }), _jsx("button", { style: {
88
+ all: "unset",
89
+ cursor: "pointer",
90
+ padding: "0.5rem",
91
+ marginRight: "1rem",
92
+ backgroundColor: "#212529",
93
+ borderRadius: "0.25rem",
94
+ color: "white",
95
+ }, onClick: hideModal, children: "CLOSE" })] }), _jsx("div", { style: { position: "relative", width: "100%" }, children: _jsx(DiffViewer, { oldValue: SSRHtml, newValue: CSRHtml, leftTitle: "Server-Side Render", rightTitle: "Client-Side Render", compareMethod: DiffMethod.WORDS }) })] }) }) }));
96
+ };
97
+ return createPortal(renderOverlay(), document.body);
98
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ import { hydrationDebug } from "../utils/hydration-debugger";
2
+ //@ts-nocheck
3
+ // window.addEventListener("error", (event) => {
4
+ // const msg = event.message.toLowerCase()
5
+ // const isHydrationMsg = msg.includes("hydration") || msg.includes("hydrating")
6
+ // if (isHydrationMsg) {
7
+ // hydrationDebug.add({
8
+ // error: event.error,
9
+ // info: null,
10
+ // })
11
+ // }
12
+ // })
13
+ const root = document.getElementById("_app");
14
+ if (root) {
15
+ hydrationDebug.initialHTML = root.innerHTML;
16
+ }
17
+ // @ts-ignore
18
+ window.hydrationDebug = hydrationDebug;
@@ -7,7 +7,7 @@ import { clientMetaTags } from "../lib/routing/context.js";
7
7
  import { APIProvider } from "../utils/APIProvider.js";
8
8
  import { MetaTags } from "./MetaTags.js";
9
9
  export function SSRClientRoot(props) {
10
- return (_jsxs("html", { lang: "en", children: [_jsxs("head", { children: [_jsx(DynamicMetaTags, { tags: props.metaTags }), _jsx(Trackers, { position: "head" }), props.assets] }), _jsxs("body", { children: [_jsx(Trackers, { position: "body" }), _jsxs(APIProvider, { children: [_jsx(Suspense, { children: _jsx(BrowserRouter, {}) }), _jsx(DevUILoader, {})] }), _jsx(Trackers, { position: "footer" })] })] }));
10
+ return (_jsxs("html", { lang: "en", children: [_jsxs("head", { children: [_jsx(DynamicMetaTags, { tags: props.metaTags }), _jsx(Trackers, { position: "head" }), props.assets] }), _jsxs("body", { children: [_jsx(Trackers, { position: "body" }), _jsx(APIProvider, { children: _jsx(Suspense, { children: _jsx(BrowserRouter, {}) }) }), _jsx(DevUILoader, {}), _jsx(Trackers, { position: "footer" })] })] }));
11
11
  }
12
12
  function DynamicMetaTags(props) {
13
13
  const dynamicTags = useSnapshot(clientMetaTags).tags;
@@ -63,7 +63,7 @@ export const ContentBlocks = memo((props) => {
63
63
  }
64
64
  }
65
65
  // Attempt to wrap the block
66
- return (_jsxs(Fragment, { children: [spaceBefore, _jsx(BlockErrorBoundary, { block: block, blockContext: ctx, children: blockNode }), spaceAfter] }, index));
66
+ return (_jsxs(Fragment, { children: [spaceBefore, _jsx(BlockErrorBoundary, { block: block, blockContext: ctx, children: blockNode }), spaceAfter] }, block.slug + "_" + index));
67
67
  });
68
68
  }, [blocks, props.wrapBlock, props.spacer]);
69
69
  if (env.admin) {
@@ -18,9 +18,11 @@ export function GridIndicator() {
18
18
  for (let i = 0; i < 12; i++) {
19
19
  cols.push(_jsx("div", { style: { height: "100%", backgroundColor: "rgba(255,0,0,0.1)" } }));
20
20
  }
21
- useLayoutEffect(() => {
22
- document.documentElement.classList.toggle("debug-grid", enabled);
23
- }, [enabled]);
21
+ if (env.client) {
22
+ useLayoutEffect(() => {
23
+ document.documentElement.classList.toggle("debug-grid", enabled);
24
+ }, [enabled]);
25
+ }
24
26
  if (!enabled)
25
27
  return null;
26
28
  return (_jsx("div", { style: { position: "fixed", inset: 0, zIndex: 999999999, pointerEvents: "none" }, children: _jsx("div", { className: "grid-auto debug-display", style: { height: "100%" }, children: cols }) }));
@@ -883,20 +883,32 @@ export declare function useTailwindConfig(): {
883
883
  readonly corePlugins?: readonly (import("tailwindcss/types/generated/corePluginList.js").CorePluginList | undefined)[] | {
884
884
  readonly filter?: boolean | undefined;
885
885
  readonly fill?: boolean | undefined;
886
- readonly translate?: boolean | undefined;
887
- readonly content?: boolean | undefined;
888
- readonly height?: boolean | undefined;
889
- readonly width?: boolean | undefined;
886
+ readonly position?: boolean | undefined;
887
+ readonly zIndex?: boolean | undefined;
888
+ readonly space?: boolean | undefined;
890
889
  readonly cursor?: boolean | undefined;
891
890
  readonly display?: boolean | undefined;
891
+ readonly flex?: boolean | undefined;
892
+ readonly flexDirection?: boolean | undefined;
892
893
  readonly fontFamily?: boolean | undefined;
894
+ readonly margin?: boolean | undefined;
895
+ readonly backgroundColor?: boolean | undefined;
896
+ readonly borderRadius?: boolean | undefined;
897
+ readonly overflow?: boolean | undefined;
898
+ readonly justifyContent?: boolean | undefined;
899
+ readonly inset?: boolean | undefined;
900
+ readonly alignItems?: boolean | undefined;
901
+ readonly width?: boolean | undefined;
893
902
  readonly fontSize?: boolean | undefined;
894
- readonly fontStyle?: boolean | undefined;
895
903
  readonly fontWeight?: boolean | undefined;
904
+ readonly padding?: boolean | undefined;
905
+ readonly translate?: boolean | undefined;
906
+ readonly content?: boolean | undefined;
907
+ readonly height?: boolean | undefined;
908
+ readonly fontStyle?: boolean | undefined;
896
909
  readonly letterSpacing?: boolean | undefined;
897
910
  readonly opacity?: boolean | undefined;
898
911
  readonly order?: boolean | undefined;
899
- readonly overflow?: boolean | undefined;
900
912
  readonly pointerEvents?: boolean | undefined;
901
913
  readonly rotate?: boolean | undefined;
902
914
  readonly scale?: boolean | undefined;
@@ -906,22 +918,15 @@ export declare function useTailwindConfig(): {
906
918
  readonly transform?: boolean | undefined;
907
919
  readonly visibility?: boolean | undefined;
908
920
  readonly size?: boolean | undefined;
909
- readonly backgroundColor?: boolean | undefined;
910
- readonly inset?: boolean | undefined;
911
921
  readonly invert?: boolean | undefined;
912
922
  readonly outlineOffset?: boolean | undefined;
913
- readonly borderRadius?: boolean | undefined;
914
- readonly padding?: boolean | undefined;
915
- readonly flex?: boolean | undefined;
916
923
  readonly blur?: boolean | undefined;
917
924
  readonly resize?: boolean | undefined;
918
- readonly position?: boolean | undefined;
919
925
  readonly columns?: boolean | undefined;
920
926
  readonly preflight?: boolean | undefined;
921
927
  readonly container?: boolean | undefined;
922
928
  readonly accessibility?: boolean | undefined;
923
929
  readonly isolation?: boolean | undefined;
924
- readonly zIndex?: boolean | undefined;
925
930
  readonly gridColumn?: boolean | undefined;
926
931
  readonly gridColumnStart?: boolean | undefined;
927
932
  readonly gridColumnEnd?: boolean | undefined;
@@ -930,7 +935,6 @@ export declare function useTailwindConfig(): {
930
935
  readonly gridRowEnd?: boolean | undefined;
931
936
  readonly float?: boolean | undefined;
932
937
  readonly clear?: boolean | undefined;
933
- readonly margin?: boolean | undefined;
934
938
  readonly boxSizing?: boolean | undefined;
935
939
  readonly lineClamp?: boolean | undefined;
936
940
  readonly aspectRatio?: boolean | undefined;
@@ -967,16 +971,12 @@ export declare function useTailwindConfig(): {
967
971
  readonly gridAutoRows?: boolean | undefined;
968
972
  readonly gridTemplateColumns?: boolean | undefined;
969
973
  readonly gridTemplateRows?: boolean | undefined;
970
- readonly flexDirection?: boolean | undefined;
971
974
  readonly flexWrap?: boolean | undefined;
972
975
  readonly placeContent?: boolean | undefined;
973
976
  readonly placeItems?: boolean | undefined;
974
977
  readonly alignContent?: boolean | undefined;
975
- readonly alignItems?: boolean | undefined;
976
- readonly justifyContent?: boolean | undefined;
977
978
  readonly justifyItems?: boolean | undefined;
978
979
  readonly gap?: boolean | undefined;
979
- readonly space?: boolean | undefined;
980
980
  readonly divideWidth?: boolean | undefined;
981
981
  readonly divideStyle?: boolean | undefined;
982
982
  readonly divideColor?: boolean | undefined;
@@ -1928,20 +1928,32 @@ export declare function useTailwindConfig(): {
1928
1928
  readonly corePlugins?: readonly (import("tailwindcss/types/generated/corePluginList.js").CorePluginList | undefined)[] | {
1929
1929
  readonly filter?: boolean | undefined;
1930
1930
  readonly fill?: boolean | undefined;
1931
- readonly translate?: boolean | undefined;
1932
- readonly content?: boolean | undefined;
1933
- readonly height?: boolean | undefined;
1934
- readonly width?: boolean | undefined;
1931
+ readonly position?: boolean | undefined;
1932
+ readonly zIndex?: boolean | undefined;
1933
+ readonly space?: boolean | undefined;
1935
1934
  readonly cursor?: boolean | undefined;
1936
1935
  readonly display?: boolean | undefined;
1936
+ readonly flex?: boolean | undefined;
1937
+ readonly flexDirection?: boolean | undefined;
1937
1938
  readonly fontFamily?: boolean | undefined;
1939
+ readonly margin?: boolean | undefined;
1940
+ readonly backgroundColor?: boolean | undefined;
1941
+ readonly borderRadius?: boolean | undefined;
1942
+ readonly overflow?: boolean | undefined;
1943
+ readonly justifyContent?: boolean | undefined;
1944
+ readonly inset?: boolean | undefined;
1945
+ readonly alignItems?: boolean | undefined;
1946
+ readonly width?: boolean | undefined;
1938
1947
  readonly fontSize?: boolean | undefined;
1939
- readonly fontStyle?: boolean | undefined;
1940
1948
  readonly fontWeight?: boolean | undefined;
1949
+ readonly padding?: boolean | undefined;
1950
+ readonly translate?: boolean | undefined;
1951
+ readonly content?: boolean | undefined;
1952
+ readonly height?: boolean | undefined;
1953
+ readonly fontStyle?: boolean | undefined;
1941
1954
  readonly letterSpacing?: boolean | undefined;
1942
1955
  readonly opacity?: boolean | undefined;
1943
1956
  readonly order?: boolean | undefined;
1944
- readonly overflow?: boolean | undefined;
1945
1957
  readonly pointerEvents?: boolean | undefined;
1946
1958
  readonly rotate?: boolean | undefined;
1947
1959
  readonly scale?: boolean | undefined;
@@ -1951,22 +1963,15 @@ export declare function useTailwindConfig(): {
1951
1963
  readonly transform?: boolean | undefined;
1952
1964
  readonly visibility?: boolean | undefined;
1953
1965
  readonly size?: boolean | undefined;
1954
- readonly backgroundColor?: boolean | undefined;
1955
- readonly inset?: boolean | undefined;
1956
1966
  readonly invert?: boolean | undefined;
1957
1967
  readonly outlineOffset?: boolean | undefined;
1958
- readonly borderRadius?: boolean | undefined;
1959
- readonly padding?: boolean | undefined;
1960
- readonly flex?: boolean | undefined;
1961
1968
  readonly blur?: boolean | undefined;
1962
1969
  readonly resize?: boolean | undefined;
1963
- readonly position?: boolean | undefined;
1964
1970
  readonly columns?: boolean | undefined;
1965
1971
  readonly preflight?: boolean | undefined;
1966
1972
  readonly container?: boolean | undefined;
1967
1973
  readonly accessibility?: boolean | undefined;
1968
1974
  readonly isolation?: boolean | undefined;
1969
- readonly zIndex?: boolean | undefined;
1970
1975
  readonly gridColumn?: boolean | undefined;
1971
1976
  readonly gridColumnStart?: boolean | undefined;
1972
1977
  readonly gridColumnEnd?: boolean | undefined;
@@ -1975,7 +1980,6 @@ export declare function useTailwindConfig(): {
1975
1980
  readonly gridRowEnd?: boolean | undefined;
1976
1981
  readonly float?: boolean | undefined;
1977
1982
  readonly clear?: boolean | undefined;
1978
- readonly margin?: boolean | undefined;
1979
1983
  readonly boxSizing?: boolean | undefined;
1980
1984
  readonly lineClamp?: boolean | undefined;
1981
1985
  readonly aspectRatio?: boolean | undefined;
@@ -2012,16 +2016,12 @@ export declare function useTailwindConfig(): {
2012
2016
  readonly gridAutoRows?: boolean | undefined;
2013
2017
  readonly gridTemplateColumns?: boolean | undefined;
2014
2018
  readonly gridTemplateRows?: boolean | undefined;
2015
- readonly flexDirection?: boolean | undefined;
2016
2019
  readonly flexWrap?: boolean | undefined;
2017
2020
  readonly placeContent?: boolean | undefined;
2018
2021
  readonly placeItems?: boolean | undefined;
2019
2022
  readonly alignContent?: boolean | undefined;
2020
- readonly alignItems?: boolean | undefined;
2021
- readonly justifyContent?: boolean | undefined;
2022
2023
  readonly justifyItems?: boolean | undefined;
2023
2024
  readonly gap?: boolean | undefined;
2024
- readonly space?: boolean | undefined;
2025
2025
  readonly divideWidth?: boolean | undefined;
2026
2026
  readonly divideStyle?: boolean | undefined;
2027
2027
  readonly divideColor?: boolean | undefined;
@@ -2948,20 +2948,32 @@ export declare function useTailwindConfig(): {
2948
2948
  readonly corePlugins?: readonly (import("tailwindcss/types/generated/corePluginList.js").CorePluginList | undefined)[] | {
2949
2949
  readonly filter?: boolean | undefined;
2950
2950
  readonly fill?: boolean | undefined;
2951
- readonly translate?: boolean | undefined;
2952
- readonly content?: boolean | undefined;
2953
- readonly height?: boolean | undefined;
2954
- readonly width?: boolean | undefined;
2951
+ readonly position?: boolean | undefined;
2952
+ readonly zIndex?: boolean | undefined;
2953
+ readonly space?: boolean | undefined;
2955
2954
  readonly cursor?: boolean | undefined;
2956
2955
  readonly display?: boolean | undefined;
2956
+ readonly flex?: boolean | undefined;
2957
+ readonly flexDirection?: boolean | undefined;
2957
2958
  readonly fontFamily?: boolean | undefined;
2959
+ readonly margin?: boolean | undefined;
2960
+ readonly backgroundColor?: boolean | undefined;
2961
+ readonly borderRadius?: boolean | undefined;
2962
+ readonly overflow?: boolean | undefined;
2963
+ readonly justifyContent?: boolean | undefined;
2964
+ readonly inset?: boolean | undefined;
2965
+ readonly alignItems?: boolean | undefined;
2966
+ readonly width?: boolean | undefined;
2958
2967
  readonly fontSize?: boolean | undefined;
2959
- readonly fontStyle?: boolean | undefined;
2960
2968
  readonly fontWeight?: boolean | undefined;
2969
+ readonly padding?: boolean | undefined;
2970
+ readonly translate?: boolean | undefined;
2971
+ readonly content?: boolean | undefined;
2972
+ readonly height?: boolean | undefined;
2973
+ readonly fontStyle?: boolean | undefined;
2961
2974
  readonly letterSpacing?: boolean | undefined;
2962
2975
  readonly opacity?: boolean | undefined;
2963
2976
  readonly order?: boolean | undefined;
2964
- readonly overflow?: boolean | undefined;
2965
2977
  readonly pointerEvents?: boolean | undefined;
2966
2978
  readonly rotate?: boolean | undefined;
2967
2979
  readonly scale?: boolean | undefined;
@@ -2971,22 +2983,15 @@ export declare function useTailwindConfig(): {
2971
2983
  readonly transform?: boolean | undefined;
2972
2984
  readonly visibility?: boolean | undefined;
2973
2985
  readonly size?: boolean | undefined;
2974
- readonly backgroundColor?: boolean | undefined;
2975
- readonly inset?: boolean | undefined;
2976
2986
  readonly invert?: boolean | undefined;
2977
2987
  readonly outlineOffset?: boolean | undefined;
2978
- readonly borderRadius?: boolean | undefined;
2979
- readonly padding?: boolean | undefined;
2980
- readonly flex?: boolean | undefined;
2981
2988
  readonly blur?: boolean | undefined;
2982
2989
  readonly resize?: boolean | undefined;
2983
- readonly position?: boolean | undefined;
2984
2990
  readonly columns?: boolean | undefined;
2985
2991
  readonly preflight?: boolean | undefined;
2986
2992
  readonly container?: boolean | undefined;
2987
2993
  readonly accessibility?: boolean | undefined;
2988
2994
  readonly isolation?: boolean | undefined;
2989
- readonly zIndex?: boolean | undefined;
2990
2995
  readonly gridColumn?: boolean | undefined;
2991
2996
  readonly gridColumnStart?: boolean | undefined;
2992
2997
  readonly gridColumnEnd?: boolean | undefined;
@@ -2995,7 +3000,6 @@ export declare function useTailwindConfig(): {
2995
3000
  readonly gridRowEnd?: boolean | undefined;
2996
3001
  readonly float?: boolean | undefined;
2997
3002
  readonly clear?: boolean | undefined;
2998
- readonly margin?: boolean | undefined;
2999
3003
  readonly boxSizing?: boolean | undefined;
3000
3004
  readonly lineClamp?: boolean | undefined;
3001
3005
  readonly aspectRatio?: boolean | undefined;
@@ -3032,16 +3036,12 @@ export declare function useTailwindConfig(): {
3032
3036
  readonly gridAutoRows?: boolean | undefined;
3033
3037
  readonly gridTemplateColumns?: boolean | undefined;
3034
3038
  readonly gridTemplateRows?: boolean | undefined;
3035
- readonly flexDirection?: boolean | undefined;
3036
3039
  readonly flexWrap?: boolean | undefined;
3037
3040
  readonly placeContent?: boolean | undefined;
3038
3041
  readonly placeItems?: boolean | undefined;
3039
3042
  readonly alignContent?: boolean | undefined;
3040
- readonly alignItems?: boolean | undefined;
3041
- readonly justifyContent?: boolean | undefined;
3042
3043
  readonly justifyItems?: boolean | undefined;
3043
3044
  readonly gap?: boolean | undefined;
3044
- readonly space?: boolean | undefined;
3045
3045
  readonly divideWidth?: boolean | undefined;
3046
3046
  readonly divideStyle?: boolean | undefined;
3047
3047
  readonly divideColor?: boolean | undefined;
@@ -3993,20 +3993,32 @@ export declare function useTailwindConfig(): {
3993
3993
  readonly corePlugins?: readonly (import("tailwindcss/types/generated/corePluginList.js").CorePluginList | undefined)[] | {
3994
3994
  readonly filter?: boolean | undefined;
3995
3995
  readonly fill?: boolean | undefined;
3996
- readonly translate?: boolean | undefined;
3997
- readonly content?: boolean | undefined;
3998
- readonly height?: boolean | undefined;
3999
- readonly width?: boolean | undefined;
3996
+ readonly position?: boolean | undefined;
3997
+ readonly zIndex?: boolean | undefined;
3998
+ readonly space?: boolean | undefined;
4000
3999
  readonly cursor?: boolean | undefined;
4001
4000
  readonly display?: boolean | undefined;
4001
+ readonly flex?: boolean | undefined;
4002
+ readonly flexDirection?: boolean | undefined;
4002
4003
  readonly fontFamily?: boolean | undefined;
4004
+ readonly margin?: boolean | undefined;
4005
+ readonly backgroundColor?: boolean | undefined;
4006
+ readonly borderRadius?: boolean | undefined;
4007
+ readonly overflow?: boolean | undefined;
4008
+ readonly justifyContent?: boolean | undefined;
4009
+ readonly inset?: boolean | undefined;
4010
+ readonly alignItems?: boolean | undefined;
4011
+ readonly width?: boolean | undefined;
4003
4012
  readonly fontSize?: boolean | undefined;
4004
- readonly fontStyle?: boolean | undefined;
4005
4013
  readonly fontWeight?: boolean | undefined;
4014
+ readonly padding?: boolean | undefined;
4015
+ readonly translate?: boolean | undefined;
4016
+ readonly content?: boolean | undefined;
4017
+ readonly height?: boolean | undefined;
4018
+ readonly fontStyle?: boolean | undefined;
4006
4019
  readonly letterSpacing?: boolean | undefined;
4007
4020
  readonly opacity?: boolean | undefined;
4008
4021
  readonly order?: boolean | undefined;
4009
- readonly overflow?: boolean | undefined;
4010
4022
  readonly pointerEvents?: boolean | undefined;
4011
4023
  readonly rotate?: boolean | undefined;
4012
4024
  readonly scale?: boolean | undefined;
@@ -4016,22 +4028,15 @@ export declare function useTailwindConfig(): {
4016
4028
  readonly transform?: boolean | undefined;
4017
4029
  readonly visibility?: boolean | undefined;
4018
4030
  readonly size?: boolean | undefined;
4019
- readonly backgroundColor?: boolean | undefined;
4020
- readonly inset?: boolean | undefined;
4021
4031
  readonly invert?: boolean | undefined;
4022
4032
  readonly outlineOffset?: boolean | undefined;
4023
- readonly borderRadius?: boolean | undefined;
4024
- readonly padding?: boolean | undefined;
4025
- readonly flex?: boolean | undefined;
4026
4033
  readonly blur?: boolean | undefined;
4027
4034
  readonly resize?: boolean | undefined;
4028
- readonly position?: boolean | undefined;
4029
4035
  readonly columns?: boolean | undefined;
4030
4036
  readonly preflight?: boolean | undefined;
4031
4037
  readonly container?: boolean | undefined;
4032
4038
  readonly accessibility?: boolean | undefined;
4033
4039
  readonly isolation?: boolean | undefined;
4034
- readonly zIndex?: boolean | undefined;
4035
4040
  readonly gridColumn?: boolean | undefined;
4036
4041
  readonly gridColumnStart?: boolean | undefined;
4037
4042
  readonly gridColumnEnd?: boolean | undefined;
@@ -4040,7 +4045,6 @@ export declare function useTailwindConfig(): {
4040
4045
  readonly gridRowEnd?: boolean | undefined;
4041
4046
  readonly float?: boolean | undefined;
4042
4047
  readonly clear?: boolean | undefined;
4043
- readonly margin?: boolean | undefined;
4044
4048
  readonly boxSizing?: boolean | undefined;
4045
4049
  readonly lineClamp?: boolean | undefined;
4046
4050
  readonly aspectRatio?: boolean | undefined;
@@ -4077,16 +4081,12 @@ export declare function useTailwindConfig(): {
4077
4081
  readonly gridAutoRows?: boolean | undefined;
4078
4082
  readonly gridTemplateColumns?: boolean | undefined;
4079
4083
  readonly gridTemplateRows?: boolean | undefined;
4080
- readonly flexDirection?: boolean | undefined;
4081
4084
  readonly flexWrap?: boolean | undefined;
4082
4085
  readonly placeContent?: boolean | undefined;
4083
4086
  readonly placeItems?: boolean | undefined;
4084
4087
  readonly alignContent?: boolean | undefined;
4085
- readonly alignItems?: boolean | undefined;
4086
- readonly justifyContent?: boolean | undefined;
4087
4088
  readonly justifyItems?: boolean | undefined;
4088
4089
  readonly gap?: boolean | undefined;
4089
- readonly space?: boolean | undefined;
4090
4090
  readonly divideWidth?: boolean | undefined;
4091
4091
  readonly divideStyle?: boolean | undefined;
4092
4092
  readonly divideColor?: boolean | undefined;
@@ -14,6 +14,7 @@ type RenderErrorPageArgs = {
14
14
  pathname: string;
15
15
  code: number;
16
16
  title: string;
17
+ newOrigin?: string;
17
18
  };
18
19
  export declare function renderErrorPage(args: RenderErrorPageArgs): Promise<Response>;
19
20
  export {};
@@ -26,7 +26,7 @@ export async function getSsrStream(args) {
26
26
  console.error(err);
27
27
  },
28
28
  bootstrapModules: [clientManifest.inputs[clientManifest.handler].output.path],
29
- bootstrapScriptContent: `window.manifest = ${JSON.stringify(await clientManifest.json())};\nwindow._PAGE_DATA = ${JSON.stringify(args.initialData)};\nwindow._TRACKERS = ${JSON.stringify(args.initialData.trackers)}`,
29
+ bootstrapScriptContent: `window.manifest = ${JSON.stringify(await clientManifest.json())};\nwindow._PAGE_DATA = ${JSON.stringify(args.initialData)};\nwindow._TRACKERS = ${JSON.stringify(args.initialData.trackers)};`,
30
30
  });
31
31
  });
32
32
  return new ReadableStream({
@@ -102,42 +102,6 @@ export async function renderErrorPage(args) {
102
102
  return renderPage({
103
103
  pathname: "/_error",
104
104
  statusCode: args.code,
105
+ newOrigin: args.newOrigin,
105
106
  });
106
- // const serverContext = ServerContext.main
107
- // let headers = new Headers()
108
- // let responseInit: ResponseInit = {
109
- // headers,
110
- // }
111
- // try {
112
- // const { appData, trackers } = await serverContext.fetchAppData()
113
- // let data: RouteDataWithTrackers
114
- // data = {
115
- // view: "_error",
116
- // viewType: "react",
117
- // viewData: {},
118
- // appData,
119
- // trackers,
120
- // }
121
- // responseInit.status = 500
122
- // headers.set("Content-Type", "text/html; charset=utf-8")
123
- // const stream = await getSsrStream({
124
- // ...args,
125
- // initialData: data,
126
- // })
127
- // return new Response(stream, responseInit)
128
- // } catch (err) {
129
- // console.error(err)
130
- // return new Response(
131
- // '<!DOCTYPE html><html><head><title>500 Internal Server Error</title></head><body><h1>500 Internal Server Error</h1><p>"' +
132
- // String(err) +
133
- // '"</p></body></html>',
134
- // {
135
- // status: 500,
136
- // statusText: "Internal Server Error",
137
- // headers: {
138
- // "Content-Type": "text/html; charset=utf-8",
139
- // },
140
- // },
141
- // )
142
- // }
143
107
  }
@@ -130,6 +130,7 @@ export class ServerContext {
130
130
  resultData = {
131
131
  redirect: location,
132
132
  status: status,
133
+ data: "",
133
134
  };
134
135
  }
135
136
  if (resultData && typeof resultData === "object") {
@@ -0,0 +1,13 @@
1
+ export type HydrationErrorSnapshot = {
2
+ html: string;
3
+ error: Error;
4
+ info: any;
5
+ };
6
+ export declare const hydrationDebug: {
7
+ initialHTML: string;
8
+ events: HydrationErrorSnapshot[];
9
+ add(item: {
10
+ error: Error;
11
+ info: any;
12
+ }): void;
13
+ };
@@ -0,0 +1,11 @@
1
+ import { proxy } from "valtio";
2
+ export const hydrationDebug = proxy({
3
+ initialHTML: "",
4
+ events: [],
5
+ add(item) {
6
+ hydrationDebug.events.push({
7
+ html: document.querySelector("#_app")?.innerHTML ?? "",
8
+ ...item,
9
+ });
10
+ },
11
+ });
@@ -1 +1 @@
1
- export declare const VERSION = "2.0.0-beta.77";
1
+ export declare const VERSION = "2.0.0-beta.78";
@@ -1 +1 @@
1
- export const VERSION = "2.0.0-beta.77";
1
+ export const VERSION = "2.0.0-beta.78";
@@ -21,6 +21,7 @@ export class AdminBundler {
21
21
  outDir: relative(this.project.rootDir, "./dist/cms/"),
22
22
  serverless: false,
23
23
  target: "cms",
24
+ client: true,
24
25
  });
25
26
  console.verbose("Vite config:", baseConfig);
26
27
  await build(mergeConfig(baseConfig, defineConfig({
@@ -21,6 +21,7 @@ export class FrontendBundler {
21
21
  outDir: relative(this.project.rootDir, "./dist/frontend/"),
22
22
  serverless: false,
23
23
  target: "frontend",
24
+ client: true,
24
25
  });
25
26
  console.verbose("Vite config:", baseConfig);
26
27
  await build(mergeConfig(baseConfig, defineConfig({
@@ -8,6 +8,7 @@ export type Args = {
8
8
  outDir?: string;
9
9
  publicUrl: string;
10
10
  console: StatefulLog<any>;
11
+ client: boolean;
11
12
  };
12
13
  export declare function envPlugin(args: Args): PluginOption;
13
14
  export declare function reactPlugin(): PluginOption[];
@@ -8,7 +8,7 @@ import tsconfigPaths from "vite-tsconfig-paths";
8
8
  import { cliMode } from "../cli/cli-mode.js";
9
9
  export function envPlugin(args) {
10
10
  const envDefines = {
11
- client: args.serverless ? "!import.meta.env.SSR" : "true",
11
+ client: args.client ? "true" : "false",
12
12
  serverless: args.serverless ? "true" : "false",
13
13
  dev: args.mode === "development" ? "true" : "false",
14
14
  admin: args.target === "cms" ? "true" : "false",
@@ -28,7 +28,9 @@ export function envPlugin(args) {
28
28
  return result;
29
29
  };
30
30
  return replace({
31
- values: expandDefines(envDefines, ["process.env.", "process.", "env."]),
31
+ values: {
32
+ ...expandDefines(envDefines, ["process.env.", "process.", "env."]),
33
+ },
32
34
  preventAssignment: true,
33
35
  });
34
36
  }
@@ -90,8 +92,13 @@ export function ssrPlugin() {
90
92
  };
91
93
  config.ssr = {
92
94
  ...config.ssr,
93
- // @ts-ignore
94
- noExternal: ["eddev", "vinxi", "react-use", ...(config?.optimizeDeps?.noExternal ?? [])],
95
+ noExternal: [
96
+ "eddev",
97
+ "vinxi",
98
+ "react-use",
99
+ // @ts-ignore
100
+ ...(config?.optimizeDeps?.noExternal ?? []),
101
+ ],
95
102
  optimizeDeps: {
96
103
  exclude: ["eddev", "vinxi"],
97
104
  },
@@ -158,6 +158,7 @@ export function createVinxiApp(args) {
158
158
  publicUrl: args.publicUrl,
159
159
  serverless: true,
160
160
  target: "frontend",
161
+ client: true,
161
162
  }),
162
163
  ],
163
164
  base: "/_build",
@@ -175,6 +176,7 @@ export function createVinxiApp(args) {
175
176
  publicUrl: args.publicUrl,
176
177
  serverless: true,
177
178
  target: "cms",
179
+ client: true,
178
180
  }),
179
181
  ],
180
182
  base: "/_admin",
@@ -210,6 +212,7 @@ export function createVinxiApp(args) {
210
212
  publicUrl: args.publicUrl,
211
213
  serverless: true,
212
214
  target: "frontend",
215
+ client: false,
213
216
  }),
214
217
  ],
215
218
  },
@@ -52,7 +52,7 @@ export declare const BlockMetaSchema: z.ZodObject<{
52
52
  dynamic: boolean;
53
53
  cache: boolean;
54
54
  allowMultiple: boolean;
55
- frontendMode: "hidden" | "default" | "childrenOnly";
55
+ frontendMode: "default" | "hidden" | "childrenOnly";
56
56
  inserter: boolean;
57
57
  icon?: string | undefined;
58
58
  description?: string | undefined;
@@ -88,7 +88,7 @@ export declare const BlockMetaSchema: z.ZodObject<{
88
88
  postTypes: string[];
89
89
  fieldName: string;
90
90
  } | undefined;
91
- frontendMode?: "hidden" | "default" | "childrenOnly" | undefined;
91
+ frontendMode?: "default" | "hidden" | "childrenOnly" | undefined;
92
92
  inserter?: boolean | undefined;
93
93
  }>;
94
94
  export type BlockMetadata = z.infer<typeof BlockMetaSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eddev",
3
- "version": "2.0.0-beta.77",
3
+ "version": "2.0.0-beta.78",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",