Skip to content

Commit

Permalink
Merge branch 'releases/august' into RK-744-feat-core-rename-use-table…
Browse files Browse the repository at this point in the history
…-use-show-and-use-select-s-query-result-to-query
  • Loading branch information
alicanerdurmaz authored Jul 22, 2024
2 parents 330cf8e + fa2d7a4 commit 9283125
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .changeset/pretty-snails-shake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@refinedev/devtools-internal": patch
---

fix(devtools-internal): fix noop return on hooks for production builds

Currently, `@refinedev/devtools-internal` returns noop function when bundled for production, yet the notation is not correctly interpreted by some bundlers. This PR fixes the issue by moving the empty return and noop functions to a separate definition.

[Resolves #6030](https://github.com/refinedev/refine/issues/6030)
7 changes: 7 additions & 0 deletions .changeset/spotty-rocks-matter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@refinedev/core": patch
---

chore(devtools): bump internal devtools dependency

Bump `@refinedev/devtools-internal` version.
7 changes: 4 additions & 3 deletions packages/devtools-internal/src/use-query-subscription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import type { QueryClient } from "@tanstack/react-query";
import React, { useContext } from "react";
import { createQueryListener, createMutationListener } from "./listeners";

const empty = {};
const noop = () => empty;

export const useQuerySubscription =
__DEV_CONDITION__ !== "development"
? () => {
return {};
}
? noop
: (queryClient: QueryClient) => {
const { ws } = useContext(DevToolsContext);
const queryCacheSubscription = React.useRef<() => void>();
Expand Down

0 comments on commit 9283125

Please sign in to comment.