@common-stack/frontend-stack-react 6.0.6-alpha.5 → 6.0.6-alpha.50

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.
@@ -64,7 +64,7 @@ const containerMiddleware = async (req, res, next) => {
64
64
  logger.debug(`Successfully cleaned up - ID: ${requestId}`);
65
65
  }
66
66
  catch (error) {
67
- logger.error(`Error during container cleanup - ID: ${requestId}`, error);
67
+ logger.error(error, 'Error during container cleanup - ID: [%s]', requestId);
68
68
  }
69
69
  });
70
70
  next();
@@ -4,7 +4,7 @@ const stripCircular = (from, seen) => {
4
4
  const to = Array.isArray(from) ? [] : {};
5
5
  seen = seen || [];
6
6
  seen.push(from);
7
- Object.getOwnPropertyNames(from).forEach(key => {
7
+ Object.getOwnPropertyNames(from).forEach((key) => {
8
8
  if (!from[key] || (typeof from[key] !== 'object' && !Array.isArray(from[key]))) {
9
9
  to[key] = from[key];
10
10
  }
@@ -14,7 +14,7 @@ const initializeCache = ({ cache, initialState, clientState, logger }) => {
14
14
  logger.debug('Cache restored with initial state');
15
15
  }
16
16
  catch (err) {
17
- logger.error('Error restoring cache', err);
17
+ logger.error(err, 'Error restoring cache');
18
18
  }
19
19
  }
20
20
  else {
@@ -28,7 +28,7 @@ const initializeCache = ({ cache, initialState, clientState, logger }) => {
28
28
  }
29
29
  }
30
30
  catch (err) {
31
- logger.error('Error writing to cache', err);
31
+ logger.error(err, 'Error writing to cache');
32
32
  }
33
33
  });
34
34
  }
@@ -32,7 +32,7 @@ const createApolloClient = ({ scope, isDev, isDebug, isSSR, getDataIdFromObject,
32
32
  return !!result.find((item) => item && isBoolean(item));
33
33
  }
34
34
  catch (e) {
35
- logger.error('Error occurred in retryLink attempt condition', e);
35
+ logger.error(e, 'Error occurred in retryLink attempt condition');
36
36
  throw e;
37
37
  }
38
38
  },
@@ -20,5 +20,5 @@ interface IReduxStore<S = any> {
20
20
  * Add any reducers required for this app dirctly in to
21
21
  * `combineReducers`
22
22
  */
23
- export declare const createReduxStore: ({ scope, isDebug, isDev, reducers, rootEpic, enhancers, epicMiddleware, preMiddleware, postMiddleware, middleware, initialState, persistConfig, reduxConfig, }: IReduxStore<any>) => import("@reduxjs/toolkit").Store<any, import("@reduxjs/toolkit").UnknownAction, unknown>;
23
+ export declare const createReduxStore: ({ scope, isDebug, isDev, reducers, rootEpic, enhancers, epicMiddleware, preMiddleware, postMiddleware, middleware, initialState, persistConfig, reduxConfig, }: IReduxStore<any>) => import("redux").Store<any, import("redux").UnknownAction, unknown>;
24
24
  export {};
@@ -1,12 +1,21 @@
1
- import*as React from'react';import {Error500}from'@admin-layout/ant-ui';import {useRouteError,isRouteErrorResponse}from'@remix-run/react';function ErrorBoundary() {
1
+ import*as React from'react';import {useRouteError,isRouteErrorResponse}from'@remix-run/react';function ErrorBoundary() {
2
2
  const error = useRouteError();
3
3
  if (isRouteErrorResponse(error)) {
4
- return React.createElement(Error500, { title: `Route Error: ${error.statusText}`, status: error.status, data: error.data });
4
+ return (React.createElement("div", null,
5
+ React.createElement("h1", null,
6
+ error.status,
7
+ " ",
8
+ error.statusText),
9
+ React.createElement("p", null, error.data)));
5
10
  }
6
11
  else if (error instanceof Error) {
7
- return React.createElement(Error500, { title: error.message, status: "500", data: error.stack });
12
+ return (React.createElement("div", null,
13
+ React.createElement("h1", null, "Error"),
14
+ React.createElement("p", null, error.message),
15
+ React.createElement("p", null, "The stack trace is:"),
16
+ React.createElement("pre", null, error.stack)));
8
17
  }
9
18
  else {
10
- return React.createElement(Error500, { title: "Unknown Error", status: "500", data: error });
19
+ return React.createElement("h1", null, "Unknown Error");
11
20
  }
12
21
  }export{ErrorBoundary};
@@ -1,15 +1,24 @@
1
- import*as React from'react';import {useRouteError,isRouteErrorResponse}from'@remix-run/react';import Error500 from'./Error500.js';function ErrorBoundary() {
1
+ import*as React from'react';import {useRouteError,isRouteErrorResponse}from'@remix-run/react';function ErrorBoundary() {
2
2
  const error = useRouteError();
3
3
  React.useEffect(() => {
4
4
  console.trace(error);
5
5
  }, [error]);
6
6
  if (isRouteErrorResponse(error)) {
7
- return React.createElement(Error500, { title: error.statusText, status: error.status, data: error.data });
7
+ return (React.createElement("div", null,
8
+ React.createElement("h1", null,
9
+ error.status,
10
+ " ",
11
+ error.statusText),
12
+ React.createElement("p", null, error.data)));
8
13
  }
9
14
  else if (error instanceof Error) {
10
- return React.createElement(Error500, { title: error.message, status: "500", data: error.stack });
15
+ return (React.createElement("div", null,
16
+ React.createElement("h1", null, "Error"),
17
+ React.createElement("p", null, error.message),
18
+ React.createElement("p", null, "The stack trace is:"),
19
+ React.createElement("pre", null, error.stack)));
11
20
  }
12
21
  else {
13
- return React.createElement(Error500, { title: "Unknown Error", status: "500", data: error });
22
+ return React.createElement("h1", null, "Unknown Error");
14
23
  }
15
24
  }export{ErrorBoundary};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@common-stack/frontend-stack-react",
3
- "version": "6.0.6-alpha.5",
3
+ "version": "6.0.6-alpha.50",
4
4
  "description": "Client Module for react app",
5
5
  "homepage": "https://github.com/cdmbase/fullstack-pro#readme",
6
6
  "bugs": {
@@ -32,17 +32,16 @@
32
32
  "@apollo/client": "^3.9.0",
33
33
  "@cdm-logger/client": "^9.0.3",
34
34
  "@cdm-logger/server": "^9.0.3",
35
- "@cdmbase/redux-data-router": "^1.0.10",
36
- "@common-stack/client-core": "6.0.6-alpha.5",
37
- "@common-stack/client-react": "6.0.6-alpha.5",
38
- "@common-stack/components-pro": "6.0.6-alpha.5",
39
- "@common-stack/core": "6.0.6-alpha.5",
40
- "@common-stack/remix-router-redux": "6.0.6-alpha.5",
41
- "@common-stack/server-core": "6.0.6-alpha.5",
35
+ "@common-stack/client-core": "6.0.6-alpha.50",
36
+ "@common-stack/client-react": "6.0.6-alpha.50",
37
+ "@common-stack/components-pro": "6.0.6-alpha.50",
38
+ "@common-stack/core": "6.0.6-alpha.50",
39
+ "@common-stack/remix-router-redux": "6.0.6-alpha.50",
40
+ "@common-stack/server-core": "6.0.6-alpha.50",
42
41
  "@reduxjs/toolkit": "^2.2.6",
43
- "@remix-run/express": "^2.8.1",
44
- "@remix-run/node": "^2.8.1",
45
- "@remix-run/react": "^2.8.1",
42
+ "@remix-run/express": "~2.10.1",
43
+ "@remix-run/node": "~2.10.1",
44
+ "@remix-run/react": "~2.10.1",
46
45
  "@sentry/browser": "~5.11.2",
47
46
  "cors": "^2.8.5",
48
47
  "cross-fetch": "^4.0.0",
@@ -87,9 +86,9 @@
87
86
  },
88
87
  "peerDependencies": {
89
88
  "@apollo/client": ">=3.0.0",
90
- "@remix-run/react": "^2.9.2",
91
89
  "react": ">=18",
92
- "react-dom": ">=18"
90
+ "react-dom": ">=18",
91
+ "redux": ">=5.0.0"
93
92
  },
94
93
  "publishConfig": {
95
94
  "access": "public"
@@ -97,5 +96,5 @@
97
96
  "typescript": {
98
97
  "definition": "lib/index.d.ts"
99
98
  },
100
- "gitHead": "d91b9b71d873a56f2f576aea95e0be5471550408"
99
+ "gitHead": "1480cb5cc450e52664029ce217b71f52a49f8b86"
101
100
  }
@@ -1,14 +0,0 @@
1
- import*as React from'react';import {Box,VStack,Heading,Text,Code,Button}from'@chakra-ui/react';const Error500 = ({ title, status, data }) => {
2
- const handleReload = () => {
3
- window.location.reload();
4
- };
5
- return (React.createElement(Box, { display: "flex", alignItems: "center", justifyContent: "center", height: "100vh" },
6
- React.createElement(VStack, { spacing: 4, textAlign: "center" },
7
- React.createElement(Heading, { as: "h1", size: "xl" },
8
- "Error ",
9
- status),
10
- React.createElement(Text, null, title),
11
- data && (React.createElement(Box, { maxW: "md", mx: "auto", overflow: "auto" },
12
- React.createElement(Code, { p: 4, display: "block", whiteSpace: "pre", textAlign: "left" }, typeof data === 'string' ? data : JSON.stringify(data, null, 2)))),
13
- React.createElement(Button, { colorScheme: "teal", onClick: handleReload }, "Reload"))));
14
- };export{Error500 as default};