@@ -14,7 +14,6 @@ import {
1414import {
1515 ErrorResponseImpl ,
1616 isRouteErrorResponse ,
17- json ,
1817 redirect ,
1918} from "../../lib/router/utils" ;
2019import { createDeferred } from "./utils/data-router-setup" ;
@@ -60,8 +59,8 @@ describe("ssr", () => {
6059 {
6160 id : "json" ,
6261 path : "json" ,
63- loader : ( ) => json ( { type : "loader" } ) ,
64- action : ( ) => json ( { type : "action" } ) ,
62+ loader : ( ) => Response . json ( { type : "loader" } ) ,
63+ action : ( ) => Response . json ( { type : "action" } ) ,
6564 } ,
6665 {
6766 id : "deferred" ,
@@ -1069,7 +1068,7 @@ describe("ssr", () => {
10691068 {
10701069 id : "root" ,
10711070 path : "/" ,
1072- loader : ( ) => json ( { data : "ROOT" } , { status : 201 } ) ,
1071+ loader : ( ) => Response . json ( { data : "ROOT" } , { status : 201 } ) ,
10731072 children : [
10741073 {
10751074 id : "child" ,
@@ -1090,12 +1089,12 @@ describe("ssr", () => {
10901089 {
10911090 id : "root" ,
10921091 path : "/" ,
1093- loader : ( ) => json ( { data : "ROOT" } , { status : 201 } ) ,
1092+ loader : ( ) => Response . json ( { data : "ROOT" } , { status : 201 } ) ,
10941093 children : [
10951094 {
10961095 id : "child" ,
10971096 index : true ,
1098- loader : ( ) => json ( { data : "CHILD" } , { status : 202 } ) ,
1097+ loader : ( ) => Response . json ( { data : "CHILD" } , { status : 202 } ) ,
10991098 action : ( ) => {
11001099 throw new Error ( "💥" ) ;
11011100 } ,
@@ -1114,7 +1113,7 @@ describe("ssr", () => {
11141113 {
11151114 id : "root" ,
11161115 path : "/" ,
1117- loader : ( ) => json ( { data : "ROOT" } , { status : 201 } ) ,
1116+ loader : ( ) => Response . json ( { data : "ROOT" } , { status : 201 } ) ,
11181117 children : [
11191118 {
11201119 id : "child" ,
@@ -1135,12 +1134,12 @@ describe("ssr", () => {
11351134 {
11361135 id : "root" ,
11371136 path : "/" ,
1138- loader : ( ) => json ( { data : "ROOT" } , { status : 201 } ) ,
1137+ loader : ( ) => Response . json ( { data : "ROOT" } , { status : 201 } ) ,
11391138 children : [
11401139 {
11411140 id : "child" ,
11421141 index : true ,
1143- loader : ( ) => json ( { data : "CHILD" } , { status : 202 } ) ,
1142+ loader : ( ) => Response . json ( { data : "CHILD" } , { status : 202 } ) ,
11441143 action : ( ) => {
11451144 throw new Response ( null , { status : 400 } ) ;
11461145 } ,
@@ -1159,13 +1158,13 @@ describe("ssr", () => {
11591158 {
11601159 id : "root" ,
11611160 path : "/" ,
1162- loader : ( ) => json ( { data : "ROOT" } , { status : 201 } ) ,
1161+ loader : ( ) => Response . json ( { data : "ROOT" } , { status : 201 } ) ,
11631162 children : [
11641163 {
11651164 id : "child" ,
11661165 index : true ,
1167- loader : ( ) => json ( { data : "ROOT" } , { status : 202 } ) ,
1168- action : ( ) => json ( { data : "ROOT" } , { status : 203 } ) ,
1166+ loader : ( ) => Response . json ( { data : "ROOT" } , { status : 202 } ) ,
1167+ action : ( ) => Response . json ( { data : "ROOT" } , { status : 203 } ) ,
11691168 } ,
11701169 ] ,
11711170 } ,
@@ -1181,12 +1180,12 @@ describe("ssr", () => {
11811180 {
11821181 id : "root" ,
11831182 path : "/" ,
1184- loader : ( ) => json ( { data : "ROOT" } , { status : 201 } ) ,
1183+ loader : ( ) => Response . json ( { data : "ROOT" } , { status : 201 } ) ,
11851184 children : [
11861185 {
11871186 id : "child" ,
11881187 index : true ,
1189- loader : ( ) => json ( { data : "ROOT" } , { status : 202 } ) ,
1188+ loader : ( ) => Response . json ( { data : "ROOT" } , { status : 202 } ) ,
11901189 } ,
11911190 ] ,
11921191 } ,
@@ -1944,7 +1943,7 @@ describe("ssr", () => {
19441943 } ) ;
19451944
19461945 it ( "should not unwrap responses returned from loaders" , async ( ) => {
1947- let response = json ( { key : "value" } ) ;
1946+ let response = Response . json ( { key : "value" } ) ;
19481947 let { queryRoute } = createStaticHandler ( [
19491948 {
19501949 id : "root" ,
@@ -1959,7 +1958,7 @@ describe("ssr", () => {
19591958 } ) ;
19601959
19611960 it ( "should not unwrap responses returned from actions" , async ( ) => {
1962- let response = json ( { key : "value" } ) ;
1961+ let response = Response . json ( { key : "value" } ) ;
19631962 let { queryRoute } = createStaticHandler ( [
19641963 {
19651964 id : "root" ,
@@ -1974,7 +1973,7 @@ describe("ssr", () => {
19741973 } ) ;
19751974
19761975 it ( "should not unwrap responses thrown from loaders" , async ( ) => {
1977- let response = json ( { key : "value" } ) ;
1976+ let response = Response . json ( { key : "value" } ) ;
19781977 let { queryRoute } = createStaticHandler ( [
19791978 {
19801979 id : "root" ,
@@ -1994,7 +1993,7 @@ describe("ssr", () => {
19941993 } ) ;
19951994
19961995 it ( "should not unwrap responses thrown from actions" , async ( ) => {
1997- let response = json ( { key : "value" } ) ;
1996+ let response = Response . json ( { key : "value" } ) ;
19981997 let { queryRoute } = createStaticHandler ( [
19991998 {
20001999 id : "root" ,
0 commit comments