@cedarjs/web 6.0.0-canary.2663 → 6.0.0-canary.2665
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/apollo/ApolloProviderWithFetchConfig.d.ts +1 -1
- package/dist/apollo/ApolloProviderWithFetchConfig.d.ts.map +1 -1
- package/dist/apollo/ApolloProviderWithFetchConfig.js +23 -16
- package/dist/apollo/CedarApolloProvider.js +1 -1
- package/dist/apollo/CedarApolloProvider.test.js +38 -0
- package/dist/apollo/apolloLinkTypes.d.ts +4 -4
- package/dist/apollo/apolloLinkTypes.d.ts.map +1 -1
- package/dist/apollo/fragmentRegistry.d.ts +3 -3
- package/dist/apollo/fragmentRegistry.d.ts.map +1 -1
- package/dist/apollo/fragmentRegistry.js +35 -8
- package/dist/apollo/fragmentRegistry.test.js +67 -0
- package/dist/apollo/links.d.ts +4 -5
- package/dist/apollo/links.d.ts.map +1 -1
- package/dist/apollo/links.js +7 -7
- package/dist/apollo/sseLink.d.ts +5 -8
- package/dist/apollo/sseLink.d.ts.map +1 -1
- package/dist/apollo/sseLink.js +9 -12
- package/dist/apollo/suspense.d.ts +3 -3
- package/dist/apollo/suspense.d.ts.map +1 -1
- package/dist/apollo/suspense.js +1 -1
- package/dist/apollo/useCache.d.ts +4 -6
- package/dist/apollo/useCache.d.ts.map +1 -1
- package/dist/apollo/useCache.js +1 -1
- package/dist/bundled/apollo-upload-client.d.ts +2 -2
- package/dist/bundled/apollo-upload-client.d.ts.map +1 -1
- package/dist/bundled/apollo-upload-client.js +2 -2
- package/dist/cjs/apollo/ApolloProviderWithFetchConfig.d.ts +1 -1
- package/dist/cjs/apollo/ApolloProviderWithFetchConfig.d.ts.map +1 -1
- package/dist/cjs/apollo/ApolloProviderWithFetchConfig.js +26 -21
- package/dist/cjs/apollo/CedarApolloProvider.js +2 -2
- package/dist/cjs/apollo/CedarApolloProvider.test.js +61 -0
- package/dist/cjs/apollo/apolloLinkTypes.d.ts +4 -4
- package/dist/cjs/apollo/apolloLinkTypes.d.ts.map +1 -1
- package/dist/cjs/apollo/fragmentRegistry.d.ts +3 -3
- package/dist/cjs/apollo/fragmentRegistry.d.ts.map +1 -1
- package/dist/cjs/apollo/fragmentRegistry.js +32 -18
- package/dist/cjs/apollo/fragmentRegistry.test.js +90 -0
- package/dist/cjs/apollo/links.d.ts +4 -5
- package/dist/cjs/apollo/links.d.ts.map +1 -1
- package/dist/cjs/apollo/links.js +12 -12
- package/dist/cjs/apollo/sseLink.d.ts +5 -8
- package/dist/cjs/apollo/sseLink.d.ts.map +1 -1
- package/dist/cjs/apollo/sseLink.js +11 -14
- package/dist/cjs/apollo/suspense.d.ts +3 -3
- package/dist/cjs/apollo/suspense.d.ts.map +1 -1
- package/dist/cjs/apollo/suspense.js +2 -2
- package/dist/cjs/apollo/useCache.d.ts +4 -6
- package/dist/cjs/apollo/useCache.d.ts.map +1 -1
- package/dist/cjs/apollo/useCache.js +2 -2
- package/dist/cjs/bundled/apollo-upload-client.d.ts +2 -2
- package/dist/cjs/bundled/apollo-upload-client.d.ts.map +1 -1
- package/dist/cjs/bundled/apollo-upload-client.js +1562 -1734
- package/dist/cjs/components/DevFatalErrorPage.d.ts +3 -3
- package/dist/cjs/components/DevFatalErrorPage.d.ts.map +1 -1
- package/dist/cjs/components/DevFatalErrorPage.js +2 -2
- package/dist/cjs/components/cell/CellErrorBoundary.d.ts +3 -3
- package/dist/cjs/components/cell/CellErrorBoundary.d.ts.map +1 -1
- package/dist/cjs/components/cell/cellTypes.d.ts +6 -5
- package/dist/cjs/components/cell/cellTypes.d.ts.map +1 -1
- package/dist/cjs/components/cell/createCell.d.ts.map +1 -1
- package/dist/cjs/components/cell/createCell.js +5 -4
- package/dist/cjs/components/cell/createCell.test.js +48 -48
- package/dist/cjs/components/cell/createFragmentCell.test.js +27 -30
- package/dist/cjs/components/cell/createSuspendingCell.d.ts.map +1 -1
- package/dist/cjs/components/cell/createSuspendingCell.js +7 -6
- package/dist/cjs/components/cell/createSuspendingCell.test.js +13 -13
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +4 -4
- package/dist/components/DevFatalErrorPage.d.ts +3 -3
- package/dist/components/DevFatalErrorPage.d.ts.map +1 -1
- package/dist/components/DevFatalErrorPage.js +2 -2
- package/dist/components/cell/CellErrorBoundary.d.ts +3 -3
- package/dist/components/cell/CellErrorBoundary.d.ts.map +1 -1
- package/dist/components/cell/cellTypes.d.ts +6 -5
- package/dist/components/cell/cellTypes.d.ts.map +1 -1
- package/dist/components/cell/createCell.d.ts.map +1 -1
- package/dist/components/cell/createCell.js +4 -3
- package/dist/components/cell/createCell.test.js +2 -2
- package/dist/components/cell/createFragmentCell.test.js +4 -7
- package/dist/components/cell/createSuspendingCell.d.ts.map +1 -1
- package/dist/components/cell/createSuspendingCell.js +4 -3
- package/dist/components/cell/createSuspendingCell.test.js +2 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -5
- package/package.json +10 -9
|
@@ -32,7 +32,8 @@ __export(createSuspendingCell_exports, {
|
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(createSuspendingCell_exports);
|
|
34
34
|
var import_react = __toESM(require("react"), 1);
|
|
35
|
-
var
|
|
35
|
+
var import_client = require("@apollo/client");
|
|
36
|
+
var import_react2 = require("@apollo/client/react");
|
|
36
37
|
var import_CellErrorBoundary = require("./CellErrorBoundary.js");
|
|
37
38
|
var import_isCellEmpty = require("./isCellEmpty.js");
|
|
38
39
|
function createSuspendingCell(createCellProps) {
|
|
@@ -66,7 +67,7 @@ function createSuspendingCell(createCellProps) {
|
|
|
66
67
|
const cellQuery = QUERY;
|
|
67
68
|
function SuspendingSuccess(props) {
|
|
68
69
|
const { queryRef, suspenseQueryResult, userProps } = props;
|
|
69
|
-
const { data, networkStatus } = (0,
|
|
70
|
+
const { data, networkStatus } = (0, import_react2.useReadQuery)(queryRef);
|
|
70
71
|
const afterQueryData = afterQuery(data);
|
|
71
72
|
const queryResultWithNetworkStatus = {
|
|
72
73
|
...suspenseQueryResult,
|
|
@@ -96,8 +97,8 @@ function createSuspendingCell(createCellProps) {
|
|
|
96
97
|
const { children: _, ...variables } = props;
|
|
97
98
|
const options = beforeQuery(variables);
|
|
98
99
|
const query = typeof cellQuery === "function" ? cellQuery(options) : cellQuery;
|
|
99
|
-
const [queryRef, other] = (0,
|
|
100
|
-
const client = (0,
|
|
100
|
+
const [queryRef, other] = (0, import_react2.useBackgroundQuery)(query, options);
|
|
101
|
+
const client = (0, import_react2.useApolloClient)();
|
|
101
102
|
const suspenseQueryResult = {
|
|
102
103
|
client,
|
|
103
104
|
...other,
|
|
@@ -106,7 +107,7 @@ function createSuspendingCell(createCellProps) {
|
|
|
106
107
|
const FailureComponent = ({ error, resetErrorBoundary }) => {
|
|
107
108
|
if (!Failure) {
|
|
108
109
|
if (error) {
|
|
109
|
-
throw error;
|
|
110
|
+
throw error instanceof Error ? error : new Error(error.message);
|
|
110
111
|
}
|
|
111
112
|
throw new Error("Unreachable code: FailureComponent without a Failure");
|
|
112
113
|
}
|
|
@@ -121,7 +122,7 @@ function createSuspendingCell(createCellProps) {
|
|
|
121
122
|
Failure,
|
|
122
123
|
{
|
|
123
124
|
error,
|
|
124
|
-
errorCode: error
|
|
125
|
+
errorCode: import_client.CombinedGraphQLErrors.is(error) ? error.errors[0]?.extensions?.["code"] : void 0,
|
|
125
126
|
queryResult: queryResultWithErrorReset
|
|
126
127
|
}
|
|
127
128
|
);
|
|
@@ -23,19 +23,19 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
23
|
));
|
|
24
24
|
var import_react = __toESM(require("react"), 1);
|
|
25
25
|
var import_dev = require("@apollo/client/dev");
|
|
26
|
-
var
|
|
27
|
-
var
|
|
26
|
+
var import_react2 = require("@apollo/client/react");
|
|
27
|
+
var import_react3 = require("@testing-library/react");
|
|
28
28
|
var import_vitest = require("vitest");
|
|
29
29
|
var import_createSuspendingCell = require("./createSuspendingCell.js");
|
|
30
|
-
import_vitest.vi.mock("@apollo/client/react
|
|
30
|
+
import_vitest.vi.mock("@apollo/client/react", () => {
|
|
31
31
|
return {
|
|
32
32
|
useApolloClient: import_vitest.vi.fn(),
|
|
33
33
|
useBackgroundQuery: import_vitest.vi.fn(),
|
|
34
34
|
useReadQuery: import_vitest.vi.fn()
|
|
35
35
|
};
|
|
36
36
|
});
|
|
37
|
-
const mockUseBackgroundQuery =
|
|
38
|
-
const mockUseReadQuery =
|
|
37
|
+
const mockUseBackgroundQuery = import_react2.useBackgroundQuery;
|
|
38
|
+
const mockUseReadQuery = import_react2.useReadQuery;
|
|
39
39
|
(0, import_vitest.describe)("createSuspendingCell", () => {
|
|
40
40
|
(0, import_vitest.beforeAll)(() => {
|
|
41
41
|
globalThis.RWJS_ENV = {
|
|
@@ -58,8 +58,8 @@ const mockUseReadQuery = import_hooks.useReadQuery;
|
|
|
58
58
|
Success: () => /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, "Great success!")
|
|
59
59
|
});
|
|
60
60
|
mockUseReadQuery.mockImplementation(() => ({ data: {} }));
|
|
61
|
-
(0,
|
|
62
|
-
|
|
61
|
+
(0, import_react3.render)(/* @__PURE__ */ import_react.default.createElement(TestCell, null));
|
|
62
|
+
import_react3.screen.getByText(/^Great success!$/);
|
|
63
63
|
});
|
|
64
64
|
(0, import_vitest.test)("Renders Success with data", () => {
|
|
65
65
|
const TestCell = (0, import_createSuspendingCell.createSuspendingCell)({
|
|
@@ -70,9 +70,9 @@ const mockUseReadQuery = import_hooks.useReadQuery;
|
|
|
70
70
|
mockUseReadQuery.mockImplementation(() => {
|
|
71
71
|
return { data: { answer: 42 } };
|
|
72
72
|
});
|
|
73
|
-
(0,
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
(0, import_react3.render)(/* @__PURE__ */ import_react.default.createElement(TestCell, null));
|
|
74
|
+
import_react3.screen.getByText(/^What's the meaning of life\?$/);
|
|
75
|
+
import_react3.screen.getByText(/^42$/);
|
|
76
76
|
});
|
|
77
77
|
(0, import_vitest.test)("Renders Success if any of the fields have data (i.e. not just the first)", () => {
|
|
78
78
|
const TestCell = (0, import_createSuspendingCell.createSuspendingCell)({
|
|
@@ -89,8 +89,8 @@ const mockUseReadQuery = import_hooks.useReadQuery;
|
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
91
|
});
|
|
92
|
-
(0,
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
(0, import_react3.render)(/* @__PURE__ */ import_react.default.createElement(TestCell, null));
|
|
93
|
+
import_react3.screen.getByText(/bazinga/);
|
|
94
|
+
import_react3.screen.getByText(/kittens/);
|
|
95
95
|
});
|
|
96
96
|
});
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import './global.web-auto-imports.js';
|
|
|
2
2
|
import './config.js';
|
|
3
3
|
export { FatalErrorBoundary } from './components/FatalErrorBoundary.js';
|
|
4
4
|
export { FetchConfigProvider, useFetchConfig, } from './components/FetchConfigProvider.js';
|
|
5
|
-
export { useQuery, useMutation, useSubscription
|
|
5
|
+
export { useQuery, useMutation, useSubscription } from '@apollo/client/react';
|
|
6
6
|
export { useFragment } from './apollo/fragmentRegistry.js';
|
|
7
7
|
export type { FragmentHookOptions, FragmentHookResult, } from './apollo/fragmentRegistry.js';
|
|
8
8
|
export * from './components/cell/CellCacheContext.js';
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAA;AACrC,OAAO,aAAa,CAAA;AAEpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;AAEvE,OAAO,EACL,mBAAmB,EACnB,cAAc,GACf,MAAM,qCAAqC,CAAA;AAC5C,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAA;AACrC,OAAO,aAAa,CAAA;AAEpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;AAEvE,OAAO,EACL,mBAAmB,EACnB,cAAc,GACf,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,YAAY,EACV,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,8BAA8B,CAAA;AAErC,cAAc,uCAAuC,CAAA;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAE5E,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GAChB,MAAM,gCAAgC,CAAA;AAEvC,cAAc,cAAc,CAAA;AAE5B,cAAc,iCAAiC,CAAA;AAE/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,MAAM,IAAI,IAAI,EAAE,MAAM,EAAE,CAAA;AAEjC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AAErC,cAAc,8BAA8B,CAAA;AAE5C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -27,16 +27,16 @@ __export(index_exports, {
|
|
|
27
27
|
createFragmentCell: () => import_createFragmentCell.createFragmentCell,
|
|
28
28
|
useFetchConfig: () => import_FetchConfigProvider.useFetchConfig,
|
|
29
29
|
useFragment: () => import_fragmentRegistry.useFragment,
|
|
30
|
-
useMutation: () =>
|
|
31
|
-
useQuery: () =>
|
|
32
|
-
useSubscription: () =>
|
|
30
|
+
useMutation: () => import_react.useMutation,
|
|
31
|
+
useQuery: () => import_react.useQuery,
|
|
32
|
+
useSubscription: () => import_react.useSubscription
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(index_exports);
|
|
35
35
|
var import_global_web_auto_imports = require("./global.web-auto-imports.js");
|
|
36
36
|
var import_config = require("./config.js");
|
|
37
37
|
var import_FatalErrorBoundary = require("./components/FatalErrorBoundary.js");
|
|
38
38
|
var import_FetchConfigProvider = require("./components/FetchConfigProvider.js");
|
|
39
|
-
var
|
|
39
|
+
var import_react = require("@apollo/client/react");
|
|
40
40
|
var import_fragmentRegistry = require("./apollo/fragmentRegistry.js");
|
|
41
41
|
__reExport(index_exports, require("./components/cell/CellCacheContext.js"), module.exports);
|
|
42
42
|
var import_createCell = require("./components/cell/createCell.js");
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { GraphQLFormattedError } from 'graphql';
|
|
3
3
|
type RequestDetails = {
|
|
4
4
|
query: string;
|
|
5
5
|
operationName: string;
|
|
6
6
|
operationKind: string;
|
|
7
7
|
variables: any;
|
|
8
8
|
};
|
|
9
|
-
interface EnhancedGqlError extends
|
|
9
|
+
interface EnhancedGqlError extends GraphQLFormattedError {
|
|
10
10
|
__RedwoodEnhancedError: RequestDetails;
|
|
11
11
|
}
|
|
12
12
|
type ErrorWithRequestMeta = Error & {
|
|
13
13
|
mostRecentRequest?: RequestDetails;
|
|
14
|
-
|
|
14
|
+
errors?: EnhancedGqlError[];
|
|
15
15
|
mostRecentResponse?: any;
|
|
16
16
|
};
|
|
17
17
|
export declare const DevFatalErrorPage: (props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevFatalErrorPage.d.ts","sourceRoot":"","sources":["../../src/components/DevFatalErrorPage.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAE1D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"DevFatalErrorPage.d.ts","sourceRoot":"","sources":["../../src/components/DevFatalErrorPage.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAE1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAmBpD,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,GAAG,CAAA;CACf,CAAA;AAED,UAAU,gBAAiB,SAAQ,qBAAqB;IACtD,sBAAsB,EAAE,cAAc,CAAA;CACvC;AAID,KAAK,oBAAoB,GAAG,KAAK,GAAG;IAClC,iBAAiB,CAAC,EAAE,cAAc,CAAA;IAClC,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC3B,kBAAkB,CAAC,EAAE,GAAG,CAAA;CACzB,CAAA;AAiGD,eAAO,MAAM,iBAAiB,GAAI,OAAO;IAAE,KAAK,CAAC,EAAE,oBAAoB,CAAA;CAAE,sBA4FxE,CAAA"}
|
|
@@ -19,7 +19,7 @@ function formatErrorForClipboard(err, stack, typeName, msg, errorWithMeta) {
|
|
|
19
19
|
lines.push(`ERROR TYPE: ${typeName}`);
|
|
20
20
|
lines.push(`ERROR MESSAGE: ${msg}`);
|
|
21
21
|
lines.push("");
|
|
22
|
-
const mostRecentRequest = errorWithMeta.mostRecentRequest || errorWithMeta.
|
|
22
|
+
const mostRecentRequest = errorWithMeta.mostRecentRequest || errorWithMeta.errors?.find((gqlErr) => gqlErr.__RedwoodEnhancedError)?.__RedwoodEnhancedError;
|
|
23
23
|
if (mostRecentRequest) {
|
|
24
24
|
lines.push("-".repeat(80));
|
|
25
25
|
lines.push("REQUEST CONTEXT");
|
|
@@ -194,7 +194,7 @@ function ResponseRequest(props) {
|
|
|
194
194
|
if (!props.error) {
|
|
195
195
|
return null;
|
|
196
196
|
}
|
|
197
|
-
const mostRecentRequest = props.error.mostRecentRequest || props.error.
|
|
197
|
+
const mostRecentRequest = props.error.mostRecentRequest || props.error.errors?.find((gqlErr) => gqlErr.__RedwoodEnhancedError)?.__RedwoodEnhancedError;
|
|
198
198
|
const mostRecentResponse = props.error.mostRecentResponse;
|
|
199
199
|
return /* @__PURE__ */ React.createElement("div", { className: "request-response" }, mostRecentRequest ? /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("h4", null, "Request: ", mostRecentRequest.operationName), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("h5", null, "Variables:"), /* @__PURE__ */ React.createElement("code", null, /* @__PURE__ */ React.createElement("pre", null, JSON.stringify(mostRecentRequest.variables, null, " ")))), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("h5", null, "Query:"), /* @__PURE__ */ React.createElement("code", null, /* @__PURE__ */ React.createElement(
|
|
200
200
|
"pre",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { useQuery } from '@apollo/client/react';
|
|
3
3
|
import type { CellFailureProps } from './cellTypes.js';
|
|
4
4
|
export type FallbackProps = {
|
|
5
|
-
error:
|
|
5
|
+
error: useQuery.Result['error'];
|
|
6
6
|
resetErrorBoundary: () => void;
|
|
7
7
|
};
|
|
8
8
|
export type CellErrorBoundaryProps = {
|
|
@@ -11,7 +11,7 @@ export type CellErrorBoundaryProps = {
|
|
|
11
11
|
};
|
|
12
12
|
interface ErrState {
|
|
13
13
|
hasError: boolean;
|
|
14
|
-
error?:
|
|
14
|
+
error?: useQuery.Result['error'];
|
|
15
15
|
}
|
|
16
16
|
export declare class CellErrorBoundary extends React.Component<CellErrorBoundaryProps, ErrState> {
|
|
17
17
|
constructor(props: CellErrorBoundaryProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/components/cell/CellErrorBoundary.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"CellErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/components/cell/CellErrorBoundary.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAEpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEtD,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAC/B,kBAAkB,EAAE,MAAM,IAAI,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IAGnC,cAAc,EAAE,CACd,OAAO,EAAE,aAAa,KACnB,KAAK,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAA;IACzC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CAAA;AAED,UAAU,QAAQ;IAChB,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;CACjC;AAED,qBAAa,iBAAkB,SAAQ,KAAK,CAAC,SAAS,CACpD,sBAAsB,EACtB,QAAQ,CACT;gBACa,KAAK,EAAE,sBAAsB;IAKzC,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK;;;;IAI5C,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS;IAQ1D,MAAM;CAgBP"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ComponentProps, JSXElementConstructor } from 'react';
|
|
2
|
-
import type { ApolloClient, NetworkStatus, OperationVariables
|
|
2
|
+
import type { ApolloClient, NetworkStatus, OperationVariables } from '@apollo/client';
|
|
3
|
+
import type { QueryRef, useBackgroundQuery, useQuery } from '@apollo/client/react';
|
|
3
4
|
import type { DocumentNode } from 'graphql';
|
|
4
5
|
import type { A, L, O, U } from 'ts-toolbelt';
|
|
5
6
|
/**
|
|
@@ -27,7 +28,7 @@ export type CellLoadingProps<TVariables extends OperationVariables = any> = {
|
|
|
27
28
|
} & InputVarProps<TVariables>;
|
|
28
29
|
export type CellFailureProps<TVariables extends OperationVariables = any> = {
|
|
29
30
|
queryResult?: NonSuspenseCellQueryResult<TVariables, any> | SuspenseCellQueryResult;
|
|
30
|
-
error?:
|
|
31
|
+
error?: useQuery.Result['error'] | Error;
|
|
31
32
|
/**
|
|
32
33
|
* @see {@link https://www.apollographql.com/docs/apollo-server/data/errors/#error-codes}
|
|
33
34
|
*/
|
|
@@ -155,9 +156,9 @@ export type SuspendingSuccessProps = React.PropsWithChildren<Record<string, unkn
|
|
|
155
156
|
suspenseQueryResult: SuspenseCellQueryResult<DataObject, any>;
|
|
156
157
|
userProps: Record<string, any>;
|
|
157
158
|
};
|
|
158
|
-
export type NonSuspenseCellQueryResult<TVariables extends OperationVariables = any, TData = any> = Partial<Omit<
|
|
159
|
-
export interface SuspenseCellQueryResult<_TData = any, _TVariables extends OperationVariables = any> extends
|
|
160
|
-
client: ApolloClient
|
|
159
|
+
export type NonSuspenseCellQueryResult<TVariables extends OperationVariables = any, TData = any> = Partial<Omit<useQuery.Result<TData, TVariables>, 'loading' | 'error' | 'data'>>;
|
|
160
|
+
export interface SuspenseCellQueryResult<_TData = any, _TVariables extends OperationVariables = any> extends useBackgroundQuery.Result {
|
|
161
|
+
client: ApolloClient;
|
|
161
162
|
networkStatus?: NetworkStatus;
|
|
162
163
|
called: boolean;
|
|
163
164
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cellTypes.d.ts","sourceRoot":"","sources":["../../../src/components/cell/cellTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK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M,EAAE,YAAY,CAAA;IAEpB,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,MAAM,EAAE,OAAO,CAAA;CAChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCell.d.ts","sourceRoot":"","sources":["../../../src/components/cell/createCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"createCell.d.ts","sourceRoot":"","sources":["../../../src/components/cell/createCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB,OAAO,KAAK,EAAE,eAAe,EAAc,MAAM,gBAAgB,CAAA;AAKjE,wBAAgB,UAAU,CACxB,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACzC,aAAa,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAE7C,eAAe,EAAE,eAAe,CAAC,SAAS,EAAE,aAAa,CAAC,GACzD,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,CAiCrB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { CombinedGraphQLErrors } from "@apollo/client";
|
|
3
|
+
import { useQuery } from "@apollo/client/react";
|
|
3
4
|
import { fragmentRegistry } from "../../apollo/fragmentRegistry.js";
|
|
4
5
|
import { getOperationName } from "../../graphql.js";
|
|
5
6
|
import { useCellCacheContext } from "./CellCacheContext.js";
|
|
@@ -96,7 +97,7 @@ function createNonSuspendingCell({
|
|
|
96
97
|
error,
|
|
97
98
|
errorCode: (
|
|
98
99
|
// Use the ad-hoc QueryResultWithErrorCode type to access the errorCode
|
|
99
|
-
queryResult.errorCode ?? error.
|
|
100
|
+
queryResult.errorCode ?? (CombinedGraphQLErrors.is(error) ? error.errors[0]?.extensions?.["code"] : void 0)
|
|
100
101
|
),
|
|
101
102
|
...props,
|
|
102
103
|
updating: loading,
|
|
@@ -104,7 +105,7 @@ function createNonSuspendingCell({
|
|
|
104
105
|
}
|
|
105
106
|
);
|
|
106
107
|
} else {
|
|
107
|
-
throw error;
|
|
108
|
+
throw error instanceof Error ? error : new Error(error.message);
|
|
108
109
|
}
|
|
109
110
|
} else if (data) {
|
|
110
111
|
const afterQueryData = afterQuery(data);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { useQuery } from "@apollo/client/react
|
|
2
|
+
import { useQuery } from "@apollo/client/react";
|
|
3
3
|
import { render, screen } from "@testing-library/react";
|
|
4
4
|
import { vi, describe, beforeAll, beforeEach, test, expect } from "vitest";
|
|
5
5
|
import { createCell } from "./createCell.js";
|
|
6
|
-
vi.mock("@apollo/client/react
|
|
6
|
+
vi.mock("@apollo/client/react", () => ({
|
|
7
7
|
useQuery: vi.fn()
|
|
8
8
|
}));
|
|
9
9
|
const mockUseQuery = useQuery;
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { useApolloClient, useFragment } from "@apollo/client";
|
|
3
|
-
import { useQuery } from "@apollo/client/react/hooks/hooks.cjs";
|
|
2
|
+
import { useApolloClient, useFragment, useQuery } from "@apollo/client/react";
|
|
4
3
|
import { render, screen } from "@testing-library/react";
|
|
5
4
|
import { parse } from "graphql";
|
|
6
5
|
import { vi, describe, beforeAll, beforeEach, test, expect } from "vitest";
|
|
7
6
|
import { fragmentRegistry } from "../../apollo/fragmentRegistry.js";
|
|
8
7
|
import { createCell } from "./createCell.js";
|
|
9
|
-
vi.mock("@apollo/client", async (importOriginal) => {
|
|
8
|
+
vi.mock("@apollo/client/react", async (importOriginal) => {
|
|
10
9
|
const actual = await importOriginal();
|
|
11
10
|
return {
|
|
12
11
|
...actual,
|
|
13
12
|
useApolloClient: vi.fn(),
|
|
14
|
-
useFragment: vi.fn()
|
|
13
|
+
useFragment: vi.fn(),
|
|
14
|
+
useQuery: vi.fn()
|
|
15
15
|
};
|
|
16
16
|
});
|
|
17
|
-
vi.mock("@apollo/client/react/hooks/hooks.cjs", () => ({
|
|
18
|
-
useQuery: vi.fn()
|
|
19
|
-
}));
|
|
20
17
|
const mockUseApolloClient = useApolloClient;
|
|
21
18
|
const mockApolloUseFragment = useFragment;
|
|
22
19
|
const mockUseQuery = useQuery;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSuspendingCell.d.ts","sourceRoot":"","sources":["../../../src/components/cell/createSuspendingCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"createSuspendingCell.d.ts","sourceRoot":"","sources":["../../../src/components/cell/createSuspendingCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAavC,OAAO,KAAK,EACV,eAAe,EAIhB,MAAM,gBAAgB,CAAA;AAGvB,KAAK,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AACrC;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,SAAS,MAAM,EACxB,aAAa,SAAS,MAAM,EAE5B,eAAe,EAAE,eAAe,CAAC,MAAM,EAAE,aAAa,CAAC,GACtD,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,CA6JrB"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { Suspense } from "react";
|
|
2
|
+
import { CombinedGraphQLErrors } from "@apollo/client";
|
|
2
3
|
import {
|
|
3
4
|
useApolloClient,
|
|
4
5
|
useBackgroundQuery,
|
|
5
6
|
useReadQuery
|
|
6
|
-
} from "@apollo/client/react
|
|
7
|
+
} from "@apollo/client/react";
|
|
7
8
|
import { CellErrorBoundary } from "./CellErrorBoundary.js";
|
|
8
9
|
import { isDataEmpty } from "./isCellEmpty.js";
|
|
9
10
|
function createSuspendingCell(createCellProps) {
|
|
@@ -77,7 +78,7 @@ function createSuspendingCell(createCellProps) {
|
|
|
77
78
|
const FailureComponent = ({ error, resetErrorBoundary }) => {
|
|
78
79
|
if (!Failure) {
|
|
79
80
|
if (error) {
|
|
80
|
-
throw error;
|
|
81
|
+
throw error instanceof Error ? error : new Error(error.message);
|
|
81
82
|
}
|
|
82
83
|
throw new Error("Unreachable code: FailureComponent without a Failure");
|
|
83
84
|
}
|
|
@@ -92,7 +93,7 @@ function createSuspendingCell(createCellProps) {
|
|
|
92
93
|
Failure,
|
|
93
94
|
{
|
|
94
95
|
error,
|
|
95
|
-
errorCode: error
|
|
96
|
+
errorCode: CombinedGraphQLErrors.is(error) ? error.errors[0]?.extensions?.["code"] : void 0,
|
|
96
97
|
queryResult: queryResultWithErrorReset
|
|
97
98
|
}
|
|
98
99
|
);
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { loadErrorMessages, loadDevMessages } from "@apollo/client/dev";
|
|
3
|
-
import {
|
|
4
|
-
useBackgroundQuery,
|
|
5
|
-
useReadQuery
|
|
6
|
-
} from "@apollo/client/react/hooks/hooks.cjs";
|
|
3
|
+
import { useBackgroundQuery, useReadQuery } from "@apollo/client/react";
|
|
7
4
|
import { render, screen } from "@testing-library/react";
|
|
8
5
|
import { vi, describe, beforeAll, beforeEach, test } from "vitest";
|
|
9
6
|
import { createSuspendingCell } from "./createSuspendingCell.js";
|
|
10
|
-
vi.mock("@apollo/client/react
|
|
7
|
+
vi.mock("@apollo/client/react", () => {
|
|
11
8
|
return {
|
|
12
9
|
useApolloClient: vi.fn(),
|
|
13
10
|
useBackgroundQuery: vi.fn(),
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import './global.web-auto-imports.js';
|
|
|
2
2
|
import './config.js';
|
|
3
3
|
export { FatalErrorBoundary } from './components/FatalErrorBoundary.js';
|
|
4
4
|
export { FetchConfigProvider, useFetchConfig, } from './components/FetchConfigProvider.js';
|
|
5
|
-
export { useQuery, useMutation, useSubscription
|
|
5
|
+
export { useQuery, useMutation, useSubscription } from '@apollo/client/react';
|
|
6
6
|
export { useFragment } from './apollo/fragmentRegistry.js';
|
|
7
7
|
export type { FragmentHookOptions, FragmentHookResult, } from './apollo/fragmentRegistry.js';
|
|
8
8
|
export * from './components/cell/CellCacheContext.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAA;AACrC,OAAO,aAAa,CAAA;AAEpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;AAEvE,OAAO,EACL,mBAAmB,EACnB,cAAc,GACf,MAAM,qCAAqC,CAAA;AAC5C,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAA;AACrC,OAAO,aAAa,CAAA;AAEpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;AAEvE,OAAO,EACL,mBAAmB,EACnB,cAAc,GACf,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,YAAY,EACV,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,8BAA8B,CAAA;AAErC,cAAc,uCAAuC,CAAA;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAE5E,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GAChB,MAAM,gCAAgC,CAAA;AAEvC,cAAc,cAAc,CAAA;AAE5B,cAAc,iCAAiC,CAAA;AAE/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,MAAM,IAAI,IAAI,EAAE,MAAM,EAAE,CAAA;AAEjC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AAErC,cAAc,8BAA8B,CAAA;AAE5C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -5,11 +5,7 @@ import {
|
|
|
5
5
|
FetchConfigProvider,
|
|
6
6
|
useFetchConfig
|
|
7
7
|
} from "./components/FetchConfigProvider.js";
|
|
8
|
-
import {
|
|
9
|
-
useQuery,
|
|
10
|
-
useMutation,
|
|
11
|
-
useSubscription
|
|
12
|
-
} from "@apollo/client/react/hooks/hooks.cjs";
|
|
8
|
+
import { useQuery, useMutation, useSubscription } from "@apollo/client/react";
|
|
13
9
|
import { useFragment } from "./apollo/fragmentRegistry.js";
|
|
14
10
|
export * from "./components/cell/CellCacheContext.js";
|
|
15
11
|
import { createCell } from "./components/cell/createCell.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/web",
|
|
3
|
-
"version": "6.0.0-canary.
|
|
3
|
+
"version": "6.0.0-canary.2665",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -149,34 +149,35 @@
|
|
|
149
149
|
"test:watch": "vitest watch"
|
|
150
150
|
},
|
|
151
151
|
"dependencies": {
|
|
152
|
-
"@apollo/client": "
|
|
153
|
-
"@cedarjs/server-store": "6.0.0-canary.
|
|
152
|
+
"@apollo/client": "4.2.7",
|
|
153
|
+
"@cedarjs/server-store": "6.0.0-canary.2665",
|
|
154
154
|
"@dr.pogodin/react-helmet": "2.0.4",
|
|
155
155
|
"@whatwg-node/fetch": "0.10.13",
|
|
156
|
-
"apollo-upload-client": "
|
|
156
|
+
"apollo-upload-client": "19.0.0",
|
|
157
157
|
"cookie": "1.1.1",
|
|
158
158
|
"graphql": "16.14.2",
|
|
159
159
|
"graphql-sse": "2.6.0",
|
|
160
160
|
"graphql-tag": "2.12.6",
|
|
161
161
|
"react-hot-toast": "2.6.0",
|
|
162
|
+
"rxjs": "7.8.2",
|
|
162
163
|
"stacktracey": "2.2.0",
|
|
163
164
|
"ts-toolbelt": "9.6.0"
|
|
164
165
|
},
|
|
165
166
|
"devDependencies": {
|
|
166
|
-
"@apollo/client-react-streaming": "0.
|
|
167
|
+
"@apollo/client-react-streaming": "0.14.5",
|
|
167
168
|
"@arethetypeswrong/cli": "0.18.5",
|
|
168
169
|
"@babel/cli": "7.29.7",
|
|
169
170
|
"@babel/core": "^7.26.10",
|
|
170
171
|
"@babel/plugin-transform-runtime": "7.29.7",
|
|
171
172
|
"@babel/runtime": "7.29.7",
|
|
172
|
-
"@cedarjs/auth": "6.0.0-canary.
|
|
173
|
-
"@cedarjs/framework-tools": "6.0.0-canary.
|
|
174
|
-
"@cedarjs/internal": "6.0.0-canary.
|
|
173
|
+
"@cedarjs/auth": "6.0.0-canary.2665",
|
|
174
|
+
"@cedarjs/framework-tools": "6.0.0-canary.2665",
|
|
175
|
+
"@cedarjs/internal": "6.0.0-canary.2665",
|
|
175
176
|
"@rollup/plugin-babel": "6.1.0",
|
|
176
177
|
"@testing-library/dom": "10.4.1",
|
|
177
178
|
"@testing-library/jest-dom": "6.9.1",
|
|
178
179
|
"@testing-library/react": "16.3.2",
|
|
179
|
-
"@types/apollo-upload-client": "^
|
|
180
|
+
"@types/apollo-upload-client": "^19",
|
|
180
181
|
"@types/react": "^18.2.55",
|
|
181
182
|
"@types/react-dom": "^18.2.19",
|
|
182
183
|
"concurrently": "9.2.1",
|