@common-stack/frontend-stack-react 8.3.1-alpha.7 → 8.4.1-alpha.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.
|
@@ -7,7 +7,7 @@ interface CreateCacheParams {
|
|
|
7
7
|
logger: CdmLogger.ILogger;
|
|
8
8
|
}
|
|
9
9
|
export declare const createCache: ({ getDataIdFromObject, clientState }: CreateCacheParams) => InMemoryCache;
|
|
10
|
-
export declare const initializeCache: ({ cache, initialState, clientState, logger }: {
|
|
10
|
+
export declare const initializeCache: ({ cache, initialState, clientState, logger, }: {
|
|
11
11
|
cache: InMemoryCache;
|
|
12
12
|
initialState?: any;
|
|
13
13
|
clientState: any;
|
|
@@ -7,29 +7,27 @@ const createCache = ({ getDataIdFromObject, clientState }) => {
|
|
|
7
7
|
});
|
|
8
8
|
return cache;
|
|
9
9
|
};
|
|
10
|
-
const initializeCache = ({ cache, initialState, clientState, logger }) => {
|
|
10
|
+
const initializeCache = ({ cache, initialState, clientState, logger, }) => {
|
|
11
|
+
// NOTE: We intentionally do NOT call cache.restore(initialState) here.
|
|
12
|
+
// Restoring the full Apollo state can overwrite properly structured cache data
|
|
13
|
+
// (e.g., settings wrapped under configKey paths). Instead, we only initialize
|
|
14
|
+
// with defaults. The organizationContext.hydrate() in lifecycleMiddleware
|
|
15
|
+
// extracts what it needs directly from the state without affecting cache structure.
|
|
11
16
|
if (initialState) {
|
|
17
|
+
logger.debug('Initial state provided but skipping cache.restore() to preserve cache structure');
|
|
18
|
+
}
|
|
19
|
+
// Initialize with defaults regardless of initialState
|
|
20
|
+
clientState.defaults?.forEach((x) => {
|
|
12
21
|
try {
|
|
13
|
-
|
|
14
|
-
|
|
22
|
+
if (x.type === 'query') {
|
|
23
|
+
cache.writeQuery({ query: x.query, data: x.data });
|
|
24
|
+
}
|
|
25
|
+
else if (x.type === 'fragment') {
|
|
26
|
+
cache.writeFragment({ id: x.id, fragment: x.fragment, data: x.data });
|
|
27
|
+
}
|
|
15
28
|
}
|
|
16
29
|
catch (err) {
|
|
17
|
-
logger.error(err, 'Error
|
|
30
|
+
logger.error(err, 'Error writing to cache');
|
|
18
31
|
}
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
clientState.defaults?.forEach((x) => {
|
|
22
|
-
try {
|
|
23
|
-
if (x.type === 'query') {
|
|
24
|
-
cache.writeQuery({ query: x.query, data: x.data });
|
|
25
|
-
}
|
|
26
|
-
else if (x.type === 'fragment') {
|
|
27
|
-
cache.writeFragment({ id: x.id, fragment: x.fragment, data: x.data });
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
catch (err) {
|
|
31
|
-
logger.error(err, 'Error writing to cache');
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
32
|
+
});
|
|
35
33
|
};export{createCache,initializeCache};
|
|
@@ -5,11 +5,11 @@ import type { ClusterNode } from 'ioredis';
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const config: Readonly<{
|
|
7
7
|
SENTRY_DSN_FRONTEND: string;
|
|
8
|
-
NODE_ENV:
|
|
9
|
-
BACKEND_URL:
|
|
10
|
-
LOCAL_BACKEND_URL:
|
|
11
|
-
LOCAL_GRAPHQL_URL:
|
|
12
|
-
GRAPHQL_URL:
|
|
8
|
+
NODE_ENV: "development" | "production" | "test" | "staging";
|
|
9
|
+
BACKEND_URL: any;
|
|
10
|
+
LOCAL_BACKEND_URL: any;
|
|
11
|
+
LOCAL_GRAPHQL_URL: any;
|
|
12
|
+
GRAPHQL_URL: any;
|
|
13
13
|
LOG_LEVEL: string;
|
|
14
14
|
REDIS_CLUSTER_URL: ClusterNode[];
|
|
15
15
|
REDIS_URL: string;
|
|
@@ -17,7 +17,7 @@ export declare const config: Readonly<{
|
|
|
17
17
|
REDIS_SENTINEL_ENABLED: boolean;
|
|
18
18
|
REDIS_UPSTASH_TOKEN: string;
|
|
19
19
|
APP_NAME: string;
|
|
20
|
-
CLIENT_URL:
|
|
20
|
+
CLIENT_URL: any;
|
|
21
21
|
CONNECTION_ID: string;
|
|
22
22
|
NAMESPACE: string;
|
|
23
23
|
ZIPKIN_URL: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@common-stack/frontend-stack-react",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.4.1-alpha.0",
|
|
4
4
|
"description": "Client Module for react app",
|
|
5
5
|
"homepage": "https://github.com/cdmbase/fullstack-pro#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"@apollo/client": "^3.9.0",
|
|
33
33
|
"@cdm-logger/client": "^9.0.17",
|
|
34
34
|
"@cdm-logger/server": "^9.0.17",
|
|
35
|
-
"@common-stack/cache-api-server": "8.
|
|
36
|
-
"@common-stack/client-core": "8.
|
|
37
|
-
"@common-stack/client-react": "8.
|
|
38
|
-
"@common-stack/components-pro": "8.
|
|
39
|
-
"@common-stack/core": "8.
|
|
35
|
+
"@common-stack/cache-api-server": "8.4.1-alpha.0",
|
|
36
|
+
"@common-stack/client-core": "8.4.1-alpha.0",
|
|
37
|
+
"@common-stack/client-react": "8.4.1-alpha.0",
|
|
38
|
+
"@common-stack/components-pro": "8.4.1-alpha.0",
|
|
39
|
+
"@common-stack/core": "8.4.1-alpha.0",
|
|
40
40
|
"@common-stack/remix-router-redux": "8.3.1-alpha.4",
|
|
41
|
-
"@common-stack/server-core": "8.
|
|
42
|
-
"@common-stack/store-redis": "8.
|
|
41
|
+
"@common-stack/server-core": "8.4.1-alpha.0",
|
|
42
|
+
"@common-stack/store-redis": "8.4.1-alpha.0",
|
|
43
43
|
"@reduxjs/toolkit": "^2.2.6",
|
|
44
44
|
"@remix-run/express": "~2.15.3",
|
|
45
45
|
"@remix-run/node": "~2.15.3",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"cors": "^2.8.5",
|
|
51
51
|
"cross-fetch": "^4.0.0",
|
|
52
52
|
"dotenv": "^16.4.0",
|
|
53
|
-
"envalid": "~
|
|
53
|
+
"envalid": "~8.1.0",
|
|
54
54
|
"express": "^4.18.2",
|
|
55
55
|
"graphql": "^16.0.0",
|
|
56
56
|
"graphql-tag": "^2.11.0",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"publishConfig": {
|
|
101
101
|
"access": "public"
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "ac86412a3e65f14ccbf8b3a6e46f9b82ed7299da",
|
|
104
104
|
"typescript": {
|
|
105
105
|
"definition": "lib/index.d.ts"
|
|
106
106
|
}
|