-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(devtools): devtools improvements (#5875)
- Loading branch information
Showing
27 changed files
with
456 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@refinedev/core": patch | ||
--- | ||
|
||
refactor: add resource name to devtools xray calls | ||
|
||
Added the resource name to the devtools xray calls to allow resource names to be displayed in the devtools even with custom query keys. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@refinedev/devtools-server": patch | ||
--- | ||
|
||
chore: move `@refinedev/devtools-ui` dependency | ||
|
||
Moved `@refinedev/devtools-ui` dependency to `devDependencies` since only the `vite` output is used in the server. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
"@refinedev/devtools-internal": patch | ||
"@refinedev/devtools-server": patch | ||
"@refinedev/devtools-shared": patch | ||
"@refinedev/devtools-ui": patch | ||
--- | ||
|
||
feat: update resource name accessing logic | ||
|
||
Updated resource name displaying logic to use `resourceName` from activity records to make sure `resource` is correctly displayed with custom query keys. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
"@refinedev/devtools-internal": patch | ||
"@refinedev/devtools-server": patch | ||
"@refinedev/devtools-shared": patch | ||
"@refinedev/devtools-ui": patch | ||
--- | ||
|
||
feat: add invalidate query button | ||
|
||
Added `Invalidate Query` button to settled queries in the devtools panel to allow users to manually invalidate queries for debugging purposes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@refinedev/devtools-ui": patch | ||
--- | ||
|
||
refactor: replace `react-json-view` with `react-json-view-lite` | ||
|
||
Replaced outdated `react-json-view` package with `react-json-view-lite` for both performance and dependency resolution reasons. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@refinedev/core": patch | ||
--- | ||
|
||
fix: exclude internal button hook calls from devtools trace | ||
|
||
Removed internal button hook calls from devtools trace to avoid crowding the trace with unnecessary information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import React from "react"; | ||
import type { Activity } from "../interfaces/activity"; | ||
import { UpdateIcon } from "./icons/update"; | ||
import clsx from "clsx"; | ||
import { | ||
DevToolsContext, | ||
DevtoolsEvent, | ||
send, | ||
} from "@refinedev/devtools-shared"; | ||
|
||
export const InvalidateButton = ({ activity }: { activity: Activity }) => { | ||
const { ws } = React.useContext(DevToolsContext); | ||
|
||
if (activity.type !== "query") return null; | ||
|
||
if (activity.status === "success" || activity.status === "error") { | ||
const isFetching = activity.state.fetchStatus === "fetching"; | ||
|
||
return ( | ||
<> | ||
<button | ||
type="button" | ||
onClick={() => { | ||
if (!ws || !activity.key) return; | ||
send(ws, DevtoolsEvent.DEVTOOLS_INVALIDATE_QUERY, { | ||
queryKey: activity.key, | ||
}); | ||
}} | ||
className={clsx( | ||
"re-ml-2", | ||
"re-rounded-xl", | ||
"re-py-0.5", | ||
"re-pl-1", | ||
"re-pr-1.5", | ||
"re-text-[10px]", | ||
"re-text-alt-blue", | ||
"re-bg-alt-blue", | ||
"re-bg-opacity-20", | ||
"re-border", | ||
"re-border-alt-blue", | ||
"re-flex", | ||
"re-items-center", | ||
"re-gap-1", | ||
"re-font-normal", | ||
"hover:re-bg-opacity-30", | ||
"active:re-bg-opacity-40", | ||
)} | ||
> | ||
<UpdateIcon | ||
className={clsx( | ||
isFetching && "re-animate-spin", | ||
"re-w-3", | ||
"re-h-3", | ||
)} | ||
/> | ||
Invalidate Query | ||
</button> | ||
</> | ||
); | ||
} | ||
|
||
return null; | ||
}; |
Oops, something went wrong.