Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3f49cdd

Browse files
committed
Fix for rrdt not showing server logs properly
1 parent4bd5958 commit3f49cdd

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

‎package-lock.json‎

Lines changed: 3 additions & 6 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎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":"1.1.6",
5+
"version":"1.1.7",
66
"license":"MIT",
77
"keywords": [
88
"react-router",

‎src/server/utils.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
importchalkfrom"chalk"
22
importtype{ActionFunctionArgs,LoaderFunctionArgs,UNSAFE_DataWithResponseInit}from"react-router"
3+
import{bigIntReplacer}from"../shared/bigint-util.js"
34
import{sendEvent}from"../shared/send-event.js"
45
import{typeDevToolsServerConfig,getConfig}from"./config.js"
56
import{actionLog,errorLog,infoLog,loaderLog,redirectLog}from"./logger.js"
@@ -225,6 +226,7 @@ const storeAndEmitActionOrLoaderInfo = async (
225226
)=>{
226227
constresponseHeaders=extractHeadersFromResponseOrRequest(response)
227228
constrequestHeaders=extractHeadersFromResponseOrRequest(args.request)
229+
228230
// create the event
229231
constevent={
230232
type,
@@ -245,7 +247,7 @@ const storeAndEmitActionOrLoaderInfo = async (
245247
if(port){
246248
fetch(`http://localhost:${port}/react-router-devtools-request`,{
247249
method:"POST",
248-
body:JSON.stringify(event),
250+
body:JSON.stringify(event,bigIntReplacer),
249251
})
250252
.then(async(res)=>{
251253
if(res.ok){
@@ -295,10 +297,10 @@ export const analyzeLoaderOrAction =
295297
unAwaited(()=>{
296298
constend=diffInMs(start)
297299
constendTime=Date.now()
298-
storeAndEmitActionOrLoaderInfo(type,routeId,response,end,args)
300+
storeAndEmitActionOrLoaderInfo(type,routeId,res,end,args)
299301
logTrigger(routeId,type,end)
300-
analyzeDeferred(routeId,start,response)
301-
analyzeHeaders(routeId,response)
302+
analyzeDeferred(routeId,start,res)
303+
analyzeHeaders(routeId,res)
302304
if(!aborted){
303305
sendEvent({
304306
type,
@@ -309,7 +311,7 @@ export const analyzeLoaderOrAction =
309311
id:routeId,
310312
url:args.request.url,
311313
method:args.request.method,
312-
status:response&&typeofresponse==="object" ?(responseasany).status :undefined,
314+
status:res&&typeofres==="object" ?(resasany).status :undefined,
313315
})
314316
}
315317
})

‎test-apps/react-router-vite/app/routes/_index.tsx‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const loader = async ({ request, context,devTools, params }: LoaderFunct
2121
constalso=awaitnewPromise((resolve,reject)=>{
2222
setTimeout(()=>{
2323
resolve("test");
24-
},2000);
24+
},200);
2525
});
2626
return{
2727
custom:"data",
@@ -31,12 +31,12 @@ export const loader = async ({ request, context,devTools, params }: LoaderFunct
3131
consttest=awaitnewPromise((resolve,reject)=>{
3232
setTimeout(()=>{
3333
resolve("test");
34-
},2000);
34+
},200);
3535
});
3636
consttest1=newPromise((resolve,reject)=>{
3737
setTimeout(()=>{
3838
resolve("test1");
39-
},3500);
39+
},300);
4040
});
4141
return{message:"Hello World!", test, test1, data,bigInt:BigInt(10)};
4242
};
@@ -50,7 +50,7 @@ export const clientLoader = async ({ request, serverLoader, devTools }: Client
5050
constalso=awaitnewPromise((resolve,reject)=>{
5151
setTimeout(()=>{
5252
resolve("test");
53-
},1000);
53+
},100);
5454
});
5555
return{
5656
custom:"data",
@@ -60,7 +60,7 @@ export const clientLoader = async ({ request, serverLoader, devTools }: Client
6060
constpromise=awaitnewPromise((resolve,reject)=>{
6161
setTimeout(()=>{
6262
resolve("test");
63-
},2000);
63+
},200);
6464
});
6565
returnserverLoaderResults
6666
};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp