@module-federation/bridge-react 0.0.0-next-20250708121428 → 0.0.0-next-20250709032753

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.
Files changed (70) hide show
  1. package/CHANGELOG.md +4 -8
  2. package/__tests__/bridge.spec.tsx +7 -7
  3. package/dist/{bridge-base-UGCwcMnG.js → bridge-base-BBH982Tz.cjs} +1 -1
  4. package/dist/{bridge-base-BoshEggF.mjs → bridge-base-P6pEjY1q.js} +1 -1
  5. package/dist/index-Cv3p6r66.cjs +235 -0
  6. package/dist/index-D4yt7Udv.js +236 -0
  7. package/dist/index.cjs.js +9 -35
  8. package/dist/index.d.ts +0 -143
  9. package/dist/index.es.js +12 -38
  10. package/dist/plugin.d.ts +0 -9
  11. package/dist/router-v5.cjs.js +1 -1
  12. package/dist/router-v5.d.ts +0 -9
  13. package/dist/router-v5.es.js +1 -1
  14. package/dist/router-v6.cjs.js +1 -1
  15. package/dist/router-v6.d.ts +0 -9
  16. package/dist/router-v6.es.js +1 -1
  17. package/dist/router.cjs.js +1 -1
  18. package/dist/router.d.ts +0 -9
  19. package/dist/router.es.js +1 -1
  20. package/dist/v18.cjs.js +1 -1
  21. package/dist/v18.d.ts +0 -9
  22. package/dist/v18.es.js +1 -1
  23. package/dist/v19.cjs.js +1 -1
  24. package/dist/v19.d.ts +0 -9
  25. package/dist/v19.es.js +1 -1
  26. package/package.json +5 -46
  27. package/src/.eslintrc.js +9 -0
  28. package/src/index.ts +1 -32
  29. package/src/remote/component.tsx +3 -3
  30. package/src/remote/create.tsx +4 -17
  31. package/tsconfig.json +1 -1
  32. package/vite.config.ts +0 -13
  33. package/dist/data-fetch-server-middleware.cjs.js +0 -163
  34. package/dist/data-fetch-server-middleware.d.ts +0 -15
  35. package/dist/data-fetch-server-middleware.es.js +0 -164
  36. package/dist/data-fetch-utils.cjs.js +0 -24
  37. package/dist/data-fetch-utils.d.ts +0 -86
  38. package/dist/data-fetch-utils.es.js +0 -26
  39. package/dist/index-C0fDZB5b.js +0 -45
  40. package/dist/index-CqxytsLY.mjs +0 -46
  41. package/dist/index.esm-BCeUd-x9.mjs +0 -418
  42. package/dist/index.esm-j_1sIRzg.js +0 -417
  43. package/dist/lazy-load-component-plugin-BbqmMGKu.mjs +0 -492
  44. package/dist/lazy-load-component-plugin-DgYHamxE.js +0 -491
  45. package/dist/lazy-load-component-plugin.cjs.js +0 -6
  46. package/dist/lazy-load-component-plugin.d.ts +0 -16
  47. package/dist/lazy-load-component-plugin.es.js +0 -6
  48. package/dist/lazy-utils.cjs.js +0 -24
  49. package/dist/lazy-utils.d.ts +0 -149
  50. package/dist/lazy-utils.es.js +0 -24
  51. package/dist/prefetch-BWabXlKU.js +0 -1332
  52. package/dist/prefetch-CXJhiNUD.mjs +0 -1333
  53. package/dist/utils-BTYYwZcb.mjs +0 -2016
  54. package/dist/utils-iEVlDmyk.js +0 -2015
  55. package/src/lazy/AwaitDataFetch.tsx +0 -215
  56. package/src/lazy/constant.ts +0 -30
  57. package/src/lazy/createLazyComponent.tsx +0 -418
  58. package/src/lazy/data-fetch/cache.ts +0 -296
  59. package/src/lazy/data-fetch/call-data-fetch.ts +0 -13
  60. package/src/lazy/data-fetch/data-fetch-server-middleware.ts +0 -196
  61. package/src/lazy/data-fetch/index.ts +0 -16
  62. package/src/lazy/data-fetch/inject-data-fetch.ts +0 -109
  63. package/src/lazy/data-fetch/prefetch.ts +0 -106
  64. package/src/lazy/data-fetch/runtime-plugin.ts +0 -115
  65. package/src/lazy/index.ts +0 -35
  66. package/src/lazy/logger.ts +0 -6
  67. package/src/lazy/types.ts +0 -75
  68. package/src/lazy/utils.ts +0 -372
  69. package/src/lazy/wrapNoSSR.tsx +0 -10
  70. package/src/plugins/lazy-load-component-plugin.ts +0 -62
@@ -1,10 +0,0 @@
1
- import { createLazyComponent } from './createLazyComponent';
2
- import type { CreateLazyComponentOptions } from './createLazyComponent';
3
-
4
- export function wrapNoSSR<T, E extends keyof T>(
5
- createLazyComponentFn: typeof createLazyComponent<T, E>,
6
- ) {
7
- return (options: Omit<CreateLazyComponentOptions<T, E>, 'noSSR'>) => {
8
- return createLazyComponentFn({ ...options, noSSR: true });
9
- };
10
- }
@@ -1,62 +0,0 @@
1
- import type {
2
- FederationHost,
3
- FederationRuntimePlugin,
4
- } from '@module-federation/runtime';
5
- import {
6
- createLazyComponent,
7
- prefetch,
8
- collectSSRAssets,
9
- autoFetchDataPlugin,
10
- } from '../lazy';
11
- import type { CreateLazyComponentOptions, PrefetchOptions } from '../lazy';
12
-
13
- declare module '@module-federation/runtime-core' {
14
- interface FederationHost {
15
- createLazyComponent<T, E extends keyof T>(
16
- options: Omit<CreateLazyComponentOptions<T, E>, 'instance'>,
17
- ): ReturnType<typeof createLazyComponent<T, E>>;
18
- prefetch(
19
- options: Omit<PrefetchOptions, 'instance'>,
20
- ): ReturnType<typeof prefetch>;
21
- // wrapNoSSR<T, E extends keyof T>(
22
- // createLazyComponentFn: typeof createLazyComponent<T, E>,
23
- // ): (
24
- // options: Omit<CreateLazyComponentOptions<T, E>, 'instance' | 'noSSR'>,
25
- // ) => ReturnType<typeof createLazyComponent<T, E>>;
26
- collectSSRAssets(
27
- options: Omit<Parameters<typeof collectSSRAssets>[0], 'instance'>,
28
- ): ReturnType<typeof collectSSRAssets>;
29
- }
30
- }
31
-
32
- export function lazyLoadComponentPlugin(): FederationRuntimePlugin {
33
- return {
34
- name: 'lazy-load-component-plugin',
35
- apply(instance: FederationHost) {
36
- instance.registerPlugins([autoFetchDataPlugin()]);
37
-
38
- instance.createLazyComponent = (options) => {
39
- return createLazyComponent({
40
- instance,
41
- ...options,
42
- });
43
- };
44
-
45
- instance.prefetch = (options) => {
46
- return prefetch({
47
- instance,
48
- ...options,
49
- });
50
- };
51
-
52
- instance.collectSSRAssets = (options) => {
53
- return collectSSRAssets({
54
- instance,
55
- ...options,
56
- });
57
- };
58
- },
59
- };
60
- }
61
-
62
- export default lazyLoadComponentPlugin;