eddev 2.3.18 → 2.3.19
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/app/lib/blocks/editor/installGutenbergHooks.d.ts +1 -1
- package/dist/app/lib/devtools/components/DevUI.d.ts +1 -1
- package/dist/app/lib/devtools/hooks/useTailwind.d.ts +40 -40
- package/dist/app/lib/dynamic/dynamic.js +2 -2
- package/dist/app/lib/hooks/query-hooks.d.ts +7 -6
- package/dist/app/lib/hooks/query-hooks.d.ts.map +1 -1
- package/dist/app/lib/hooks/query-hooks.js +25 -23
- package/dist/app/server/render-ssr-page.d.ts.map +1 -1
- package/dist/app/server/render-ssr-page.js +11 -7
- package/dist/app/utils/query-client.d.ts +1 -0
- package/dist/app/utils/query-client.d.ts.map +1 -1
- package/dist/app/utils/query-client.js +42 -9
- package/dist/app/utils/ssr-cache.d.ts +6 -0
- package/dist/app/utils/ssr-cache.d.ts.map +1 -0
- package/dist/app/utils/ssr-cache.js +5 -0
- package/dist/app/utils/ssr-response-data.d.ts +13 -0
- package/dist/app/utils/ssr-response-data.d.ts.map +1 -0
- package/dist/app/utils/ssr-response-data.js +14 -0
- package/dist/node/compiler/get-vite-config.d.ts.map +1 -1
- package/dist/node/compiler/get-vite-config.js +2 -0
- package/dist/node/compiler/vinxi-app.d.ts.map +1 -1
- package/dist/node/compiler/vinxi-app.js +1 -0
- package/package.json +1 -1
- package/types.env.d.ts +3 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const blockMetaDescriptors: Map<string, BlockMeta> & {
|
|
2
|
-
$$valtioSnapshot: Omit<Map<string, BlockMeta>, "set" | "
|
|
2
|
+
$$valtioSnapshot: Omit<Map<string, BlockMeta>, "set" | "delete" | "clear">;
|
|
3
3
|
};
|
|
4
4
|
export declare function whenEditorIsReady(): Promise<void>;
|
|
5
5
|
export declare function installEDGutenbergHooks(): void;
|
|
@@ -10,7 +10,7 @@ export declare class ErrorBoundary extends Component<PropsWithChildren<{}>, Stat
|
|
|
10
10
|
state: State;
|
|
11
11
|
static getDerivedStateFromError(err: Error): State;
|
|
12
12
|
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
13
|
-
render(): string | number | boolean |
|
|
13
|
+
render(): string | number | boolean | import("react").JSX.Element | Iterable<import("react").ReactNode> | null | undefined;
|
|
14
14
|
}
|
|
15
15
|
export {};
|
|
16
16
|
//# sourceMappingURL=DevUI.d.ts.map
|
|
@@ -85,12 +85,12 @@ export declare function useTailwindConfig(): {
|
|
|
85
85
|
readonly max: string;
|
|
86
86
|
})[];
|
|
87
87
|
} | undefined;
|
|
88
|
-
readonly supports?: {
|
|
88
|
+
readonly supports?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
|
|
89
89
|
readonly [x: string]: string;
|
|
90
|
-
} |
|
|
91
|
-
readonly data?: {
|
|
90
|
+
} | undefined;
|
|
91
|
+
readonly data?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
|
|
92
92
|
readonly [x: string]: string;
|
|
93
|
-
} |
|
|
93
|
+
} | undefined;
|
|
94
94
|
readonly colors?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => import("tailwindcss/types/config.js").RecursiveKeyValuePair<string, string>) | {
|
|
95
95
|
readonly [x: string]: string | /*elided*/ any;
|
|
96
96
|
} | undefined;
|
|
@@ -493,12 +493,12 @@ export declare function useTailwindConfig(): {
|
|
|
493
493
|
readonly max: string;
|
|
494
494
|
})[];
|
|
495
495
|
} | undefined;
|
|
496
|
-
readonly supports?: {
|
|
496
|
+
readonly supports?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
|
|
497
497
|
readonly [x: string]: string;
|
|
498
|
-
} |
|
|
499
|
-
readonly data?: {
|
|
498
|
+
} | undefined;
|
|
499
|
+
readonly data?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
|
|
500
500
|
readonly [x: string]: string;
|
|
501
|
-
} |
|
|
501
|
+
} | undefined;
|
|
502
502
|
readonly colors?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => import("tailwindcss/types/config.js").RecursiveKeyValuePair<string, string>) | {
|
|
503
503
|
readonly [x: string]: string | /*elided*/ any;
|
|
504
504
|
} | undefined;
|
|
@@ -1130,12 +1130,12 @@ export declare function useTailwindConfig(): {
|
|
|
1130
1130
|
readonly max: string;
|
|
1131
1131
|
})[];
|
|
1132
1132
|
} | undefined;
|
|
1133
|
-
readonly supports?: {
|
|
1133
|
+
readonly supports?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
|
|
1134
1134
|
readonly [x: string]: string;
|
|
1135
|
-
} |
|
|
1136
|
-
readonly data?: {
|
|
1135
|
+
} | undefined;
|
|
1136
|
+
readonly data?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
|
|
1137
1137
|
readonly [x: string]: string;
|
|
1138
|
-
} |
|
|
1138
|
+
} | undefined;
|
|
1139
1139
|
readonly colors?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => import("tailwindcss/types/config.js").RecursiveKeyValuePair<string, string>) | {
|
|
1140
1140
|
readonly [x: string]: string | /*elided*/ any;
|
|
1141
1141
|
} | undefined;
|
|
@@ -1538,12 +1538,12 @@ export declare function useTailwindConfig(): {
|
|
|
1538
1538
|
readonly max: string;
|
|
1539
1539
|
})[];
|
|
1540
1540
|
} | undefined;
|
|
1541
|
-
readonly supports?: {
|
|
1541
|
+
readonly supports?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
|
|
1542
1542
|
readonly [x: string]: string;
|
|
1543
|
-
} |
|
|
1544
|
-
readonly data?: {
|
|
1543
|
+
} | undefined;
|
|
1544
|
+
readonly data?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
|
|
1545
1545
|
readonly [x: string]: string;
|
|
1546
|
-
} |
|
|
1546
|
+
} | undefined;
|
|
1547
1547
|
readonly colors?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => import("tailwindcss/types/config.js").RecursiveKeyValuePair<string, string>) | {
|
|
1548
1548
|
readonly [x: string]: string | /*elided*/ any;
|
|
1549
1549
|
} | undefined;
|
|
@@ -2150,12 +2150,12 @@ export declare function useTailwindConfig(): {
|
|
|
2150
2150
|
readonly max: string;
|
|
2151
2151
|
})[];
|
|
2152
2152
|
} | undefined;
|
|
2153
|
-
readonly supports?: {
|
|
2153
|
+
readonly supports?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
|
|
2154
2154
|
readonly [x: string]: string;
|
|
2155
|
-
} |
|
|
2156
|
-
readonly data?: {
|
|
2155
|
+
} | undefined;
|
|
2156
|
+
readonly data?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
|
|
2157
2157
|
readonly [x: string]: string;
|
|
2158
|
-
} |
|
|
2158
|
+
} | undefined;
|
|
2159
2159
|
readonly colors?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => import("tailwindcss/types/config.js").RecursiveKeyValuePair<string, string>) | {
|
|
2160
2160
|
readonly [x: string]: string | /*elided*/ any;
|
|
2161
2161
|
} | undefined;
|
|
@@ -2558,12 +2558,12 @@ export declare function useTailwindConfig(): {
|
|
|
2558
2558
|
readonly max: string;
|
|
2559
2559
|
})[];
|
|
2560
2560
|
} | undefined;
|
|
2561
|
-
readonly supports?: {
|
|
2561
|
+
readonly supports?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
|
|
2562
2562
|
readonly [x: string]: string;
|
|
2563
|
-
} |
|
|
2564
|
-
readonly data?: {
|
|
2563
|
+
} | undefined;
|
|
2564
|
+
readonly data?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
|
|
2565
2565
|
readonly [x: string]: string;
|
|
2566
|
-
} |
|
|
2566
|
+
} | undefined;
|
|
2567
2567
|
readonly colors?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => import("tailwindcss/types/config.js").RecursiveKeyValuePair<string, string>) | {
|
|
2568
2568
|
readonly [x: string]: string | /*elided*/ any;
|
|
2569
2569
|
} | undefined;
|
|
@@ -3221,12 +3221,12 @@ export declare function useTailwindConfig(): {
|
|
|
3221
3221
|
readonly max: string;
|
|
3222
3222
|
})[];
|
|
3223
3223
|
} | undefined;
|
|
3224
|
-
readonly supports?: {
|
|
3224
|
+
readonly supports?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
|
|
3225
3225
|
readonly [x: string]: string;
|
|
3226
|
-
} |
|
|
3227
|
-
readonly data?: {
|
|
3226
|
+
} | undefined;
|
|
3227
|
+
readonly data?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
|
|
3228
3228
|
readonly [x: string]: string;
|
|
3229
|
-
} |
|
|
3229
|
+
} | undefined;
|
|
3230
3230
|
readonly colors?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => import("tailwindcss/types/config.js").RecursiveKeyValuePair<string, string>) | {
|
|
3231
3231
|
readonly [x: string]: string | /*elided*/ any;
|
|
3232
3232
|
} | undefined;
|
|
@@ -3629,12 +3629,12 @@ export declare function useTailwindConfig(): {
|
|
|
3629
3629
|
readonly max: string;
|
|
3630
3630
|
})[];
|
|
3631
3631
|
} | undefined;
|
|
3632
|
-
readonly supports?: {
|
|
3632
|
+
readonly supports?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
|
|
3633
3633
|
readonly [x: string]: string;
|
|
3634
|
-
} |
|
|
3635
|
-
readonly data?: {
|
|
3634
|
+
} | undefined;
|
|
3635
|
+
readonly data?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
|
|
3636
3636
|
readonly [x: string]: string;
|
|
3637
|
-
} |
|
|
3637
|
+
} | undefined;
|
|
3638
3638
|
readonly colors?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => import("tailwindcss/types/config.js").RecursiveKeyValuePair<string, string>) | {
|
|
3639
3639
|
readonly [x: string]: string | /*elided*/ any;
|
|
3640
3640
|
} | undefined;
|
|
@@ -4239,12 +4239,12 @@ export declare function useTailwindConfig(): {
|
|
|
4239
4239
|
readonly max: string;
|
|
4240
4240
|
})[];
|
|
4241
4241
|
} | undefined;
|
|
4242
|
-
readonly supports?: {
|
|
4242
|
+
readonly supports?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
|
|
4243
4243
|
readonly [x: string]: string;
|
|
4244
|
-
} |
|
|
4245
|
-
readonly data?: {
|
|
4244
|
+
} | undefined;
|
|
4245
|
+
readonly data?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
|
|
4246
4246
|
readonly [x: string]: string;
|
|
4247
|
-
} |
|
|
4247
|
+
} | undefined;
|
|
4248
4248
|
readonly colors?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => import("tailwindcss/types/config.js").RecursiveKeyValuePair<string, string>) | {
|
|
4249
4249
|
readonly [x: string]: string | /*elided*/ any;
|
|
4250
4250
|
} | undefined;
|
|
@@ -4647,12 +4647,12 @@ export declare function useTailwindConfig(): {
|
|
|
4647
4647
|
readonly max: string;
|
|
4648
4648
|
})[];
|
|
4649
4649
|
} | undefined;
|
|
4650
|
-
readonly supports?: {
|
|
4650
|
+
readonly supports?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
|
|
4651
4651
|
readonly [x: string]: string;
|
|
4652
|
-
} |
|
|
4653
|
-
readonly data?: {
|
|
4652
|
+
} | undefined;
|
|
4653
|
+
readonly data?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
|
|
4654
4654
|
readonly [x: string]: string;
|
|
4655
|
-
} |
|
|
4655
|
+
} | undefined;
|
|
4656
4656
|
readonly colors?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => import("tailwindcss/types/config.js").RecursiveKeyValuePair<string, string>) | {
|
|
4657
4657
|
readonly [x: string]: string | /*elided*/ any;
|
|
4658
4658
|
} | undefined;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createElement, forwardRef, lazy, memo, useRef } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { useSSRResponse } from "../../utils/ssr-response-data.js";
|
|
3
3
|
export function dynamic(factory, name) {
|
|
4
4
|
const ReactLazyComponent = lazy(factory);
|
|
5
5
|
let PreloadedComponent;
|
|
6
6
|
let factoryPromise;
|
|
7
7
|
const Component = memo(forwardRef(function LazyWithPreload(props, ref) {
|
|
8
8
|
if (env.serverless && !env.client && name) {
|
|
9
|
-
|
|
9
|
+
useSSRResponse()?.addPreload(name);
|
|
10
10
|
}
|
|
11
11
|
// Once one of these is chosen, we must ensure that it continues to be
|
|
12
12
|
// used for all subsequent renders, otherwise it can cause the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FetchQueryOptions, UndefinedInitialDataInfiniteOptions, UndefinedInitialDataOptions, UseInfiniteQueryResult, UseMutationOptions, UseMutationResult, UseQueryResult } from "@tanstack/react-query";
|
|
1
|
+
import { type FetchQueryOptions, type UndefinedInitialDataInfiniteOptions, type UndefinedInitialDataOptions, type UseInfiniteQueryResult, type UseMutationOptions, type UseMutationResult, type UseQueryResult } from "@tanstack/react-query";
|
|
2
2
|
import { TRPCClientError, TRPCRequestOptions } from "@trpc/client";
|
|
3
3
|
type OptionalMaybes<T> = T extends any[] ? T : T extends {
|
|
4
4
|
[key: string]: any;
|
|
@@ -37,14 +37,15 @@ type CreateUseInfiniteQueryOptions = {
|
|
|
37
37
|
defaultLimit: number;
|
|
38
38
|
paths: Record<"nodesPath" | "pageInfoPath" | "endCursorPath" | "hasNextPagePath", string[]>;
|
|
39
39
|
};
|
|
40
|
+
export type InfiniteQueryResult<TData = any, TVars = any> = UseInfiniteQueryResult<{
|
|
41
|
+
nodes: TData;
|
|
42
|
+
total?: number | null;
|
|
43
|
+
}, QueryError>;
|
|
40
44
|
export type UseInfiniteQueryFunction<TData, TVars> = (args: OptionalMaybes<Omit<TVars, "cursor">>, options?: Omit<UndefinedInitialDataInfiniteOptions<TData, QueryError, TData, any[]>, "queryKey" | "queryFn" | "initialData" | "initialPageParam" | "getNextPageParam" | "select"> & {
|
|
41
45
|
headers?: Record<string, string>;
|
|
42
46
|
/** Initial data can be passed in, but should match the original GraphQL query in structure (including nodes/hasNextPage/endCursor) */
|
|
43
47
|
initialData?: any;
|
|
44
|
-
}) =>
|
|
45
|
-
nodes: TData;
|
|
46
|
-
total?: number | null;
|
|
47
|
-
}, QueryError>;
|
|
48
|
+
}) => InfiniteQueryResult<TData, TVars>;
|
|
48
49
|
export declare function createUseInfiniteQuery<TData extends any, TVars extends MaybeVars>(init: CreateUseInfiniteQueryOptions): UseInfiniteQueryFunction<TData, TVars>;
|
|
49
50
|
export type UseMutationFunction<TData, TArgs> = ((options?: Omit<UseMutationOptions<TData, QueryError, TArgs>, "mutationFn"> & {
|
|
50
51
|
headers?: Record<string, string>;
|
|
@@ -86,5 +87,5 @@ export declare const rpcClient: {
|
|
|
86
87
|
mutation<TName extends RPCMutationName>(name: TName, input: RPCMutationInput<TName>, opts?: TRPCRequestOptions): Promise<RPCMutationResult<TName>>;
|
|
87
88
|
};
|
|
88
89
|
export declare function getQueryClient(): import("@tanstack/react-query").QueryClient;
|
|
89
|
-
export type { QueryError,
|
|
90
|
+
export type { QueryError, UseMutationResult, UseQueryResult };
|
|
90
91
|
//# sourceMappingURL=query-hooks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-hooks.d.ts","sourceRoot":"","sources":["../../../../src/app/lib/hooks/query-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,
|
|
1
|
+
{"version":3,"file":"query-hooks.d.ts","sourceRoot":"","sources":["../../../../src/app/lib/hooks/query-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,mCAAmC,EACxC,KAAK,2BAA2B,EAEhC,KAAK,sBAAsB,EAE3B,KAAK,kBA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AU,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useInfiniteQuery, useMutation, useQuery, useQueryClient, } from "@tanstack/react-query";
|
|
2
|
-
import {
|
|
1
|
+
import { useInfiniteQuery, useMutation, useQuery, useQueryClient, useSuspenseQuery, useSuspenseInfiniteQuery } from "@tanstack/react-query";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
3
|
import { joinURL } from "ufo";
|
|
4
|
-
import { getQueryClient as utilGetQueryClient } from "../../utils/query-client.js";
|
|
4
|
+
import { getHydratedSSRQuery, getQueryClient as utilGetQueryClient } from "../../utils/query-client.js";
|
|
5
5
|
import { getRPCClient } from "../../utils/trpc-client.js";
|
|
6
6
|
import { apiConfig } from "../runtime/apiConfig.js";
|
|
7
7
|
class QueryError extends Error {
|
|
@@ -73,11 +73,13 @@ const fetchQuery = async (name, params, opts) => {
|
|
|
73
73
|
export function createUseQuery(init) {
|
|
74
74
|
const hook = (args, options) => {
|
|
75
75
|
const customKey = apiConfig.customQueryKey;
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
const queryKey = ["query", init.name, args, options?.headers, customKey];
|
|
77
|
+
return (env.server ? useSuspenseQuery : useQuery)({
|
|
78
|
+
queryKey: queryKey,
|
|
78
79
|
queryFn: (args) => fetchQuery(init.name, args.queryKey[2] ? JSON.stringify(args.queryKey[2]) : "", {
|
|
79
80
|
headers: options?.headers,
|
|
80
81
|
}),
|
|
82
|
+
initialData: env.client ? getHydratedSSRQuery(queryKey) : undefined,
|
|
81
83
|
...options,
|
|
82
84
|
}, useFallbackClient());
|
|
83
85
|
};
|
|
@@ -99,31 +101,31 @@ function selectByPath(data, path) {
|
|
|
99
101
|
export function createUseInfiniteQuery(init) {
|
|
100
102
|
const hook = (args, options) => {
|
|
101
103
|
const customKey = apiConfig.customQueryKey;
|
|
102
|
-
const [
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
const queryKey = ["query", init.name, args, init.defaultLimit, options?.headers, customKey];
|
|
105
|
+
const initial = useMemo(() => {
|
|
106
|
+
let data = options?.initialData;
|
|
107
|
+
if (data) {
|
|
105
108
|
const endCursor = selectByPath(data, init.paths.endCursorPath);
|
|
106
109
|
const hasNextPage = selectByPath(data, init.paths.hasNextPagePath);
|
|
107
110
|
const nodes = selectByPath(data, init.paths.nodesPath);
|
|
108
|
-
if (
|
|
109
|
-
return {
|
|
111
|
+
if (nodes) {
|
|
112
|
+
return {
|
|
113
|
+
initialData: {
|
|
114
|
+
pages: [{ nodes, endCursor, hasNextPage }],
|
|
115
|
+
pageParams: [],
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
data = getHydratedSSRQuery(queryKey);
|
|
121
|
+
if (data) {
|
|
110
122
|
return {
|
|
111
|
-
initialData:
|
|
112
|
-
pages: [{ nodes, endCursor, hasNextPage }],
|
|
113
|
-
pageParams: [],
|
|
114
|
-
},
|
|
123
|
+
initialData: data,
|
|
115
124
|
};
|
|
116
125
|
}
|
|
117
|
-
});
|
|
118
|
-
useEffect(() => {
|
|
119
|
-
startTransition(() => {
|
|
120
|
-
setInitial({
|
|
121
|
-
initialData: undefined,
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
126
|
}, []);
|
|
125
|
-
return useInfiniteQuery({
|
|
126
|
-
queryKey
|
|
127
|
+
return (env.server ? useSuspenseInfiniteQuery : useInfiniteQuery)({
|
|
128
|
+
queryKey,
|
|
127
129
|
queryFn: async (args) => {
|
|
128
130
|
const finalArgs = {
|
|
129
131
|
limit: args.queryKey[3],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-ssr-page.d.ts","sourceRoot":"","sources":["../../../src/app/server/render-ssr-page.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAKrF,KAAK,OAAO,GAAG;IACb,QAAQ,EAAE,MAA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ACX,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAA;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,wBAAgB,WAAW,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,KAAK,UA8B1D"}
|
|
@@ -5,14 +5,17 @@ import { Writable } from "stream";
|
|
|
5
5
|
import { MetaTags } from "../entry/MetaTags.js";
|
|
6
6
|
import { SSRRoot } from "../entry/ssr-root.js";
|
|
7
7
|
import { RouteLoader } from "../lib/routing/loader.js";
|
|
8
|
-
import {
|
|
8
|
+
import { ServerRenderResponseContext } from "../utils/ssr-response-data.js";
|
|
9
9
|
import { ServerContext } from "./server-context.js";
|
|
10
10
|
import { SecureHeaderBuilder } from "./utils/content-security.js";
|
|
11
11
|
export async function getSsrStream(args) {
|
|
12
12
|
const clientManifest = ServerContext.main.runtime.getManifest("client");
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const ssrResponse = {
|
|
14
|
+
preloadAssets: new Set([clientManifest.handler]),
|
|
15
|
+
includedAssets: new Set(),
|
|
16
|
+
queryCache: new Map(),
|
|
17
|
+
};
|
|
18
|
+
const jsx = (_jsx(Suspense, { children: _jsx(ServerRenderResponseContext.Provider, { value: ssrResponse, children: _jsx(SSRRoot, { metaTags: args.initialData?.meta?.head || [], pathname: args.pathname, hostname: args.hostname, initialData: args.initialData, loader: new RouteLoader() }) }) }));
|
|
16
19
|
const stream = await new Promise(async (resolve, reject) => {
|
|
17
20
|
// console.log("Rendering to pipable")
|
|
18
21
|
const stream = renderToPipeableStream(jsx, {
|
|
@@ -63,7 +66,7 @@ export async function getSsrStream(args) {
|
|
|
63
66
|
});
|
|
64
67
|
stream.pipe(writableStream);
|
|
65
68
|
});
|
|
66
|
-
for (const input of preloadAssets) {
|
|
69
|
+
for (const input of ssrResponse.preloadAssets) {
|
|
67
70
|
const assets = await clientManifest.inputs[input].assets();
|
|
68
71
|
// controller.enqueue(new TextEncoder().encode(`\n<!-- for ${input} -->`))
|
|
69
72
|
for (const _asset of assets) {
|
|
@@ -75,9 +78,9 @@ export async function getSsrStream(args) {
|
|
|
75
78
|
if (!key) {
|
|
76
79
|
throw new Error("Asset must have a key: " + JSON.stringify(asset));
|
|
77
80
|
}
|
|
78
|
-
if (includedAssets.has(key))
|
|
81
|
+
if (ssrResponse.includedAssets.has(key))
|
|
79
82
|
continue;
|
|
80
|
-
includedAssets.add(key);
|
|
83
|
+
ssrResponse.includedAssets.add(key);
|
|
81
84
|
// Render the asset
|
|
82
85
|
try {
|
|
83
86
|
const tag = renderAsset(asset);
|
|
@@ -88,6 +91,7 @@ export async function getSsrStream(args) {
|
|
|
88
91
|
}
|
|
89
92
|
}
|
|
90
93
|
}
|
|
94
|
+
controller.enqueue(new TextEncoder().encode(`<script type="text/javascript">window._SSR_CACHE=${JSON.stringify([...ssrResponse.queryCache.entries()])}</script>`));
|
|
91
95
|
// console.log("ASSETS", await clientManifest)
|
|
92
96
|
controller.enqueue(new TextEncoder().encode(middle));
|
|
93
97
|
for (const chunk of inner) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { QueryClient } from "@tanstack/react-query";
|
|
2
2
|
import { PropsWithChildren } from "react";
|
|
3
3
|
export declare function getQueryClient(): QueryClient;
|
|
4
|
+
export declare function getHydratedSSRQuery(queryKey: any): any;
|
|
4
5
|
export declare function QueryProvider(props: PropsWithChildren<{}>): import("react").JSX.Element;
|
|
5
6
|
//# sourceMappingURL=query-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-client.d.ts","sourceRoot":"","sources":["../../../src/app/utils/query-client.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"query-client.d.ts","sourceRoot":"","sources":["../../../src/app/utils/query-client.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA8B,WAAW,EAAuB,MAAM,uBAAuB,CAAA;AACpG,OAAO,EAAE,iBAAiB,EAAW,MAAM,OAAO,CAAA;AAelD,wBAAgB,cAAc,gBAO7B;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,GAAG,OAMhD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,iBAAiB,CAAC,EAAE,CAAC,+BAyBzD"}
|
|
@@ -1,20 +1,53 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { QueryCache, QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { useSSRResponse } from "./ssr-response-data.js";
|
|
5
|
+
function getQueryClientOptions() {
|
|
6
|
+
if (env.serverless && env.dev && !env.client) {
|
|
7
|
+
return {
|
|
8
|
+
queries: {
|
|
9
|
+
staleTime: 1,
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
return {};
|
|
14
|
+
}
|
|
3
15
|
let queryClient = null;
|
|
4
16
|
export function getQueryClient() {
|
|
5
17
|
if (!queryClient) {
|
|
6
18
|
queryClient = new QueryClient({
|
|
7
|
-
defaultOptions:
|
|
8
|
-
? {
|
|
9
|
-
queries: {
|
|
10
|
-
staleTime: 1,
|
|
11
|
-
},
|
|
12
|
-
}
|
|
13
|
-
: {},
|
|
19
|
+
defaultOptions: getQueryClientOptions(),
|
|
14
20
|
});
|
|
15
21
|
}
|
|
16
22
|
return queryClient;
|
|
17
23
|
}
|
|
24
|
+
export function getHydratedSSRQuery(queryKey) {
|
|
25
|
+
const queryHash = JSON.stringify(queryKey);
|
|
26
|
+
if (env.client && env.frontend && typeof window !== "undefined" && "_SSR_CACHE" in window) {
|
|
27
|
+
const cache = window._SSR_CACHE;
|
|
28
|
+
return cache.find(([hash]) => hash === queryHash)?.[1];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
18
31
|
export function QueryProvider(props) {
|
|
19
|
-
|
|
32
|
+
const ssrResponse = useSSRResponse();
|
|
33
|
+
const queryClient = useMemo(() => {
|
|
34
|
+
let queryCache;
|
|
35
|
+
/**
|
|
36
|
+
* In SSR server mode, save query cache values to the SSR Response metadata.
|
|
37
|
+
* The client will try to get these from getHydratedSSRQuery()
|
|
38
|
+
*/
|
|
39
|
+
if (env.server) {
|
|
40
|
+
queryCache = new QueryCache({
|
|
41
|
+
onSuccess(data, query) {
|
|
42
|
+
ssrResponse?.queryCache.set(JSON.stringify(query.queryKey), data);
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
return new QueryClient({
|
|
46
|
+
queryCache: queryCache,
|
|
47
|
+
defaultOptions: getQueryClientOptions(),
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return getQueryClient();
|
|
51
|
+
}, []);
|
|
52
|
+
return _jsx(QueryClientProvider, { client: queryClient, children: props.children });
|
|
20
53
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssr-cache.d.ts","sourceRoot":"","sources":["../../../src/app/utils/ssr-cache.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,kBAAkB,0CAA6C,CAAA;AAE5E,eAAO,MAAM,cAAc,uBAE1B,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type ServerRenderResponseData = {
|
|
2
|
+
preloadAssets: Set<string>;
|
|
3
|
+
includedAssets: Set<string>;
|
|
4
|
+
queryCache: Map<string, any>;
|
|
5
|
+
};
|
|
6
|
+
export declare const ServerRenderResponseContext: import("react").Context<ServerRenderResponseData | undefined>;
|
|
7
|
+
export declare function useSSRResponse(): {
|
|
8
|
+
addPreload(name: string): void;
|
|
9
|
+
preloadAssets: Set<string>;
|
|
10
|
+
includedAssets: Set<string>;
|
|
11
|
+
queryCache: Map<string, any>;
|
|
12
|
+
} | null;
|
|
13
|
+
//# sourceMappingURL=ssr-response-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssr-response-data.d.ts","sourceRoot":"","sources":["../../../src/app/utils/ssr-response-data.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,wBAAwB,GAAG;IACrC,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,2BAA2B,+DAAiE,CAAA;AAEzG,wBAAgB,cAAc;qBAMP,MAAM;mBAbZ,GAAG,CAAC,MAAM,CAAC;oBACV,GAAG,CAAC,MAAM,CAAC;gBACf,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC;SAiB7B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
export const ServerRenderResponseContext = createContext(undefined);
|
|
3
|
+
export function useSSRResponse() {
|
|
4
|
+
const data = useContext(ServerRenderResponseContext);
|
|
5
|
+
if (data) {
|
|
6
|
+
return {
|
|
7
|
+
...data,
|
|
8
|
+
addPreload(name) {
|
|
9
|
+
data.preloadAssets.add(name);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-vite-config.d.ts","sourceRoot":"","sources":["../../../src/node/compiler/get-vite-config.ts"],"names":[],"mappings":"AAMA,OAAO,EAAgB,YAAY,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAG/D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAEtD,MAAM,MAAM,IAAI,GAAG;IACjB,IAAI,EAAE,aAAa,GAAG,YAAY,CAAA;IAClC,UAAU,EAAE,OAAO,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AY,EAAE,CAE/D;AAED,wBAAgB,wBAAwB,IAAI,YAAY,CA8BvD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE;IAAE,OAAO,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,YAAY,CA6BzG;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,YAAY,CAkEtD"}
|
|
@@ -11,8 +11,10 @@ export function envPlugin(args) {
|
|
|
11
11
|
const envDefines = {
|
|
12
12
|
client: args.client ? "true" : "false",
|
|
13
13
|
serverless: args.serverless ? "true" : "false",
|
|
14
|
+
server: !args.client && args.serverless ? "true" : "false",
|
|
14
15
|
dev: args.mode === "development" ? "true" : "false",
|
|
15
16
|
admin: args.target === "cms" ? "true" : "false",
|
|
17
|
+
frontend: args.target === "frontend" ? "true" : "false",
|
|
16
18
|
themePath: JSON.stringify(args.publicUrl),
|
|
17
19
|
devUI: args.mode === "development" ? "true" : "false",
|
|
18
20
|
serverlessOrigin: JSON.stringify("http://serverleress-endpoint"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vinxi-app.d.ts","sourceRoot":"","sources":["../../../src/node/compiler/vinxi-app.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vinxi-app.d.ts","sourceRoot":"","sources":["../../../src/node/compiler/vinxi-app.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAKtD,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,aAAa,GAAG,YAAY,CAAA;IAClC,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,WAAW,EAAE,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,MAAM,EAAE,QAAQ,CAAA;CACjB,CAAA;AAED,KAAK,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,MAAM,CAAA;AAC7D,KAAK,mBAAmB,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK,QAAQ,CAAA;AACrD,KAAK,iBAAiB,GAAG,MAAM,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAA;AAEhE,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAA;CAC1C,CAAA;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,OA4P3C"}
|
package/package.json
CHANGED
package/types.env.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ declare global {
|
|
|
2
2
|
interface EDEnv {
|
|
3
3
|
client: boolean
|
|
4
4
|
serverless: boolean
|
|
5
|
+
server: boolean
|
|
5
6
|
admin: boolean
|
|
7
|
+
frontend: boolean,
|
|
6
8
|
dev: boolean
|
|
7
9
|
devUI: boolean
|
|
8
10
|
rpcEnabled: boolean
|
|
@@ -17,4 +19,4 @@ declare global {
|
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
export {}
|
|
22
|
+
export { }
|