Skip to content

Commit 774d804

Browse files
committed
update endpoint
1 parent 6b12480 commit 774d804

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "react-router-devtools",
33
"description": "Devtools for React Router - debug, trace, find hydration errors, catch bugs and inspect server/client data with react-router-devtools",
44
"author": "Alem Tuzlak",
5-
"version": "5.0.4",
5+
"version": "5.0.5",
66
"license": "MIT",
77
"keywords": [
88
"react-router",

src/server/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ const storeAndEmitActionOrLoaderInfo = async (
245245
const port = process.rdt_port
246246

247247
if (port) {
248-
fetch(`http://localhost:${port}/react-router-devtools-request`, {
248+
fetch(`http://localhost:${port}/__rrdt`, {
249249
method: "POST",
250250
body: JSON.stringify(event, bigIntReplacer),
251251
})

src/shared/send-event.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const sendEvent = (event: RequestEvent) => {
88
const port = process.rdt_port
99

1010
if (port) {
11-
fetch(`http://localhost:${port}/react-router-devtools-request`, {
11+
fetch(`http://localhost:${port}/__rrdt`, {
1212
method: "POST",
1313
body: JSON.stringify({ routine: "request-event", ...event }, bigIntReplacer),
1414
})

src/vite/plugin.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ export const reactRouterDevTools: (args?: ReactRouterViteConfig) => Plugin[] = (
378378

379379
const column = line.indexOf("console.")
380380
const location = `${id.replace(normalizePath(process.cwd()), "")}:${lineNumber + 1}:${column + 1}`
381-
const logMessage = `'${chalk.magenta("LOG")} ${chalk.blueBright(`${location} - http://localhost:${port}/open-source?source=${encodeURIComponent(id.replace(normalizePath(process.cwd()), ""))}&line=${lineNumber + 1}&column=${column + 1}`)}\\n → '`
381+
const logMessage = `'${chalk.magenta("LOG")} ${chalk.blueBright(`${location} - http://localhost:${port}/_rrdt/open-source?source=${encodeURIComponent(id.replace(normalizePath(process.cwd()), ""))}&line=${lineNumber + 1}&column=${column + 1}`)}\\n → '`
382382
if (line.includes("console.log(")) {
383383
const newLine = `console.log(${logMessage},`
384384
return line.replace("console.log(", newLine)

src/vite/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const handleDevToolsViteRequest = (
2828
next: Connect.NextFunction,
2929
cb: (data: any) => void
3030
) => {
31-
if (req.url?.includes("open-source")) {
31+
if (req.url?.includes("_rrdt/open-source")) {
3232
const searchParams = new URLSearchParams(req.url.split("?")[1])
3333
const source = searchParams.get("source")
3434
const line = searchParams.get("line")
@@ -49,7 +49,7 @@ export const handleDevToolsViteRequest = (
4949
res.end()
5050
return
5151
}
52-
if (!req.url?.includes("react-router-devtools-request")) {
52+
if (!req.url?.includes("__rrdt")) {
5353
return next()
5454
}
5555

0 commit comments

Comments
 (0)