Skip to content

Commit

Permalink
chore(shared): Remove patch for swr-devtools
Browse files Browse the repository at this point in the history
  • Loading branch information
panteliselef authored and dimkl committed Sep 28, 2023
1 parent 14895e2 commit 753f7bb
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .changeset/three-tigers-tell.md
@@ -0,0 +1,5 @@
---
'@clerk/shared': patch
---

Removes the patch for disabling swr-devtools causing apps with swr and broswers with the devtools extention to break.
7 changes: 0 additions & 7 deletions packages/shared/src/hooks/clerk-swr.ts
@@ -1,10 +1,3 @@
export const disableSWRDevtools = () => {
if (typeof window !== 'undefined') {
// @ts-ignore
window.__SWR_DEVTOOLS_USE__ = undefined;
}
};

export * from 'swr';
export { default as useSWR } from 'swr';
export { default as useSWRInfinite } from 'swr/infinite';
2 changes: 0 additions & 2 deletions packages/shared/src/hooks/contexts.tsx
Expand Up @@ -11,8 +11,6 @@ import type { PropsWithChildren } from 'react';
import React from 'react';

import { deprecated } from '../utils';
import { disableSWRDevtools } from './clerk-swr';
disableSWRDevtools();
import { SWRConfig } from './clerk-swr';
import { createContextAndHook } from './createContextAndHook';

Expand Down
5 changes: 1 addition & 4 deletions packages/shared/src/hooks/useOrganization.tsx
Expand Up @@ -14,14 +14,11 @@ import type {
import type { ClerkPaginatedResponse } from '@clerk/types';
import type { GetMembersParams } from '@clerk/types';

import { disableSWRDevtools } from './clerk-swr';

disableSWRDevtools();
import { deprecated } from '../utils';
import { useSWR } from './clerk-swr';
import { useClerkInstanceContext, useOrganizationContext, useSessionContext } from './contexts';
import type { PaginatedResources, PaginatedResourcesWithDefault } from './types';
import { usePagesOrInfinite, useWithSafeValues } from './usePagesOrInfinite';
import { deprecated } from '../utils';

type UseOrganizationParams = {
/**
Expand Down
2 changes: 0 additions & 2 deletions packages/shared/src/hooks/usePagesOrInfinite.ts
@@ -1,7 +1,5 @@
import { useCallback, useMemo, useRef, useState } from 'react';

import { disableSWRDevtools } from './clerk-swr';
disableSWRDevtools();
import { useSWR, useSWRInfinite } from './clerk-swr';
import type { ValueOrSetter } from './types';
import type { PaginatedResources } from './types';
Expand Down

0 comments on commit 753f7bb

Please sign in to comment.