Socket
Socket
Sign inDemoInstall

@apollo/client

Package Overview
Dependencies
14
Maintainers
4
Versions
551
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.10.4 to 3.10.5

2

dev/dev.cjs.native.js

@@ -436,3 +436,3 @@ 'use strict';

var version = "3.10.4";
var version = "3.10.5";

@@ -439,0 +439,0 @@ function maybe(thunk) {

@@ -30,2 +30,3 @@ 'use strict';

var backupFetch = utilities.maybe(function () { return fetch; });
var BatchHttpLink = (function (_super) {

@@ -36,6 +37,5 @@ tslib.__extends(BatchHttpLink, _super);

var _a = fetchParams || {}, _b = _a.uri, uri = _b === void 0 ? "/graphql" : _b,
fetcher = _a.fetch, _c = _a.print, print = _c === void 0 ? http.defaultPrinter : _c, includeExtensions = _a.includeExtensions, preserveHeaderCase = _a.preserveHeaderCase, batchInterval = _a.batchInterval, batchDebounce = _a.batchDebounce, batchMax = _a.batchMax, batchKey = _a.batchKey, _d = _a.includeUnusedVariables, includeUnusedVariables = _d === void 0 ? false : _d, requestOptions = tslib.__rest(_a, ["uri", "fetch", "print", "includeExtensions", "preserveHeaderCase", "batchInterval", "batchDebounce", "batchMax", "batchKey", "includeUnusedVariables"]);
http.checkFetcher(fetcher);
if (!fetcher) {
fetcher = fetch;
preferredFetch = _a.fetch, _c = _a.print, print = _c === void 0 ? http.defaultPrinter : _c, includeExtensions = _a.includeExtensions, preserveHeaderCase = _a.preserveHeaderCase, batchInterval = _a.batchInterval, batchDebounce = _a.batchDebounce, batchMax = _a.batchMax, batchKey = _a.batchKey, _d = _a.includeUnusedVariables, includeUnusedVariables = _d === void 0 ? false : _d, requestOptions = tslib.__rest(_a, ["uri", "fetch", "print", "includeExtensions", "preserveHeaderCase", "batchInterval", "batchDebounce", "batchMax", "batchKey", "includeUnusedVariables"]);
if (globalThis.__DEV__ !== false) {
http.checkFetcher(preferredFetch || backupFetch);
}

@@ -107,3 +107,4 @@ var linkConfig = {

return new utilities.Observable(function (observer) {
fetcher(chosenURI, options)
var currentFetch = preferredFetch || utilities.maybe(function () { return fetch; }) || backupFetch;
currentFetch(chosenURI, options)
.then(function (response) {

@@ -110,0 +111,0 @@ operations.forEach(function (operation) {

import { __assign, __extends, __rest } from "tslib";
import { ApolloLink } from "../core/index.js";
import { Observable, hasDirectives, removeClientSetsFromDocument, } from "../../utilities/index.js";
import { Observable, hasDirectives, maybe, removeClientSetsFromDocument, } from "../../utilities/index.js";
import { fromError } from "../utils/index.js";

@@ -8,2 +8,3 @@ import { serializeFetchParameter, selectURI, parseAndCheckHttpResponse, checkFetcher, selectHttpOptionsAndBodyInternal, defaultPrinter, fallbackHttpConfig, } from "../http/index.js";

import { filterOperationVariables } from "../utils/filterOperationVariables.js";
var backupFetch = maybe(function () { return fetch; });
/**

@@ -19,10 +20,7 @@ * Transforms Operation for into HTTP results.

// use default global fetch if nothing is passed in
fetcher = _a.fetch, _c = _a.print, print = _c === void 0 ? defaultPrinter : _c, includeExtensions = _a.includeExtensions, preserveHeaderCase = _a.preserveHeaderCase, batchInterval = _a.batchInterval, batchDebounce = _a.batchDebounce, batchMax = _a.batchMax, batchKey = _a.batchKey, _d = _a.includeUnusedVariables, includeUnusedVariables = _d === void 0 ? false : _d, requestOptions = __rest(_a, ["uri", "fetch", "print", "includeExtensions", "preserveHeaderCase", "batchInterval", "batchDebounce", "batchMax", "batchKey", "includeUnusedVariables"]);
// dev warnings to ensure fetch is present
checkFetcher(fetcher);
//fetcher is set here rather than the destructuring to ensure fetch is
//declared before referencing it. Reference in the destructuring would cause
//a ReferenceError
if (!fetcher) {
fetcher = fetch;
preferredFetch = _a.fetch, _c = _a.print, print = _c === void 0 ? defaultPrinter : _c, includeExtensions = _a.includeExtensions, preserveHeaderCase = _a.preserveHeaderCase, batchInterval = _a.batchInterval, batchDebounce = _a.batchDebounce, batchMax = _a.batchMax, batchKey = _a.batchKey, _d = _a.includeUnusedVariables, includeUnusedVariables = _d === void 0 ? false : _d, requestOptions = __rest(_a, ["uri", "fetch", "print", "includeExtensions", "preserveHeaderCase", "batchInterval", "batchDebounce", "batchMax", "batchKey", "includeUnusedVariables"]);
if (globalThis.__DEV__ !== false) {
// Make sure at least one of preferredFetch, window.fetch, or backupFetch
// is defined, so requests won't fail at runtime.
checkFetcher(preferredFetch || backupFetch);
}

@@ -98,3 +96,10 @@ var linkConfig = {

return new Observable(function (observer) {
fetcher(chosenURI, options)
// Prefer BatchHttpLink.Options.fetch (preferredFetch) if provided, and
// otherwise fall back to the *current* global window.fetch function
// (see issue #7832), or (if all else fails) the backupFetch function we
// saved when this module was first evaluated. This last option protects
// against the removal of window.fetch, which is unlikely but not
// impossible.
var currentFetch = preferredFetch || maybe(function () { return fetch; }) || backupFetch;
currentFetch(chosenURI, options)
.then(function (response) {

@@ -101,0 +106,0 @@ // Make the raw response available in the context.

@@ -40,5 +40,6 @@ 'use strict';

networkError: networkError,
graphQLErrors: networkError &&
graphQLErrors: (networkError &&
networkError.result &&
networkError.result.errors,
networkError.result.errors) ||
void 0,
forward: forward,

@@ -45,0 +46,0 @@ });

@@ -36,5 +36,6 @@ import { __extends } from "tslib";

//Network errors can return GraphQL errors on for example a 403
graphQLErrors: networkError &&
graphQLErrors: (networkError &&
networkError.result &&
networkError.result.errors,
networkError.result.errors) ||
void 0,
forward: forward,

@@ -41,0 +42,0 @@ });

{
"name": "@apollo/client",
"version": "3.10.4",
"version": "3.10.5",
"description": "A fully-featured caching GraphQL client.",

@@ -98,7 +98,7 @@ "private": false,

"@types/use-sync-external-store": "0.0.6",
"@typescript-eslint/eslint-plugin": "7.8.0",
"@typescript-eslint/parser": "7.8.0",
"@typescript-eslint/rule-tester": "7.8.0",
"@typescript-eslint/types": "7.8.0",
"@typescript-eslint/utils": "7.8.0",
"@typescript-eslint/eslint-plugin": "7.9.0",
"@typescript-eslint/parser": "7.9.0",
"@typescript-eslint/rule-tester": "7.9.0",
"@typescript-eslint/types": "7.9.0",
"@typescript-eslint/utils": "7.9.0",
"acorn": "8.11.3",

@@ -112,2 +112,4 @@ "blob-polyfill": "7.0.20220408",

"eslint-plugin-local-rules": "2.0.1",
"eslint-plugin-react-compiler": "0.0.0-experimental-c8b3f72-20240517",
"eslint-plugin-react-hooks": "4.6.2",
"eslint-plugin-testing-library": "6.2.2",

@@ -127,4 +129,6 @@ "expect-type": "0.19.0",

"react-17": "npm:react@^17",
"react-19": "npm:react@19.0.0-rc-cc1ec60d0d-20240607",
"react-dom": "18.3.1",
"react-dom-17": "npm:react-dom@^17",
"react-dom-19": "npm:react-dom@19.0.0-rc-cc1ec60d0d-20240607",
"react-error-boundary": "4.0.13",

@@ -131,0 +135,0 @@ "recast": "0.23.6",

@@ -98,11 +98,22 @@ 'use strict';

function getRenderDispatcher() {
var _a, _b;
return (_b = (_a = React__namespace.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _a === void 0 ? void 0 : _a.ReactCurrentDispatcher) === null || _b === void 0 ? void 0 : _b.current;
}
var RenderDispatcher = null;
var Ctx;
function noop() { }
function useRenderGuard() {
RenderDispatcher = getRenderDispatcher();
return React__namespace.useCallback(function () {
return (RenderDispatcher != null && RenderDispatcher === getRenderDispatcher());
if (!Ctx) {
Ctx = React__namespace.createContext(null);
}
return React__namespace.useCallback(
function () {
var orig = console.error;
try {
console.error = noop;
React__namespace["useContext" ](Ctx);
return true;
}
catch (e) {
return false;
}
finally {
console.error = orig;
}
}, []);

@@ -152,10 +163,12 @@ }

function useInternalState(client, query) {
var stateRef = React__namespace.useRef();
if (!stateRef.current ||
client !== stateRef.current.client ||
query !== stateRef.current.query) {
stateRef.current = new InternalState(client, query, stateRef.current);
var forceUpdateState = React__namespace.useReducer(function (tick) { return tick + 1; }, 0)[1];
function createInternalState(previous) {
return Object.assign(new InternalState(client, query, previous), {
forceUpdateState: forceUpdateState,
});
}
var state = stateRef.current;
state.forceUpdateState = React__namespace.useReducer(function (tick) { return tick + 1; }, 0)[1];
var _a = React__namespace.useState(createInternalState), state = _a[0], updateState = _a[1];
if (client !== state.client || query !== state.query) {
updateState((state = createInternalState(state)));
}
return state;

@@ -223,3 +236,4 @@ }

var obsQuery = this.useObservableQuery();
var result = useSyncExternalStore(React__namespace.useCallback(function (handleStoreChange) {
var result = useSyncExternalStore(
React__namespace.useCallback(function (handleStoreChange) {
if (_this.renderPromises) {

@@ -459,13 +473,11 @@ return function () { };

internalState.getDefaultFetchPolicy();
var result = Object.assign(useQueryResult, {
called: !!execOptionsRef.current,
});
var forceUpdateState = internalState.forceUpdateState, obsQueryFields = internalState.obsQueryFields;
var eagerMethods = React__namespace.useMemo(function () {
var eagerMethods = {};
var _loop_1 = function (key) {
var method = result[key];
var method = obsQueryFields[key];
eagerMethods[key] = function () {
if (!execOptionsRef.current) {
execOptionsRef.current = Object.create(null);
internalState.forceUpdateState();
forceUpdateState();
}

@@ -480,4 +492,5 @@ return method.apply(this, arguments);

return eagerMethods;
}, []);
Object.assign(result, eagerMethods);
}, [forceUpdateState, obsQueryFields]);
var called = !!execOptionsRef.current;
var result = React__namespace.useMemo(function () { return (tslib.__assign(tslib.__assign(tslib.__assign({}, useQueryResult), eagerMethods), { called: called })); }, [useQueryResult, eagerMethods, called]);
var execute = React__namespace.useCallback(function (executeOptions) {

@@ -494,3 +507,3 @@ execOptionsRef.current =

return promise;
}, []);
}, [eagerMethods, initialFetchPolicy, internalState]);
return [execute, result];

@@ -515,5 +528,5 @@ }

});
{
React__namespace.useLayoutEffect(function () {
Object.assign(ref.current, { client: client, options: options, mutation: mutation });
}
});
var execute = React__namespace.useCallback(function (executeOptions) {

@@ -592,3 +605,7 @@ if (executeOptions === void 0) { executeOptions = {}; }

if (ref.current.isMounted) {
var result_3 = { called: false, loading: false, client: client };
var result_3 = {
called: false,
loading: false,
client: ref.current.client,
};
Object.assign(ref.current, { mutationId: 0, result: result_3 });

@@ -599,5 +616,6 @@ setResult(result_3);

React__namespace.useEffect(function () {
ref.current.isMounted = true;
var current = ref.current;
current.isMounted = true;
return function () {
ref.current.isMounted = false;
current.isMounted = false;
};

@@ -858,7 +876,7 @@ }, []);

var result = fetchPolicy === "standby" ? skipResult : __use(promise);
var fetchMore = React__namespace.useCallback((function (options) {
var fetchMore = React__namespace.useCallback(function (options) {
var promise = queryRef.fetchMore(options);
setPromise([queryRef.key, queryRef.promise]);
return promise;
}), [queryRef]);
}, [queryRef]);
var refetch = React__namespace.useCallback(function (variables) {

@@ -1026,6 +1044,13 @@ var promise = queryRef.refetch(variables);

setQueryRef(internal.wrapQueryRef(queryRef));
}, [query, queryKey, suspenseCache, watchQueryOptions, calledDuringRender]);
}, [
query,
queryKey,
suspenseCache,
watchQueryOptions,
calledDuringRender,
client,
]);
var reset = React__namespace.useCallback(function () {
setQueryRef(null);
}, [queryRef]);
}, []);
return [loadQuery, queryRef, { fetchMore: fetchMore, refetch: refetch, reset: reset }];

@@ -1085,3 +1110,3 @@ }

});
}, [internalQueryRef]), getPromise, getPromise);
}, [internalQueryRef, queryRef]), getPromise, getPromise);
var result = __use(promise);

@@ -1088,0 +1113,0 @@ return React__namespace.useMemo(function () {

import * as React from "rehackt";
function getRenderDispatcher() {
var _a, _b;
return (_b = (_a = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _a === void 0 ? void 0 : _a.ReactCurrentDispatcher) === null || _b === void 0 ? void 0 : _b.current;
}
var RenderDispatcher = null;
/*
Relay does this too, so we hope this is safe.
https://github.com/facebook/relay/blob/8651fbca19adbfbb79af7a3bc40834d105fd7747/packages/react-relay/relay-hooks/loadQuery.js#L90-L98
*/
var Ctx;
function noop() { }
export function useRenderGuard() {
RenderDispatcher = getRenderDispatcher();
return React.useCallback(function () {
return (RenderDispatcher != null && RenderDispatcher === getRenderDispatcher());
if (!Ctx) {
// we want the intialization to be lazy because `createContext` would error on import in a RSC
Ctx = React.createContext(null);
}
return React.useCallback(
/**
* @returns true if the hook was called during render
*/ function () {
var orig = console.error;
try {
console.error = noop;
/**
* `useContext` can be called conditionally during render, so this is safe.
* (Also, during render we would want to throw as a reaction to this anyways, so it
* wouldn't even matter if we got the order of hooks mixed up...)
*
* They cannot however be called outside of Render, and that's what we're testing here.
*
* Different versions of React have different behaviour on an invalid hook call:
*
* React 16.8 - 17: throws an error
* https://github.com/facebook/react/blob/2b93d686e359c7afa299e2ec5cf63160a32a1155/packages/react/src/ReactHooks.js#L18-L26
*
* React 18 & 19: `console.error` in development, then `resolveDispatcher` returns `null` and a member access on `null` throws.
* https://github.com/facebook/react/blob/58e8304483ebfadd02a295339b5e9a989ac98c6e/packages/react/src/ReactHooks.js#L28-L35
*/
React["useContext" /* hide this from the linter */](Ctx);
return true;
}
catch (e) {
return false;
}
finally {
console.error = orig;
}
}, []);
}
//# sourceMappingURL=useRenderGuard.js.map

@@ -66,5 +66,3 @@ import { __assign } from "tslib";

internalState.getDefaultFetchPolicy();
var result = Object.assign(useQueryResult, {
called: !!execOptionsRef.current,
});
var forceUpdateState = internalState.forceUpdateState, obsQueryFields = internalState.obsQueryFields;
// We use useMemo here to make sure the eager methods have a stable identity.

@@ -74,3 +72,3 @@ var eagerMethods = React.useMemo(function () {

var _loop_1 = function (key) {
var method = result[key];
var method = obsQueryFields[key];
eagerMethods[key] = function () {

@@ -80,3 +78,3 @@ if (!execOptionsRef.current) {

// Only the first time populating execOptionsRef.current matters here.
internalState.forceUpdateState();
forceUpdateState();
}

@@ -92,4 +90,5 @@ // @ts-expect-error this is just too generic to type

return eagerMethods;
}, []);
Object.assign(result, eagerMethods);
}, [forceUpdateState, obsQueryFields]);
var called = !!execOptionsRef.current;
var result = React.useMemo(function () { return (__assign(__assign(__assign({}, useQueryResult), eagerMethods), { called: called })); }, [useQueryResult, eagerMethods, called]);
var execute = React.useCallback(function (executeOptions) {

@@ -108,5 +107,5 @@ execOptionsRef.current =

return promise;
}, []);
}, [eagerMethods, initialFetchPolicy, internalState]);
return [execute, result];
}
//# sourceMappingURL=useLazyQuery.js.map

@@ -11,3 +11,3 @@ import type { DocumentNode, OperationVariables, TypedDocumentNode } from "../../core/index.js";

queryRef: QueryRef<TData, TVariables> | null,
{
handlers: {
/**

@@ -14,0 +14,0 @@ * A function that helps you fetch the next set of results for a [paginated list field](https://www.apollographql.com/docs/react/pagination/core-api/).

@@ -54,8 +54,15 @@ import { __assign, __spreadArray } from "tslib";

setQueryRef(wrapQueryRef(queryRef));
}, [query, queryKey, suspenseCache, watchQueryOptions, calledDuringRender]);
}, [
query,
queryKey,
suspenseCache,
watchQueryOptions,
calledDuringRender,
client,
]);
var reset = React.useCallback(function () {
setQueryRef(null);
}, [queryRef]);
}, []);
return [loadQuery, queryRef, { fetchMore: fetchMore, refetch: refetch, reset: reset }];
}
//# sourceMappingURL=useLoadableQuery.js.map

@@ -71,7 +71,5 @@ import { __assign } from "tslib";

});
// TODO: Trying to assign these in a useEffect or useLayoutEffect breaks
// higher-order components.
{
React.useLayoutEffect(function () {
Object.assign(ref.current, { client: client, options: options, mutation: mutation });
}
});
var execute = React.useCallback(function (executeOptions) {

@@ -151,3 +149,7 @@ if (executeOptions === void 0) { executeOptions = {}; }

if (ref.current.isMounted) {
var result_3 = { called: false, loading: false, client: client };
var result_3 = {
called: false,
loading: false,
client: ref.current.client,
};
Object.assign(ref.current, { mutationId: 0, result: result_3 });

@@ -158,5 +160,6 @@ setResult(result_3);

React.useEffect(function () {
ref.current.isMounted = true;
var current = ref.current;
current.isMounted = true;
return function () {
ref.current.isMounted = false;
current.isMounted = false;
};

@@ -163,0 +166,0 @@ }, []);

import type { OperationVariables, WatchQueryFetchPolicy } from "../../core/index.js";
import type { ApolloClient, ApolloQueryResult, DocumentNode, TypedDocumentNode } from "../../core/index.js";
import type { QueryHookOptions, QueryResult, NoInfer } from "../types/types.js";
import type { QueryHookOptions, QueryResult, ObservableQueryFields, NoInfer } from "../types/types.js";
import { useApolloClient } from "./useApolloClient.js";

@@ -74,3 +74,3 @@ /**

private observable;
private obsQueryFields;
obsQueryFields: Omit<ObservableQueryFields<TData, TVariables>, "variables">;
private useObservableQuery;

@@ -77,0 +77,0 @@ private result;

@@ -57,16 +57,23 @@ import { __assign, __rest } from "tslib";

export function useInternalState(client, query) {
var stateRef = React.useRef();
if (!stateRef.current ||
client !== stateRef.current.client ||
query !== stateRef.current.query) {
stateRef.current = new InternalState(client, query, stateRef.current);
}
var state = stateRef.current;
// By default, InternalState.prototype.forceUpdate is an empty function, but
// we replace it here (before anyone has had a chance to see this state yet)
// with a function that unconditionally forces an update, using the latest
// setTick function. Updating this state by calling state.forceUpdate is the
// only way we trigger React component updates (no other useState calls within
// the InternalState class).
state.forceUpdateState = React.useReducer(function (tick) { return tick + 1; }, 0)[1];
// setTick function. Updating this state by calling state.forceUpdate or the
// uSES notification callback are the only way we trigger React component updates.
var forceUpdateState = React.useReducer(function (tick) { return tick + 1; }, 0)[1];
function createInternalState(previous) {
return Object.assign(new InternalState(client, query, previous), {
forceUpdateState: forceUpdateState,
});
}
var _a = React.useState(createInternalState), state = _a[0], updateState = _a[1];
if (client !== state.client || query !== state.query) {
// If the client or query have changed, we need to create a new InternalState.
// This will trigger a re-render with the new state, but it will also continue
// to run the current render function to completion.
// Since we sometimes trigger some side-effects in the render function, we
// re-assign `state` to the new state to ensure that those side-effects are
// triggered with the new state.
updateState((state = createInternalState(state)));
}
return state;

@@ -165,6 +172,10 @@ }

// rather than left uninitialized.
// eslint-disable-next-line react-hooks/rules-of-hooks
this.renderPromises = React.useContext(getApolloContext()).renderPromises;
this.useOptions(options);
var obsQuery = this.useObservableQuery();
var result = useSyncExternalStore(React.useCallback(function (handleStoreChange) {
// eslint-disable-next-line react-hooks/rules-of-hooks
var result = useSyncExternalStore(
// eslint-disable-next-line react-hooks/rules-of-hooks
React.useCallback(function (handleStoreChange) {
if (_this.renderPromises) {

@@ -225,3 +236,5 @@ return function () { };

obsQuery,
// eslint-disable-next-line react-hooks/exhaustive-deps
this.renderPromises,
// eslint-disable-next-line react-hooks/exhaustive-deps
this.client.disableNetworkFetches,

@@ -374,2 +387,3 @@ ]), function () { return _this.getCurrentResult(); }, function () { return _this.getCurrentResult(); });

this.client.watchQuery(this.getObsQueryOptions()));
// eslint-disable-next-line react-hooks/rules-of-hooks
this.obsQueryFields = React.useMemo(function () { return ({

@@ -376,0 +390,0 @@ refetch: obsQuery.refetch.bind(obsQuery),

@@ -32,2 +32,6 @@ import * as React from "rehackt";

// the transported object
// This is just a context read - it's fine to do this conditionally.
// This hook wrapper also shouldn't be optimized by React Compiler.
// eslint-disable-next-line react-compiler/react-compiler
// eslint-disable-next-line react-hooks/rules-of-hooks
: useApolloClient())(queryRef);

@@ -34,0 +38,0 @@ }

@@ -15,2 +15,6 @@ import * as React from "rehackt";

// the transported object
// This is just a context read - it's fine to do this conditionally.
// This hook wrapper also shouldn't be optimized by React Compiler.
// eslint-disable-next-line react-compiler/react-compiler
// eslint-disable-next-line react-hooks/rules-of-hooks
: useApolloClient())(queryRef);

@@ -32,3 +36,3 @@ }

});
}, [internalQueryRef]), getPromise, getPromise);
}, [internalQueryRef, queryRef]), getPromise, getPromise);
var result = __use(promise);

@@ -35,0 +39,0 @@ return React.useMemo(function () {

@@ -169,2 +169,4 @@ import { invariant } from "../../utilities/globals/index.js";

Object.assign(ref.current, { client: client, subscription: subscription, options: options });
// eslint-disable-next-line react-compiler/react-compiler
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [client, subscription, options, canResetObservableRef.current]);

@@ -237,2 +239,4 @@ React.useEffect(function () {

};
// eslint-disable-next-line react-compiler/react-compiler
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [observable]);

@@ -239,0 +243,0 @@ return result;

@@ -63,7 +63,7 @@ import { __assign, __spreadArray } from "tslib";

var result = fetchPolicy === "standby" ? skipResult : __use(promise);
var fetchMore = React.useCallback((function (options) {
var fetchMore = React.useCallback(function (options) {
var promise = queryRef.fetchMore(options);
setPromise([queryRef.key, queryRef.promise]);
return promise;
}), [queryRef]);
}, [queryRef]);
var refetch = React.useCallback(function (variables) {

@@ -70,0 +70,0 @@ var promise = queryRef.refetch(variables);

@@ -66,2 +66,4 @@ import { invariant } from "../../utilities/globals/index.js";

}
// React Hook React.useLayoutEffect has a missing dependency: 'inst'. Either include it or remove the dependency array.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [subscribe, value, getSnapshot]);

@@ -92,2 +94,4 @@ }

});
// React Hook React.useEffect has a missing dependency: 'inst'. Either include it or remove the dependency array.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [subscribe]);

@@ -94,0 +98,0 @@ return value;

@@ -11,3 +11,3 @@ 'use strict';

var version = "3.10.4";
var version = "3.10.5";

@@ -14,0 +14,0 @@ function maybe(thunk) {

import type { Operation, GraphQLRequest, FetchResult } from "../../../link/core/index.js";
import { ApolloLink } from "../../../link/core/index.js";
import { Observable } from "../../../utilities/index.js";
export type ResultFunction<T, V = Record<string, any>> = (variables: V) => T;
export type VariableMatcher<V = Record<string, any>> = (variables: V) => boolean;
export interface MockedResponse<TData = Record<string, any>, TVariables = Record<string, any>> {
/** @internal */
type CovariantUnaryFunction<out Arg, out Ret> = {
fn(arg: Arg): Ret;
}["fn"];
export type ResultFunction<T, V = Record<string, any>> = CovariantUnaryFunction<V, T>;
export type VariableMatcher<V = Record<string, any>> = CovariantUnaryFunction<V, boolean>;
export interface MockedResponse<out TData = Record<string, any>, out TVariables = Record<string, any>> {
request: GraphQLRequest<TVariables>;

@@ -33,2 +37,3 @@ maxUsageCount?: number;

export declare function mockSingleLink(...mockedResponses: Array<any>): MockApolloLink;
export {};
//# sourceMappingURL=mockLink.d.ts.map

@@ -282,9 +282,13 @@ var _a, _b;

}
function resolveHookOwner() {
function resolveR18HookOwner() {
var _a, _b, _c;
return (_c = (_b = (_a = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _a === void 0 ? void 0 : _a.ReactCurrentOwner) === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.elementType;
}
function resolveR19HookOwner() {
var _a, _b;
return (_b = (_a = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE) === null || _a === void 0 ? void 0 : _a.A) === null || _b === void 0 ? void 0 : _b.getOwner().elementType;
}
export function useTrackRenders(_a) {
var _b = _a === void 0 ? {} : _a, name = _b.name;
var component = name || resolveHookOwner();
var component = name || resolveR18HookOwner() || resolveR19HookOwner();
if (!component) {

@@ -291,0 +295,0 @@ throw new Error("useTrackRender: Unable to determine component. Please ensure the hook is called inside a rendered component or provide a `name` option.");

@@ -7,3 +7,3 @@ 'use strict';

var version = "3.10.4";
var version = "3.10.5";

@@ -10,0 +10,0 @@ function maybe(thunk) {

@@ -1,2 +0,2 @@

export var version = "3.10.4";
export var version = "3.10.5";
//# sourceMappingURL=version.js.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc