@isograph/react 0.0.0-main-003fa338 → 0.0.0-main-2eacee40
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.
@@ -5,6 +5,13 @@ const IsographEnvironmentProvider_1 = require("./IsographEnvironmentProvider");
|
|
5
5
|
const cache_1 = require("../core/cache");
|
6
6
|
const react_disposable_state_1 = require("@isograph/react-disposable-state");
|
7
7
|
function useLazyReference(entrypoint, variables) {
|
8
|
+
// @ts-expect-error
|
9
|
+
if (typeof window !== 'undefined' && window.__LOG) {
|
10
|
+
if ((entrypoint === null || entrypoint === void 0 ? void 0 : entrypoint.kind) !== 'Entrypoint') {
|
11
|
+
console.warn('useLazyReference was passed an unexpected or invalid object as the first parameter. ' +
|
12
|
+
'Is the babel plugin correctly configured? Received=', entrypoint);
|
13
|
+
}
|
14
|
+
}
|
8
15
|
const environment = (0, IsographEnvironmentProvider_1.useIsographEnvironment)();
|
9
16
|
const cache = (0, cache_1.getOrCreateCacheForArtifact)(environment, entrypoint, variables);
|
10
17
|
return {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@isograph/react",
|
3
|
-
"version": "0.0.0-main-
|
3
|
+
"version": "0.0.0-main-2eacee40",
|
4
4
|
"description": "Use Isograph with React",
|
5
5
|
"homepage": "https://isograph.dev",
|
6
6
|
"main": "dist/index.js",
|
@@ -17,9 +17,9 @@
|
|
17
17
|
"tsc": "tsc"
|
18
18
|
},
|
19
19
|
"dependencies": {
|
20
|
-
"@isograph/disposable-types": "0.0.0-main-
|
21
|
-
"@isograph/react-disposable-state": "0.0.0-main-
|
22
|
-
"@isograph/reference-counted-pointer": "0.0.0-main-
|
20
|
+
"@isograph/disposable-types": "0.0.0-main-2eacee40",
|
21
|
+
"@isograph/react-disposable-state": "0.0.0-main-2eacee40",
|
22
|
+
"@isograph/reference-counted-pointer": "0.0.0-main-2eacee40"
|
23
23
|
},
|
24
24
|
"peerDependencies": {
|
25
25
|
"react": "18.2.0"
|
@@ -13,6 +13,17 @@ export function useLazyReference<
|
|
13
13
|
): {
|
14
14
|
fragmentReference: FragmentReference<TReadFromStore, TClientFieldValue>;
|
15
15
|
} {
|
16
|
+
// @ts-expect-error
|
17
|
+
if (typeof window !== 'undefined' && window.__LOG) {
|
18
|
+
if (entrypoint?.kind !== 'Entrypoint') {
|
19
|
+
console.warn(
|
20
|
+
'useLazyReference was passed an unexpected or invalid object as the first parameter. ' +
|
21
|
+
'Is the babel plugin correctly configured? Received=',
|
22
|
+
entrypoint,
|
23
|
+
);
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
16
27
|
const environment = useIsographEnvironment();
|
17
28
|
const cache = getOrCreateCacheForArtifact(environment, entrypoint, variables);
|
18
29
|
|