@module-federation/bridge-react-webpack-plugin 2.3.3 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/bridge-react-webpack-plugin",
3
- "version": "2.3.3",
3
+ "version": "2.4.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -11,6 +11,10 @@
11
11
  "url": "git+https://github.com/module-federation/core.git",
12
12
  "directory": "packages/bridge/bridge-react-webpack-plugin"
13
13
  },
14
+ "files": [
15
+ "dist/",
16
+ "README.md"
17
+ ],
14
18
  "main": "./dist/index.cjs.js",
15
19
  "module": "./dist/index.es.js",
16
20
  "types": "./dist/index.cjs.d.ts",
@@ -25,7 +29,7 @@
25
29
  "dependencies": {
26
30
  "semver": "7.6.3",
27
31
  "@types/semver": "7.5.8",
28
- "@module-federation/sdk": "2.3.3"
32
+ "@module-federation/sdk": "2.4.0"
29
33
  },
30
34
  "devDependencies": {
31
35
  "typescript": "^5.2.2",
@@ -1,20 +0,0 @@
1
-
2
- > @module-federation/bridge-react-webpack-plugin@2.3.3 build /home/runner/work/core/core/packages/bridge/bridge-react-webpack-plugin
3
- > vite build
4
-
5
- The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
6
- vite v5.4.21 building for production...
7
- transforming...
8
- ✓ 92 modules transformed.
9
- rendering chunks...
10
- 
11
- [vite:dts] Start generate declaration files...
12
- computing gzip size...
13
- dist/index.cjs.js 56.02 kB │ gzip: 12.26 kB
14
- [vite:dts] Start rollup declaration files...
15
- Analysis will use the bundled TypeScript version 5.8.2
16
- *** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
17
- [vite:dts] Declaration files built in 10832ms.
18
- 
19
- dist/index.es.js 56.00 kB │ gzip: 12.26 kB
20
- ✓ built in 12.01s
package/CHANGELOG.md DELETED
@@ -1,728 +0,0 @@
1
- # @module-federation/bridge-react-webpack-plugin
2
-
3
- ## 2.3.3
4
-
5
- ### Patch Changes
6
-
7
- - @module-federation/sdk@2.3.3
8
-
9
- ## 2.3.2
10
-
11
- ### Patch Changes
12
-
13
- - @module-federation/sdk@2.3.2
14
-
15
- ## 2.3.1
16
-
17
- ### Patch Changes
18
-
19
- - @module-federation/sdk@2.3.1
20
-
21
- ## 2.3.0
22
-
23
- ### Patch Changes
24
-
25
- - Updated dependencies [eb26065]
26
- - Updated dependencies [8f2ec9b]
27
- - @module-federation/sdk@2.3.0
28
-
29
- ## 2.2.3
30
-
31
- ### Patch Changes
32
-
33
- - @module-federation/sdk@2.2.3
34
-
35
- ## 2.2.2
36
-
37
- ### Patch Changes
38
-
39
- - @module-federation/sdk@2.2.2
40
-
41
- ## 2.2.1
42
-
43
- ### Patch Changes
44
-
45
- - @module-federation/sdk@2.2.1
46
-
47
- ## 2.2.0
48
-
49
- ### Patch Changes
50
-
51
- - Updated dependencies [c856ec1]
52
- - Updated dependencies [12240bb]
53
- - Updated dependencies [e5dd6ef]
54
- - @module-federation/sdk@2.2.0
55
-
56
- ## 2.1.0
57
-
58
- ### Patch Changes
59
-
60
- - Updated dependencies [918294f]
61
- - @module-federation/sdk@2.1.0
62
-
63
- ## 2.0.1
64
-
65
- ### Patch Changes
66
-
67
- - @module-federation/sdk@2.0.1
68
-
69
- ## 2.0.0
70
-
71
- ### Patch Changes
72
-
73
- - @module-federation/sdk@2.0.0
74
-
75
- ## 0.24.1
76
-
77
- ### Patch Changes
78
-
79
- - @module-federation/sdk@0.24.1
80
-
81
- ## 0.24.0
82
-
83
- ### Patch Changes
84
-
85
- - @module-federation/sdk@0.24.0
86
-
87
- ## 0.23.0
88
-
89
- ### Patch Changes
90
-
91
- - @module-federation/sdk@0.23.0
92
-
93
- ## 0.22.1
94
-
95
- ### Patch Changes
96
-
97
- - @module-federation/sdk@0.22.1
98
-
99
- ## 0.22.0
100
-
101
- ### Patch Changes
102
-
103
- - @module-federation/sdk@0.22.0
104
-
105
- ## 0.21.6
106
-
107
- ### Patch Changes
108
-
109
- - @module-federation/sdk@0.21.6
110
-
111
- ## 0.21.5
112
-
113
- ### Patch Changes
114
-
115
- - Updated dependencies [94d8868]
116
- - @module-federation/sdk@0.21.5
117
-
118
- ## 0.21.4
119
-
120
- ### Patch Changes
121
-
122
- - Updated dependencies [a50e068]
123
- - @module-federation/sdk@0.21.4
124
-
125
- ## 0.21.3
126
-
127
- ### Patch Changes
128
-
129
- - @module-federation/sdk@0.21.3
130
-
131
- ## 0.21.2
132
-
133
- ### Patch Changes
134
-
135
- - @module-federation/sdk@0.21.2
136
-
137
- ## 0.21.1
138
-
139
- ### Patch Changes
140
-
141
- - @module-federation/sdk@0.21.1
142
-
143
- ## 0.21.0
144
-
145
- ### Minor Changes
146
-
147
- - d225658: feat: Add React Router v7 Support to Module Federation Bridge
148
-
149
- ### Patch Changes
150
-
151
- - Updated dependencies [d1e90a4]
152
- - @module-federation/sdk@0.21.0
153
-
154
- ## 0.20.0
155
-
156
- ### Patch Changes
157
-
158
- - Updated dependencies [37346d4]
159
- - Updated dependencies [639a83b]
160
- - @module-federation/sdk@0.20.0
161
-
162
- ## 0.19.1
163
-
164
- ### Patch Changes
165
-
166
- - Updated dependencies
167
- - @module-federation/sdk@0.19.1
168
-
169
- ## 0.19.0
170
-
171
- ### Patch Changes
172
-
173
- - @module-federation/sdk@0.19.0
174
-
175
- ## 0.18.4
176
-
177
- ### Patch Changes
178
-
179
- - Updated dependencies [8061f8c]
180
- - @module-federation/sdk@0.18.4
181
-
182
- ## 0.18.3
183
-
184
- ### Patch Changes
185
-
186
- - @module-federation/sdk@0.18.3
187
-
188
- ## 0.18.2
189
-
190
- ### Patch Changes
191
-
192
- - @module-federation/sdk@0.18.2
193
-
194
- ## 0.18.1
195
-
196
- ### Patch Changes
197
-
198
- - Updated dependencies [0bf3a3a]
199
- - @module-federation/sdk@0.18.1
200
-
201
- ## 0.18.0
202
-
203
- ### Patch Changes
204
-
205
- - Updated dependencies [f6381e6]
206
- - @module-federation/sdk@0.18.0
207
-
208
- ## 0.17.1
209
-
210
- ### Patch Changes
211
-
212
- - a7cf276: chore: upgrade NX to 21.2.3, Storybook to 9.0.9, and TypeScript to 5.8.3
213
- - Upgraded NX from 21.0.3 to 21.2.3 with workspace configuration updates
214
- - Migrated Storybook from 8.3.5 to 9.0.9 with updated configurations and automigrations
215
- - Upgraded TypeScript from 5.7.3 to 5.8.3 with compatibility fixes
216
- - Fixed package exports and type declaration paths across all packages
217
- - Resolved module resolution issues and TypeScript compatibility problems
218
- - Updated build configurations and dependencies to support latest versions
219
-
220
- - Updated dependencies [a7cf276]
221
- - @module-federation/sdk@0.17.1
222
-
223
- ## 0.17.0
224
-
225
- ### Patch Changes
226
-
227
- - @module-federation/sdk@0.17.0
228
-
229
- ## 0.16.0
230
-
231
- ### Patch Changes
232
-
233
- - Updated dependencies [1485fcf]
234
- - @module-federation/sdk@0.16.0
235
-
236
- ## 0.15.0
237
-
238
- ### Patch Changes
239
-
240
- - @module-federation/sdk@0.15.0
241
-
242
- ## 0.14.3
243
-
244
- ### Patch Changes
245
-
246
- - @module-federation/sdk@0.14.3
247
-
248
- ## 0.14.2
249
-
250
- ### Patch Changes
251
-
252
- - @module-federation/sdk@0.14.2
253
-
254
- ## 0.14.1
255
-
256
- ### Patch Changes
257
-
258
- - @module-federation/sdk@0.14.1
259
-
260
- ## 0.14.0
261
-
262
- ### Patch Changes
263
-
264
- - Updated dependencies [82b8cac]
265
- - @module-federation/sdk@0.14.0
266
-
267
- ## 0.13.1
268
-
269
- ### Patch Changes
270
-
271
- - @module-federation/sdk@0.13.1
272
-
273
- ## 0.13.0
274
-
275
- ### Patch Changes
276
-
277
- - 38f324f: Disable live bindings on cjs builds of the runtime packages
278
- - Updated dependencies [38f324f]
279
- - @module-federation/sdk@0.13.0
280
-
281
- ## 0.12.0
282
-
283
- ### Patch Changes
284
-
285
- - Updated dependencies [c399b9a]
286
- - Updated dependencies [ef96c4d]
287
- - Updated dependencies [f4fb242]
288
- - @module-federation/sdk@0.12.0
289
-
290
- ## 0.11.4
291
-
292
- ### Patch Changes
293
-
294
- - Updated dependencies [64a2bc1]
295
- - Updated dependencies [c14842f]
296
- - @module-federation/sdk@0.11.4
297
-
298
- ## 0.11.3
299
-
300
- ### Patch Changes
301
-
302
- - @module-federation/sdk@0.11.3
303
-
304
- ## 0.11.2
305
-
306
- ### Patch Changes
307
-
308
- - Updated dependencies [047857b]
309
- - @module-federation/sdk@0.11.2
310
-
311
- ## 0.11.1
312
-
313
- ### Patch Changes
314
-
315
- - @module-federation/sdk@0.11.1
316
-
317
- ## 0.11.0
318
-
319
- ### Patch Changes
320
-
321
- - Updated dependencies [fce107e]
322
- - @module-federation/sdk@0.11.0
323
-
324
- ## 0.10.0
325
-
326
- ### Patch Changes
327
-
328
- - Updated dependencies [0f71cbc]
329
- - Updated dependencies [22fcccd]
330
- - @module-federation/sdk@0.10.0
331
-
332
- ## 0.9.1
333
-
334
- ### Patch Changes
335
-
336
- - Updated dependencies [35d925b]
337
- - Updated dependencies [35d925b]
338
- - Updated dependencies [8acd217]
339
- - @module-federation/sdk@0.9.1
340
-
341
- ## 0.9.0
342
-
343
- ### Patch Changes
344
-
345
- - @module-federation/sdk@0.9.0
346
-
347
- ## 0.8.12
348
-
349
- ### Patch Changes
350
-
351
- - @module-federation/sdk@0.8.12
352
-
353
- ## 0.8.11
354
-
355
- ### Patch Changes
356
-
357
- - @module-federation/sdk@0.8.11
358
-
359
- ## 0.8.10
360
-
361
- ### Patch Changes
362
-
363
- - @module-federation/sdk@0.8.10
364
-
365
- ## 0.8.9
366
-
367
- ### Patch Changes
368
-
369
- - @module-federation/sdk@0.8.9
370
-
371
- ## 0.8.8
372
-
373
- ### Patch Changes
374
-
375
- - @module-federation/sdk@0.8.8
376
-
377
- ## 0.8.7
378
-
379
- ### Patch Changes
380
-
381
- - Updated dependencies [835b09c]
382
- - Updated dependencies [336f3d8]
383
- - Updated dependencies [4fd33fb]
384
- - @module-federation/sdk@0.8.7
385
-
386
- ## 0.8.6
387
-
388
- ### Patch Changes
389
-
390
- - @module-federation/sdk@0.8.6
391
-
392
- ## 0.8.5
393
-
394
- ### Patch Changes
395
-
396
- - @module-federation/sdk@0.8.5
397
-
398
- ## 0.8.4
399
-
400
- ### Patch Changes
401
-
402
- - @module-federation/sdk@0.8.4
403
-
404
- ## 0.8.3
405
-
406
- ### Patch Changes
407
-
408
- - Updated dependencies [8e172c8]
409
- - @module-federation/sdk@0.8.3
410
-
411
- ## 0.8.2
412
-
413
- ### Patch Changes
414
-
415
- - @module-federation/sdk@0.8.2
416
-
417
- ## 0.8.1
418
-
419
- ### Patch Changes
420
-
421
- - @module-federation/sdk@0.8.1
422
-
423
- ## 0.8.0
424
-
425
- ### Patch Changes
426
-
427
- - @module-federation/sdk@0.8.0
428
-
429
- ## 0.7.7
430
-
431
- ### Patch Changes
432
-
433
- - @module-federation/sdk@0.7.7
434
-
435
- ## 0.7.6
436
-
437
- ### Patch Changes
438
-
439
- - @module-federation/sdk@0.7.6
440
-
441
- ## 0.7.5
442
-
443
- ### Patch Changes
444
-
445
- - 0309fb5: fix: wrap try catch with react-router-dom path resolve
446
- - @module-federation/sdk@0.7.5
447
-
448
- ## 0.7.4
449
-
450
- ### Patch Changes
451
-
452
- - @module-federation/sdk@0.7.4
453
-
454
- ## 0.7.3
455
-
456
- ### Patch Changes
457
-
458
- - Updated dependencies [4ab9295]
459
- - @module-federation/sdk@0.7.3
460
-
461
- ## 0.7.2
462
-
463
- ### Patch Changes
464
-
465
- - @module-federation/sdk@0.7.2
466
-
467
- ## 0.7.1
468
-
469
- ### Patch Changes
470
-
471
- - Updated dependencies [6db4c5f]
472
- - @module-federation/sdk@0.7.1
473
-
474
- ## 0.7.0
475
-
476
- ### Minor Changes
477
-
478
- - 3942740: add license information
479
- - Updated dependencies [879ad87]
480
- - Updated dependencies [4eb09e7]
481
- - Updated dependencies [206b56d]
482
- - @module-federation/sdk@0.7.0
483
-
484
- ## 0.6.16
485
-
486
- ### Patch Changes
487
-
488
- - Updated dependencies [f779188]
489
- - Updated dependencies [024df60]
490
- - @module-federation/sdk@0.6.16
491
-
492
- ## 0.6.15
493
-
494
- ### Patch Changes
495
-
496
- - @module-federation/sdk@0.6.15
497
-
498
- ## 0.6.14
499
-
500
- ### Patch Changes
501
-
502
- - Updated dependencies [ad605d2]
503
- - @module-federation/sdk@0.6.14
504
-
505
- ## 0.6.13
506
-
507
- ### Patch Changes
508
-
509
- - @module-federation/sdk@0.6.13
510
-
511
- ## 0.6.12
512
-
513
- ### Patch Changes
514
-
515
- - @module-federation/sdk@0.6.12
516
-
517
- ## 0.6.11
518
-
519
- ### Patch Changes
520
-
521
- - Updated dependencies [d5a3072]
522
- - @module-federation/sdk@0.6.11
523
-
524
- ## 0.6.10
525
-
526
- ### Patch Changes
527
-
528
- - Updated dependencies [22a3b83]
529
- - @module-federation/sdk@0.6.10
530
-
531
- ## 0.6.9
532
-
533
- ### Patch Changes
534
-
535
- - @module-federation/sdk@0.6.9
536
-
537
- ## 0.6.8
538
-
539
- ### Patch Changes
540
-
541
- - Updated dependencies [32db0ac]
542
- - @module-federation/sdk@0.6.8
543
-
544
- ## 0.6.7
545
-
546
- ### Patch Changes
547
-
548
- - Updated dependencies [9e32644]
549
- - @module-federation/sdk@0.6.7
550
-
551
- ## 0.6.6
552
-
553
- ### Patch Changes
554
-
555
- - @module-federation/sdk@0.6.6
556
-
557
- ## 0.6.5
558
-
559
- ### Patch Changes
560
-
561
- - @module-federation/sdk@0.6.5
562
-
563
- ## 0.6.4
564
-
565
- ### Patch Changes
566
-
567
- - d90295b: chore: adjust bridge router alias strategy to alias to router-v6 when not found react-router-dom in package.json
568
- - @module-federation/sdk@0.6.4
569
-
570
- ## 0.6.3
571
-
572
- ### Patch Changes
573
-
574
- - @module-federation/sdk@0.6.3
575
-
576
- ## 0.6.2
577
-
578
- ### Patch Changes
579
-
580
- - @module-federation/sdk@0.6.2
581
-
582
- ## 0.6.1
583
-
584
- ### Patch Changes
585
-
586
- - Updated dependencies [2855583]
587
- - Updated dependencies [813680f]
588
- - @module-federation/sdk@0.6.1
589
-
590
- ## 0.6.0
591
-
592
- ### Patch Changes
593
-
594
- - Updated dependencies [1d9bb77]
595
- - @module-federation/sdk@0.6.0
596
-
597
- ## 0.5.2
598
-
599
- ### Patch Changes
600
-
601
- - Updated dependencies [b90fa7d]
602
- - @module-federation/sdk@0.5.2
603
-
604
- ## 0.5.1
605
-
606
- ### Patch Changes
607
-
608
- - 472e2cc: feat: enchance react-bridge react-router-dom alias according to origin react-router-dom version
609
- - @module-federation/sdk@0.5.1
610
-
611
- ## 0.5.0
612
-
613
- ### Patch Changes
614
-
615
- - 49d6135: feat(@module-federation/bridge): enhance Bridge capabilities and fix some issues
616
- - Updated dependencies [8378a77]
617
- - @module-federation/sdk@0.5.0
618
-
619
- ## 0.4.0
620
-
621
- ### Patch Changes
622
-
623
- - Updated dependencies [a6e2bed]
624
- - Updated dependencies [a6e2bed]
625
- - @module-federation/sdk@0.4.0
626
-
627
- ## 0.3.5
628
-
629
- ### Patch Changes
630
-
631
- - @module-federation/sdk@0.3.5
632
-
633
- ## 0.3.4
634
-
635
- ### Patch Changes
636
-
637
- - @module-federation/sdk@0.3.4
638
-
639
- ## 0.3.3
640
-
641
- ### Patch Changes
642
-
643
- - @module-federation/sdk@0.3.3
644
-
645
- ## 0.3.2
646
-
647
- ### Patch Changes
648
-
649
- - @module-federation/sdk@0.3.2
650
-
651
- ## 0.3.1
652
-
653
- ### Patch Changes
654
-
655
- - @module-federation/sdk@0.3.1
656
-
657
- ## 0.3.0
658
-
659
- ### Patch Changes
660
-
661
- - Updated dependencies [fa37cc4]
662
- - @module-federation/sdk@0.3.0
663
-
664
- ## 0.2.8
665
-
666
- ### Patch Changes
667
-
668
- - @module-federation/sdk@0.2.8
669
-
670
- ## 0.2.7
671
-
672
- ### Patch Changes
673
-
674
- - Updated dependencies [b00ef13]
675
- - @module-federation/sdk@0.2.7
676
-
677
- ## 0.2.6
678
-
679
- ### Patch Changes
680
-
681
- - Updated dependencies [91bf689]
682
- - @module-federation/sdk@0.2.6
683
-
684
- ## 0.2.5
685
-
686
- ### Patch Changes
687
-
688
- - Updated dependencies [8cce571]
689
- - @module-federation/sdk@0.2.5
690
-
691
- ## 0.2.4
692
-
693
- ### Patch Changes
694
-
695
- - Updated dependencies [09b792d]
696
- - Updated dependencies [09b792d]
697
- - @module-federation/sdk@0.2.4
698
-
699
- ## 0.2.3
700
-
701
- ### Patch Changes
702
-
703
- - Updated dependencies [32f26af]
704
- - Updated dependencies [32f26af]
705
- - @module-federation/sdk@0.2.3
706
-
707
- ## 0.2.2
708
-
709
- ### Patch Changes
710
-
711
- - @module-federation/sdk@0.2.2
712
-
713
- ## 0.2.1
714
-
715
- ### Patch Changes
716
-
717
- - Updated dependencies [88445e7]
718
- - @module-federation/sdk@0.2.1
719
-
720
- ## 0.2.0
721
-
722
- ### Minor Changes
723
-
724
- - d2ab821: feat(bridge): Supports exporting and loading of application-level modules (with routing), currently supports react and vue3
725
-
726
- ### Patch Changes
727
-
728
- - @module-federation/sdk@0.2.0
@@ -1,71 +0,0 @@
1
- {
2
- "name": "react-router-dom",
3
- "version": "5.3.4",
4
- "description": "DOM bindings for React Router",
5
- "homepage": "https://reactrouter.com/",
6
- "repository": {
7
- "url": "https://github.com/remix-run/react-router.git",
8
- "type": "git",
9
- "directory": "packages/react-router-dom"
10
- },
11
- "license": "MIT",
12
- "author": "Remix Software <hello@remix.run>",
13
- "files": [
14
- "LICENSE",
15
- "README.md",
16
- "BrowserRouter.js",
17
- "HashRouter.js",
18
- "Link.js",
19
- "MemoryRouter.js",
20
- "NavLink.js",
21
- "Prompt.js",
22
- "Redirect.js",
23
- "Route.js",
24
- "Router.js",
25
- "StaticRouter.js",
26
- "Switch.js",
27
- "cjs",
28
- "es",
29
- "esm",
30
- "index.js",
31
- "generatePath.js",
32
- "matchPath.js",
33
- "modules/*.js",
34
- "modules/utils/*.js",
35
- "withRouter.js",
36
- "warnAboutDeprecatedCJSRequire.js",
37
- "umd"
38
- ],
39
- "main": "index.js",
40
- "module": "esm/react-router-dom.js",
41
- "sideEffects": false,
42
- "scripts": {
43
- "build": "rollup -c",
44
- "lint": "eslint modules"
45
- },
46
- "peerDependencies": {
47
- "react": ">=15"
48
- },
49
- "dependencies": {
50
- "@babel/runtime": "^7.12.13",
51
- "history": "^4.9.0",
52
- "loose-envify": "^1.3.1",
53
- "prop-types": "^15.6.2",
54
- "react-router": "5.3.4",
55
- "tiny-invariant": "^1.0.2",
56
- "tiny-warning": "^1.0.0"
57
- },
58
- "browserify": {
59
- "transform": [
60
- "loose-envify"
61
- ]
62
- },
63
- "keywords": [
64
- "react",
65
- "router",
66
- "route",
67
- "routing",
68
- "history",
69
- "link"
70
- ]
71
- }
@@ -1,49 +0,0 @@
1
- {
2
- "name": "react-router-dom",
3
- "version": "6.22.3",
4
- "description": "Declarative routing for React web applications",
5
- "keywords": [
6
- "react",
7
- "router",
8
- "route",
9
- "routing",
10
- "history",
11
- "link"
12
- ],
13
- "repository": {
14
- "type": "git",
15
- "url": "https://github.com/remix-run/react-router",
16
- "directory": "packages/react-router-dom"
17
- },
18
- "license": "MIT",
19
- "author": "Remix Software <hello@remix.run>",
20
- "sideEffects": false,
21
- "main": "./dist/main.js",
22
- "unpkg": "./dist/umd/react-router-dom.production.min.js",
23
- "module": "./dist/index.js",
24
- "types": "./dist/index.d.ts",
25
- "dependencies": {
26
- "@remix-run/router": "1.15.3",
27
- "react-router": "6.22.3"
28
- },
29
- "devDependencies": {
30
- "react": "^18.3.1",
31
- "react-dom": "^18.3.1"
32
- },
33
- "peerDependencies": {
34
- "react": ">=16.8",
35
- "react-dom": ">=16.8"
36
- },
37
- "files": [
38
- "dist/",
39
- "CHANGELOG.md",
40
- "LICENSE.md",
41
- "README.md",
42
- "server.d.ts",
43
- "server.js",
44
- "server.mjs"
45
- ],
46
- "engines": {
47
- "node": ">=14.0.0"
48
- }
49
- }
@@ -1,45 +0,0 @@
1
- {
2
- "name": "react-router",
3
- "version": "7.0.0",
4
- "description": "Declarative routing for React applications",
5
- "keywords": [
6
- "react",
7
- "router",
8
- "route",
9
- "routing",
10
- "history",
11
- "link"
12
- ],
13
- "repository": {
14
- "type": "git",
15
- "url": "https://github.com/remix-run/react-router",
16
- "directory": "packages/react-router"
17
- },
18
- "license": "MIT",
19
- "author": "Remix Software <hello@remix.run>",
20
- "sideEffects": false,
21
- "main": "./dist/main.js",
22
- "unpkg": "./dist/umd/react-router.production.min.js",
23
- "module": "./dist/index.js",
24
- "types": "./dist/index.d.ts",
25
- "dependencies": {
26
- "@remix-run/router": "2.0.0"
27
- },
28
- "devDependencies": {
29
- "react": "^18.3.1",
30
- "react-dom": "^18.3.1"
31
- },
32
- "peerDependencies": {
33
- "react": ">=18.0.0",
34
- "react-dom": ">=18.0.0"
35
- },
36
- "files": [
37
- "dist/",
38
- "CHANGELOG.md",
39
- "LICENSE.md",
40
- "README.md"
41
- ],
42
- "engines": {
43
- "node": ">=18.0.0"
44
- }
45
- }
@@ -1,102 +0,0 @@
1
- import path from 'node:path';
2
- import { checkVersion, findPackageJson } from '../src/utils';
3
- import { getBridgeRouterAlias } from '../src/router-alias';
4
-
5
- const resolveRouterV5 = path.resolve(
6
- __dirname,
7
- '../__tests__/mockRouterDir/router-v5/react-router-dom',
8
- );
9
- const resolveRouterV5_PkgPath = path.resolve(
10
- __dirname,
11
- '../__tests__/mockRouterDir/router-v5/react-router-dom/package.json',
12
- );
13
- const resolveRouterV6 = path.resolve(
14
- __dirname,
15
- '../__tests__/mockRouterDir/router-v6/react-router-dom/dist/main.js',
16
- );
17
- const resolveRouterV6_PkgPath = path.resolve(
18
- __dirname,
19
- '../__tests__/mockRouterDir/router-v6/react-router-dom/package.json',
20
- );
21
- const resolveRouterV7 = path.resolve(
22
- __dirname,
23
- '../__tests__/mockRouterDir/router-v7/react-router',
24
- );
25
- const resolveRouterV7_PkgPath = path.resolve(
26
- __dirname,
27
- '../__tests__/mockRouterDir/router-v7/react-router/package.json',
28
- );
29
-
30
- describe('test checkVersion: should return the correct major version for react-router-dom', () => {
31
- it('should return 5', () => {
32
- expect(checkVersion('5.0.0')).toBe(5);
33
- });
34
-
35
- it('should return 5', () => {
36
- expect(checkVersion('^5.0.0')).toBe(5);
37
- });
38
-
39
- it('should return 6', () => {
40
- expect(checkVersion('6.0.0')).toBe(6);
41
- });
42
-
43
- it('should return 6', () => {
44
- expect(checkVersion('~6.0.0')).toBe(6);
45
- });
46
-
47
- it('should return 6', () => {
48
- expect(checkVersion('^6.0.0')).toBe(6);
49
- });
50
-
51
- it('should return 7', () => {
52
- expect(checkVersion('7.0.0')).toBe(7);
53
- });
54
-
55
- it('should return 7', () => {
56
- expect(checkVersion('~7.0.0')).toBe(7);
57
- });
58
-
59
- it('should return 7', () => {
60
- expect(checkVersion('^7.0.0')).toBe(7);
61
- });
62
- });
63
-
64
- describe('test findPackageJson: should return the correct package.json path for react-router-dom v5, v6 and react-router v7', () => {
65
- it('should return the package.json path', () => {
66
- expect(findPackageJson(resolveRouterV5)).toBe(resolveRouterV5_PkgPath);
67
- expect(findPackageJson(resolveRouterV6)).toBe(resolveRouterV6_PkgPath);
68
- expect(findPackageJson(resolveRouterV7)).toBe(resolveRouterV7_PkgPath);
69
- });
70
- });
71
-
72
- describe('test getBridgeRouterAlias: should return the correct alias for react-router-dom v5, v6 and react-router v7', () => {
73
- it('should return the correct alias for router v5', () => {
74
- const res = getBridgeRouterAlias(resolveRouterV5);
75
- expect(res).toEqual({
76
- 'react-router-dom$':
77
- '@module-federation/bridge-react/dist/router-v5.es.js',
78
- 'react-router-dom/index.js': resolveRouterV5,
79
- });
80
- });
81
-
82
- it('should return the correct alias for router v6', () => {
83
- const res = getBridgeRouterAlias(resolveRouterV6);
84
- expect(res).toEqual({
85
- 'react-router-dom$':
86
- '@module-federation/bridge-react/dist/router-v6.es.js',
87
- 'react-router-dom/dist/index.js': resolveRouterV6,
88
- });
89
- });
90
-
91
- it('should return the correct alias for router v7', () => {
92
- const res = getBridgeRouterAlias(resolveRouterV7);
93
- expect(res).toEqual({
94
- 'react-router$': '@module-federation/bridge-react/dist/router-v7.es.js',
95
- 'react-router-dom$':
96
- '@module-federation/bridge-react/dist/router-v7.es.js',
97
- 'react-router/dist/development/index.js': resolveRouterV7,
98
- 'react-router/dist/production/index.js': resolveRouterV7,
99
- 'react-router-dom/dist/index.js': resolveRouterV7,
100
- });
101
- });
102
- });
package/src/index.ts DELETED
@@ -1,62 +0,0 @@
1
- import fs from 'node:fs';
2
- import path from 'node:path';
3
- import type { moduleFederationPlugin } from '@module-federation/sdk';
4
- import { getBridgeRouterAlias } from './router-alias';
5
-
6
- class ReactBridgeAliasChangerPlugin {
7
- alias: string;
8
- targetFile: string;
9
- moduleFederationOptions: moduleFederationPlugin.ModuleFederationPluginOptions;
10
- constructor(info: {
11
- moduleFederationOptions: moduleFederationPlugin.ModuleFederationPluginOptions;
12
- }) {
13
- this.moduleFederationOptions = info.moduleFederationOptions;
14
- this.alias = 'react-router-dom$';
15
- this.targetFile = '@module-federation/bridge-react/dist/router.es.js';
16
-
17
- if (this.moduleFederationOptions.shared) {
18
- if (Array.isArray(this.moduleFederationOptions.shared)) {
19
- if (this.moduleFederationOptions.shared.includes('react-router-dom')) {
20
- throw Error(
21
- 'React-router-dom cannot be set to shared after react bridge is used',
22
- );
23
- }
24
- } else {
25
- if (this.moduleFederationOptions.shared['react-router-dom']) {
26
- throw Error(
27
- 'React-router-dom cannot be set to shared after react bridge is used',
28
- );
29
- }
30
- }
31
- }
32
- }
33
-
34
- apply(compiler: any) {
35
- compiler.hooks.afterEnvironment.tap('ReactBridgeAliasPlugin', () => {
36
- // Gets the path to the node_modules directory
37
- const nodeModulesPath = path.resolve(compiler.context, 'node_modules');
38
- const targetFilePath = path.join(nodeModulesPath, this.targetFile);
39
-
40
- if (fs.existsSync(targetFilePath)) {
41
- const originalResolve = compiler.options.resolve || {};
42
- const originalAlias = originalResolve.alias || {};
43
-
44
- // Update alias - set up router version alias
45
- const updatedAlias: Record<string, string> = {
46
- // allow `alias` can be override
47
- // [this.alias]: targetFilePath,
48
- ...getBridgeRouterAlias(originalAlias['react-router-dom']),
49
- ...originalAlias,
50
- };
51
-
52
- // Update the webpack configuration
53
- compiler.options.resolve = {
54
- ...originalResolve,
55
- alias: updatedAlias,
56
- };
57
- }
58
- });
59
- }
60
- }
61
-
62
- export default ReactBridgeAliasChangerPlugin;
@@ -1,124 +0,0 @@
1
- import fs from 'node:fs';
2
- import path from 'node:path';
3
- import { checkVersion, findPackageJson, getDependencies } from './utils';
4
-
5
- const reactRouterDomV5AliasPath =
6
- '@module-federation/bridge-react/dist/router-v5.es.js';
7
- const reactRouterDomV6AliasPath =
8
- '@module-federation/bridge-react/dist/router-v6.es.js';
9
- const reactRouterDomV7AliasPath =
10
- '@module-federation/bridge-react/dist/router-v7.es.js';
11
-
12
- const createReactRouterV7Alias = (
13
- reactRouterDomPath: string,
14
- ): Record<string, string> => {
15
- const baseAlias = {
16
- 'react-router$': reactRouterDomV7AliasPath,
17
- 'react-router-dom$': reactRouterDomV7AliasPath, // Keep compatibility for old imports
18
- };
19
-
20
- const resolvedDistPaths: Record<string, string> = {
21
- 'react-router/dist/development/index.js': reactRouterDomPath,
22
- 'react-router/dist/production/index.js': reactRouterDomPath,
23
- };
24
-
25
- const legacyCompatibility: Record<string, string> = {
26
- 'react-router-dom/dist/index.js': reactRouterDomPath,
27
- };
28
-
29
- return {
30
- ...baseAlias,
31
- ...resolvedDistPaths,
32
- ...legacyCompatibility,
33
- };
34
- };
35
-
36
- const createReactRouterV5Alias = (
37
- reactRouterDomPath: string,
38
- ): Record<string, string> => {
39
- return {
40
- 'react-router-dom$': reactRouterDomV5AliasPath,
41
- 'react-router-dom/index.js': reactRouterDomPath,
42
- };
43
- };
44
-
45
- const createReactRouterV6Alias = (
46
- reactRouterDomPath: string,
47
- ): Record<string, string> => {
48
- return {
49
- 'react-router-dom$': reactRouterDomV6AliasPath,
50
- 'react-router-dom/dist/index.js': reactRouterDomPath,
51
- };
52
- };
53
-
54
- const setRouterAlias = (
55
- majorVersion: number,
56
- reactRouterDomPath: string,
57
- ): Record<string, string> => {
58
- switch (majorVersion) {
59
- case 5:
60
- return createReactRouterV5Alias(reactRouterDomPath);
61
- case 6:
62
- return createReactRouterV6Alias(reactRouterDomPath);
63
- case 7:
64
- return createReactRouterV7Alias(reactRouterDomPath);
65
- default:
66
- console.warn(
67
- `Unsupported React Router version: ${majorVersion}. Defaulting to v7.`,
68
- );
69
- return createReactRouterV7Alias(reactRouterDomPath);
70
- }
71
- };
72
-
73
- export const getBridgeRouterAlias = (
74
- originalAlias: string,
75
- ): Record<string, string> => {
76
- const userDependencies = getDependencies();
77
- let reactRouterDomPath = '';
78
-
79
- if (originalAlias) {
80
- reactRouterDomPath = originalAlias;
81
- } else if (userDependencies['react-router']) {
82
- // React Router v7 uses 'react-router' package name
83
- reactRouterDomPath = path.resolve(
84
- process.cwd(),
85
- 'node_modules/react-router',
86
- );
87
- } else if (userDependencies['react-router-dom']) {
88
- // React Router v5/v6 uses 'react-router-dom' package name
89
- reactRouterDomPath = path.resolve(
90
- process.cwd(),
91
- 'node_modules/react-router-dom',
92
- );
93
- }
94
-
95
- // Generate alias based on detected router package
96
- if (reactRouterDomPath) {
97
- const packageJsonPath = findPackageJson(reactRouterDomPath);
98
- if (packageJsonPath) {
99
- const packageJsonContent = JSON.parse(
100
- fs.readFileSync(packageJsonPath, 'utf-8'),
101
- );
102
- const majorVersion = checkVersion(packageJsonContent.version);
103
- const bridgeRouterAlias = setRouterAlias(
104
- majorVersion,
105
- reactRouterDomPath,
106
- );
107
- console.log(
108
- '<<<<<<<<<<<<< bridgeRouterAlias >>>>>>>>>>>>>',
109
- bridgeRouterAlias,
110
- );
111
- return bridgeRouterAlias;
112
- }
113
- }
114
-
115
- // Default to v6 which uses 'react-router-dom'
116
- const bridgeRouterAlias = {
117
- 'react-router-dom$': reactRouterDomV6AliasPath,
118
- };
119
- console.log(
120
- '<<<<<<<<<<<<< default bridgeRouterAlias >>>>>>>>>>>>>',
121
- bridgeRouterAlias,
122
- );
123
- return bridgeRouterAlias;
124
- };
package/src/utils.ts DELETED
@@ -1,52 +0,0 @@
1
- import fs from 'node:fs';
2
- import path from 'node:path';
3
- import semver from 'semver';
4
-
5
- export const checkVersion = (version: string) => {
6
- // Extract the version number starting from the first digit
7
- const versionMatch = version.match(/\d.*/);
8
- if (!versionMatch) return 0;
9
-
10
- const cleanVersion = versionMatch[0];
11
-
12
- if (semver.gte(cleanVersion, '5.0.0') && semver.lt(cleanVersion, '6.0.0')) {
13
- return 5;
14
- } else if (
15
- semver.gte(cleanVersion, '6.0.0') &&
16
- semver.lt(cleanVersion, '7.0.0')
17
- ) {
18
- return 6;
19
- } else if (semver.gte(cleanVersion, '7.0.0')) {
20
- return 7;
21
- }
22
-
23
- return 0;
24
- };
25
-
26
- export const findPackageJson = (startPath: string): string | null => {
27
- let currentPath = startPath;
28
- while (currentPath !== path.parse(currentPath).root) {
29
- const packageJsonPath = path.join(currentPath, 'package.json');
30
- if (fs.existsSync(packageJsonPath)) {
31
- return packageJsonPath;
32
- }
33
- currentPath = path.dirname(currentPath);
34
- }
35
- return null;
36
- };
37
-
38
- export const getDependencies = () => {
39
- const userPackageJsonPath = path.resolve(process.cwd(), 'package.json');
40
- let userDependencies: Record<string, string> = {};
41
-
42
- if (fs.existsSync(userPackageJsonPath)) {
43
- const userPackageJson = JSON.parse(
44
- fs.readFileSync(userPackageJsonPath, 'utf-8'),
45
- );
46
- userDependencies = {
47
- ...userPackageJson.dependencies,
48
- ...userPackageJson.devDependencies,
49
- };
50
- }
51
- return userDependencies;
52
- };
package/tsconfig.json DELETED
@@ -1,42 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "useDefineForClassFields": true,
4
-
5
- /* Bundler mode */
6
- "allowImportingTsExtensions": true,
7
- "resolveJsonModule": true,
8
-
9
- "declarationDir": "./dist/types",
10
- "rootDir": "./src",
11
- "module": "commonjs",
12
- "target": "es5",
13
-
14
- /* Linting */
15
- "noUnusedLocals": true,
16
- "noUnusedParameters": true,
17
- "noFallthroughCasesInSwitch": true,
18
- "declaration": true,
19
- "emitDeclarationOnly": true,
20
- "outDir": "dist",
21
- "skipLibCheck": true,
22
- "strict": true,
23
- "moduleResolution": "node",
24
- "lib": ["esnext", "dom"],
25
- "jsx": "preserve",
26
- "esModuleInterop": true,
27
- "allowSyntheticDefaultImports": true,
28
- "sourceMap": true,
29
- "baseUrl": ".",
30
- "paths": {
31
- "@/*": ["src/*"]
32
- }
33
- },
34
- "include": [
35
- "src/**/*.ts",
36
- "src/**/*.tsx",
37
- "src/**/*.vue",
38
- "src/remoteApp.tsx",
39
- "src/create.ts"
40
- ],
41
- "references": [{ "path": "./tsconfig.node.json" }]
42
- }
@@ -1,11 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "composite": true,
4
- "skipLibCheck": true,
5
- "module": "ESNext",
6
- "moduleResolution": "bundler",
7
- "allowSyntheticDefaultImports": true,
8
- "strict": true
9
- },
10
- "include": ["vite.config.ts"]
11
- }
package/vite.config.ts DELETED
@@ -1,24 +0,0 @@
1
- import { defineConfig } from 'vite';
2
- import path from 'path';
3
- import dts from 'vite-plugin-dts';
4
-
5
- export default defineConfig({
6
- plugins: [
7
- dts({
8
- rollupTypes: true,
9
- }),
10
- ],
11
- build: {
12
- lib: {
13
- entry: {
14
- index: path.resolve(__dirname, 'src/index.ts'),
15
- },
16
- formats: ['cjs', 'es'],
17
- fileName: (format, entryName) => `${entryName}.${format}.js`,
18
- },
19
- rollupOptions: {
20
- external: ['node:fs', 'node:path'],
21
- },
22
- minify: false,
23
- },
24
- });
package/vitest.config.ts DELETED
@@ -1,22 +0,0 @@
1
- import { defineConfig } from 'vitest/config';
2
- import tsconfigPaths from 'vite-tsconfig-paths';
3
- import path from 'path';
4
- export default defineConfig({
5
- define: {
6
- __DEV__: true,
7
- __TEST__: true,
8
- __BROWSER__: false,
9
- __VERSION__: '"unknown"',
10
- __APP_VERSION__: '"0.0.0"',
11
- },
12
- plugins: [tsconfigPaths()],
13
- test: {
14
- environment: 'jsdom',
15
- include: [
16
- path.resolve(__dirname, '__tests__/*.spec.ts'),
17
- path.resolve(__dirname, '__tests__/*.spec.tsx'),
18
- ],
19
- globals: true,
20
- testTimeout: 10000,
21
- },
22
- });