@@ -57,21 +57,21 @@ const TEST_ROUTES = [
57
57
"_index.tsx" ,
58
58
59
59
// Bundle A has an index route
60
- "bundle-a .tsx" ,
61
- "bundle-a ._index.tsx" ,
62
- "bundle-a.route-a .tsx" ,
63
- "bundle-a.route-b .tsx" ,
60
+ "bundle_a .tsx" ,
61
+ "bundle_a ._index.tsx" ,
62
+ "bundle_a.route_a .tsx" ,
63
+ "bundle_a.route_b .tsx" ,
64
64
65
65
// Bundle B doesn't have an index route
66
- "bundle-b .tsx" ,
67
- "bundle-b.route-a .tsx" ,
68
- "bundle-b.route-b .tsx" ,
66
+ "bundle_b .tsx" ,
67
+ "bundle_b.route_a .tsx" ,
68
+ "bundle_b.route_b .tsx" ,
69
69
70
70
// Bundle C is nested in a pathless route
71
71
"_pathless.tsx" ,
72
- "_pathless.bundle-c .tsx" ,
73
- "_pathless.bundle-c.route-a .tsx" ,
74
- "_pathless.bundle-c.route-b .tsx" ,
72
+ "_pathless.bundle_c .tsx" ,
73
+ "_pathless.bundle_c.route_a .tsx" ,
74
+ "_pathless.bundle_c.route_b .tsx" ,
75
75
] ;
76
76
77
77
const files = {
@@ -151,16 +151,16 @@ test.describe("Server bundles", () => {
151
151
return "root";
152
152
}
153
153
154
- if (branch.some((route) => route.id === "routes/bundle-a ")) {
155
- return "bundle-a ";
154
+ if (branch.some((route) => route.id === "routes/bundle_a ")) {
155
+ return "bundle_a ";
156
156
}
157
157
158
- if (branch.some((route) => route.id === "routes/bundle-b ")) {
159
- return "bundle-b ";
158
+ if (branch.some((route) => route.id === "routes/bundle_b ")) {
159
+ return "bundle_b ";
160
160
}
161
161
162
- if (branch.some((route) => route.id === "routes/_pathless.bundle-c ")) {
163
- return "bundle-c ";
162
+ if (branch.some((route) => route.id === "routes/_pathless.bundle_c ")) {
163
+ return "bundle_c ";
164
164
}
165
165
166
166
throw new Error("No bundle defined for route " + branch[branch.length - 1].id);
@@ -199,19 +199,19 @@ test.describe("Server bundles", () => {
199
199
await page . goto ( `http://localhost:${ port } /` ) ;
200
200
await expectRenderedRoutes ( page , [ "_index.tsx" ] ) ;
201
201
202
- await page . goto ( `http://localhost:${ port } /bundle-a ` ) ;
202
+ await page . goto ( `http://localhost:${ port } /bundle_a ` ) ;
203
203
await expectRenderedRoutes ( page , [
204
- "bundle-a .tsx" ,
205
- "bundle-a ._index.tsx" ,
204
+ "bundle_a .tsx" ,
205
+ "bundle_a ._index.tsx" ,
206
206
] ) ;
207
207
208
- await page . goto ( `http://localhost:${ port } /bundle-b ` ) ;
209
- await expectRenderedRoutes ( page , [ "bundle-b .tsx" ] ) ;
208
+ await page . goto ( `http://localhost:${ port } /bundle_b ` ) ;
209
+ await expectRenderedRoutes ( page , [ "bundle_b .tsx" ] ) ;
210
210
211
- await page . goto ( `http://localhost:${ port } /bundle-c ` ) ;
211
+ await page . goto ( `http://localhost:${ port } /bundle_c ` ) ;
212
212
await expectRenderedRoutes ( page , [
213
213
"_pathless.tsx" ,
214
- "_pathless.bundle-c .tsx" ,
214
+ "_pathless.bundle_c .tsx" ,
215
215
] ) ;
216
216
217
217
expect ( pageErrors ) . toEqual ( [ ] ) ;
@@ -243,84 +243,84 @@ test.describe("Server bundles", () => {
243
243
await page . goto ( `http://localhost:${ port } /` ) ;
244
244
await expectRenderedRoutes ( page , [ "_index.tsx" ] ) ;
245
245
246
- let _404s = [ "/bundle-a " , "/bundle-b " , "/bundle-c " ] ;
246
+ let _404s = [ "/bundle_a " , "/bundle_b " , "/bundle_c " ] ;
247
247
for ( let path of _404s ) {
248
248
let response = await page . goto ( `http://localhost:${ port } ${ path } ` ) ;
249
249
expect ( response ?. status ( ) ) . toBe ( 404 ) ;
250
250
}
251
251
} ) ;
252
252
253
- await withBundleServer ( cwd , "bundle-a " , async ( port ) => {
254
- await page . goto ( `http://localhost:${ port } /bundle-a ` ) ;
253
+ await withBundleServer ( cwd , "bundle_a " , async ( port ) => {
254
+ await page . goto ( `http://localhost:${ port } /bundle_a ` ) ;
255
255
await expectRenderedRoutes ( page , [
256
- "bundle-a .tsx" ,
257
- "bundle-a ._index.tsx" ,
256
+ "bundle_a .tsx" ,
257
+ "bundle_a ._index.tsx" ,
258
258
] ) ;
259
259
260
- await page . goto ( `http://localhost:${ port } /bundle-a/route-a ` ) ;
260
+ await page . goto ( `http://localhost:${ port } /bundle_a/route_a ` ) ;
261
261
await expectRenderedRoutes ( page , [
262
- "bundle-a .tsx" ,
263
- "bundle-a.route-a .tsx" ,
262
+ "bundle_a .tsx" ,
263
+ "bundle_a.route_a .tsx" ,
264
264
] ) ;
265
265
266
- await page . goto ( `http://localhost:${ port } /bundle-a/route-b ` ) ;
266
+ await page . goto ( `http://localhost:${ port } /bundle_a/route_b ` ) ;
267
267
await expectRenderedRoutes ( page , [
268
- "bundle-a .tsx" ,
269
- "bundle-a.route-b .tsx" ,
268
+ "bundle_a .tsx" ,
269
+ "bundle_a.route_b .tsx" ,
270
270
] ) ;
271
271
272
- let _404s = [ "/bundle-b " , "/bundle-c " ] ;
272
+ let _404s = [ "/bundle_b " , "/bundle_c " ] ;
273
273
for ( let path of _404s ) {
274
274
let response = await page . goto ( `http://localhost:${ port } ${ path } ` ) ;
275
275
expect ( response ?. status ( ) ) . toBe ( 404 ) ;
276
276
}
277
277
} ) ;
278
278
279
- await withBundleServer ( cwd , "bundle-b " , async ( port ) => {
280
- await page . goto ( `http://localhost:${ port } /bundle-b ` ) ;
281
- await expectRenderedRoutes ( page , [ "bundle-b .tsx" ] ) ;
279
+ await withBundleServer ( cwd , "bundle_b " , async ( port ) => {
280
+ await page . goto ( `http://localhost:${ port } /bundle_b ` ) ;
281
+ await expectRenderedRoutes ( page , [ "bundle_b .tsx" ] ) ;
282
282
283
- await page . goto ( `http://localhost:${ port } /bundle-b/route-a ` ) ;
283
+ await page . goto ( `http://localhost:${ port } /bundle_b/route_a ` ) ;
284
284
await expectRenderedRoutes ( page , [
285
- "bundle-b .tsx" ,
286
- "bundle-b.route-a .tsx" ,
285
+ "bundle_b .tsx" ,
286
+ "bundle_b.route_a .tsx" ,
287
287
] ) ;
288
288
289
- await page . goto ( `http://localhost:${ port } /bundle-b/route-b ` ) ;
289
+ await page . goto ( `http://localhost:${ port } /bundle_b/route_b ` ) ;
290
290
await expectRenderedRoutes ( page , [
291
- "bundle-b .tsx" ,
292
- "bundle-b.route-b .tsx" ,
291
+ "bundle_b .tsx" ,
292
+ "bundle_b.route_b .tsx" ,
293
293
] ) ;
294
294
295
- let _404s = [ "/bundle-a " , "/bundle-c " ] ;
295
+ let _404s = [ "/bundle_a " , "/bundle_c " ] ;
296
296
for ( let path of _404s ) {
297
297
let response = await page . goto ( `http://localhost:${ port } ${ path } ` ) ;
298
298
expect ( response ?. status ( ) ) . toBe ( 404 ) ;
299
299
}
300
300
} ) ;
301
301
302
- await withBundleServer ( cwd , "bundle-c " , async ( port ) => {
303
- await page . goto ( `http://localhost:${ port } /bundle-c ` ) ;
302
+ await withBundleServer ( cwd , "bundle_c " , async ( port ) => {
303
+ await page . goto ( `http://localhost:${ port } /bundle_c ` ) ;
304
304
await expectRenderedRoutes ( page , [
305
305
"_pathless.tsx" ,
306
- "_pathless.bundle-c .tsx" ,
306
+ "_pathless.bundle_c .tsx" ,
307
307
] ) ;
308
308
309
- await page . goto ( `http://localhost:${ port } /bundle-c/route-a ` ) ;
309
+ await page . goto ( `http://localhost:${ port } /bundle_c/route_a ` ) ;
310
310
await expectRenderedRoutes ( page , [
311
311
"_pathless.tsx" ,
312
- "_pathless.bundle-c .tsx" ,
313
- "_pathless.bundle-c.route-a .tsx" ,
312
+ "_pathless.bundle_c .tsx" ,
313
+ "_pathless.bundle_c.route_a .tsx" ,
314
314
] ) ;
315
315
316
- await page . goto ( `http://localhost:${ port } /bundle-c/route-b ` ) ;
316
+ await page . goto ( `http://localhost:${ port } /bundle_c/route_b ` ) ;
317
317
await expectRenderedRoutes ( page , [
318
318
"_pathless.tsx" ,
319
- "_pathless.bundle-c .tsx" ,
320
- "_pathless.bundle-c.route-b .tsx" ,
319
+ "_pathless.bundle_c .tsx" ,
320
+ "_pathless.bundle_c.route_b .tsx" ,
321
321
] ) ;
322
322
323
- let _404s = [ "/bundle-a " , "/bundle-b " ] ;
323
+ let _404s = [ "/bundle_a " , "/bundle_b " ] ;
324
324
for ( let path of _404s ) {
325
325
let response = await page . goto ( `http://localhost:${ port } ${ path } ` ) ;
326
326
expect ( response ?. status ( ) ) . toBe ( 404 ) ;
@@ -344,9 +344,9 @@ test.describe("Server bundles", () => {
344
344
test ( "Vite manifests" , ( ) => {
345
345
[
346
346
[ "client" ] ,
347
- [ "server" , "bundle-a " ] ,
348
- [ "server" , "bundle-b " ] ,
349
- [ "server" , "bundle-c " ] ,
347
+ [ "server" , "bundle_a " ] ,
348
+ [ "server" , "bundle_b " ] ,
349
+ [ "server" , "bundle_c " ] ,
350
350
[ "server" , "root" ] ,
351
351
] . forEach ( ( buildPaths ) => {
352
352
let viteManifestFiles = fs . readdirSync (
@@ -360,33 +360,33 @@ test.describe("Server bundles", () => {
360
360
let manifestPath = path . join ( cwd , "build" , "test-manifest.json" ) ;
361
361
expect ( JSON . parse ( fs . readFileSync ( manifestPath , "utf8" ) ) ) . toEqual ( {
362
362
serverBundles : {
363
- "bundle-c" : {
364
- id : "bundle-c " ,
365
- file : "build/server/bundle-c /index.js" ,
363
+ bundle_c : {
364
+ id : "bundle_c " ,
365
+ file : "build/server/bundle_c /index.js" ,
366
366
} ,
367
- "bundle-a" : {
368
- id : "bundle-a " ,
369
- file : "build/server/bundle-a /index.js" ,
367
+ bundle_a : {
368
+ id : "bundle_a " ,
369
+ file : "build/server/bundle_a /index.js" ,
370
370
} ,
371
- "bundle-b" : {
372
- id : "bundle-b " ,
373
- file : "build/server/bundle-b /index.js" ,
371
+ bundle_b : {
372
+ id : "bundle_b " ,
373
+ file : "build/server/bundle_b /index.js" ,
374
374
} ,
375
375
root : {
376
376
id : "root" ,
377
377
file : "build/server/root/index.js" ,
378
378
} ,
379
379
} ,
380
380
routeIdToServerBundleId : {
381
- "routes/_pathless.bundle-c.route-a " : "bundle-c " ,
382
- "routes/_pathless.bundle-c.route-b " : "bundle-c " ,
383
- "routes/_pathless.bundle-c " : "bundle-c " ,
384
- "routes/bundle-a.route-a " : "bundle-a " ,
385
- "routes/bundle-a.route-b " : "bundle-a " ,
386
- "routes/bundle-b.route-a " : "bundle-b " ,
387
- "routes/bundle-b.route-b " : "bundle-b " ,
388
- "routes/bundle-a ._index" : "bundle-a " ,
389
- "routes/bundle-b " : "bundle-b " ,
381
+ "routes/_pathless.bundle_c.route_a " : "bundle_c " ,
382
+ "routes/_pathless.bundle_c.route_b " : "bundle_c " ,
383
+ "routes/_pathless.bundle_c " : "bundle_c " ,
384
+ "routes/bundle_a.route_a " : "bundle_a " ,
385
+ "routes/bundle_a.route_b " : "bundle_a " ,
386
+ "routes/bundle_b.route_a " : "bundle_b " ,
387
+ "routes/bundle_b.route_b " : "bundle_b " ,
388
+ "routes/bundle_a ._index" : "bundle_a " ,
389
+ "routes/bundle_b " : "bundle_b " ,
390
390
"routes/_index" : "root" ,
391
391
} ,
392
392
routes : {
@@ -395,69 +395,69 @@ test.describe("Server bundles", () => {
395
395
id : "root" ,
396
396
file : "app/root.tsx" ,
397
397
} ,
398
- "routes/_pathless.bundle-c.route-a " : {
399
- file : "app/routes/_pathless.bundle-c.route-a .tsx" ,
400
- id : "routes/_pathless.bundle-c.route-a " ,
401
- path : "route-a " ,
402
- parentId : "routes/_pathless.bundle-c " ,
398
+ "routes/_pathless.bundle_c.route_a " : {
399
+ file : "app/routes/_pathless.bundle_c.route_a .tsx" ,
400
+ id : "routes/_pathless.bundle_c.route_a " ,
401
+ path : "route_a " ,
402
+ parentId : "routes/_pathless.bundle_c " ,
403
403
} ,
404
- "routes/_pathless.bundle-c.route-b " : {
405
- file : "app/routes/_pathless.bundle-c.route-b .tsx" ,
406
- id : "routes/_pathless.bundle-c.route-b " ,
407
- path : "route-b " ,
408
- parentId : "routes/_pathless.bundle-c " ,
404
+ "routes/_pathless.bundle_c.route_b " : {
405
+ file : "app/routes/_pathless.bundle_c.route_b .tsx" ,
406
+ id : "routes/_pathless.bundle_c.route_b " ,
407
+ path : "route_b " ,
408
+ parentId : "routes/_pathless.bundle_c " ,
409
409
} ,
410
- "routes/_pathless.bundle-c " : {
411
- file : "app/routes/_pathless.bundle-c .tsx" ,
412
- id : "routes/_pathless.bundle-c " ,
413
- path : "bundle-c " ,
410
+ "routes/_pathless.bundle_c " : {
411
+ file : "app/routes/_pathless.bundle_c .tsx" ,
412
+ id : "routes/_pathless.bundle_c " ,
413
+ path : "bundle_c " ,
414
414
parentId : "routes/_pathless" ,
415
415
} ,
416
- "routes/bundle-a.route-a " : {
417
- file : "app/routes/bundle-a.route-a .tsx" ,
418
- id : "routes/bundle-a.route-a " ,
419
- path : "route-a " ,
420
- parentId : "routes/bundle-a " ,
416
+ "routes/bundle_a.route_a " : {
417
+ file : "app/routes/bundle_a.route_a .tsx" ,
418
+ id : "routes/bundle_a.route_a " ,
419
+ path : "route_a " ,
420
+ parentId : "routes/bundle_a " ,
421
421
} ,
422
- "routes/bundle-a.route-b " : {
423
- file : "app/routes/bundle-a.route-b .tsx" ,
424
- id : "routes/bundle-a.route-b " ,
425
- path : "route-b " ,
426
- parentId : "routes/bundle-a " ,
422
+ "routes/bundle_a.route_b " : {
423
+ file : "app/routes/bundle_a.route_b .tsx" ,
424
+ id : "routes/bundle_a.route_b " ,
425
+ path : "route_b " ,
426
+ parentId : "routes/bundle_a " ,
427
427
} ,
428
- "routes/bundle-b.route-a " : {
429
- file : "app/routes/bundle-b.route-a .tsx" ,
430
- id : "routes/bundle-b.route-a " ,
431
- path : "route-a " ,
432
- parentId : "routes/bundle-b " ,
428
+ "routes/bundle_b.route_a " : {
429
+ file : "app/routes/bundle_b.route_a .tsx" ,
430
+ id : "routes/bundle_b.route_a " ,
431
+ path : "route_a " ,
432
+ parentId : "routes/bundle_b " ,
433
433
} ,
434
- "routes/bundle-b.route-b " : {
435
- file : "app/routes/bundle-b.route-b .tsx" ,
436
- id : "routes/bundle-b.route-b " ,
437
- path : "route-b " ,
438
- parentId : "routes/bundle-b " ,
434
+ "routes/bundle_b.route_b " : {
435
+ file : "app/routes/bundle_b.route_b .tsx" ,
436
+ id : "routes/bundle_b.route_b " ,
437
+ path : "route_b " ,
438
+ parentId : "routes/bundle_b " ,
439
439
} ,
440
- "routes/bundle-a ._index" : {
441
- file : "app/routes/bundle-a ._index.tsx" ,
442
- id : "routes/bundle-a ._index" ,
440
+ "routes/bundle_a ._index" : {
441
+ file : "app/routes/bundle_a ._index.tsx" ,
442
+ id : "routes/bundle_a ._index" ,
443
443
index : true ,
444
- parentId : "routes/bundle-a " ,
444
+ parentId : "routes/bundle_a " ,
445
445
} ,
446
446
"routes/_pathless" : {
447
447
file : "app/routes/_pathless.tsx" ,
448
448
id : "routes/_pathless" ,
449
449
parentId : "root" ,
450
450
} ,
451
- "routes/bundle-a " : {
452
- file : "app/routes/bundle-a .tsx" ,
453
- id : "routes/bundle-a " ,
454
- path : "bundle-a " ,
451
+ "routes/bundle_a " : {
452
+ file : "app/routes/bundle_a .tsx" ,
453
+ id : "routes/bundle_a " ,
454
+ path : "bundle_a " ,
455
455
parentId : "root" ,
456
456
} ,
457
- "routes/bundle-b " : {
458
- file : "app/routes/bundle-b .tsx" ,
459
- id : "routes/bundle-b " ,
460
- path : "bundle-b " ,
457
+ "routes/bundle_b " : {
458
+ file : "app/routes/bundle_b .tsx" ,
459
+ id : "routes/bundle_b " ,
460
+ path : "bundle_b " ,
461
461
parentId : "root" ,
462
462
} ,
463
463
"routes/_index" : {
0 commit comments