Skip to content

Commit 3bbf63f

Browse files
committed
chore(shared): Remove patch for swr-devtools
1 parent 14895e2 commit 3bbf63f

5 files changed

Lines changed: 6 additions & 15 deletions

File tree

.changeset/three-tigers-tell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/shared': patch
3+
---
4+
5+
Removes the patch for disabling swr-devtools causing apps with swr and broswers with the devtools extention to break.
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
export const disableSWRDevtools = () => {
2-
if (typeof window !== 'undefined') {
3-
// @ts-ignore
4-
window.__SWR_DEVTOOLS_USE__ = undefined;
5-
}
6-
};
7-
81
export * from 'swr';
92
export { default as useSWR } from 'swr';
103
export { default as useSWRInfinite } from 'swr/infinite';

packages/shared/src/hooks/contexts.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import type { PropsWithChildren } from 'react';
1111
import React from 'react';
1212

1313
import { deprecated } from '../utils';
14-
import { disableSWRDevtools } from './clerk-swr';
15-
disableSWRDevtools();
1614
import { SWRConfig } from './clerk-swr';
1715
import { createContextAndHook } from './createContextAndHook';
1816

packages/shared/src/hooks/useOrganization.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,11 @@ import type {
1414
import type { ClerkPaginatedResponse } from '@clerk/types';
1515
import type { GetMembersParams } from '@clerk/types';
1616

17-
import { disableSWRDevtools } from './clerk-swr';
18-
19-
disableSWRDevtools();
17+
import { deprecated } from '../utils';
2018
import { useSWR } from './clerk-swr';
2119
import { useClerkInstanceContext, useOrganizationContext, useSessionContext } from './contexts';
2220
import type { PaginatedResources, PaginatedResourcesWithDefault } from './types';
2321
import { usePagesOrInfinite, useWithSafeValues } from './usePagesOrInfinite';
24-
import { deprecated } from '../utils';
2522

2623
type UseOrganizationParams = {
2724
/**

packages/shared/src/hooks/usePagesOrInfinite.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { useCallback, useMemo, useRef, useState } from 'react';
22

3-
import { disableSWRDevtools } from './clerk-swr';
4-
disableSWRDevtools();
53
import { useSWR, useSWRInfinite } from './clerk-swr';
64
import type { ValueOrSetter } from './types';
75
import type { PaginatedResources } from './types';

0 commit comments

Comments
 (0)