@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.
- package/CHANGELOG.md +4 -8
- package/__tests__/bridge.spec.tsx +7 -7
- package/dist/{bridge-base-UGCwcMnG.js → bridge-base-BBH982Tz.cjs} +1 -1
- package/dist/{bridge-base-BoshEggF.mjs → bridge-base-P6pEjY1q.js} +1 -1
- package/dist/index-Cv3p6r66.cjs +235 -0
- package/dist/index-D4yt7Udv.js +236 -0
- package/dist/index.cjs.js +9 -35
- package/dist/index.d.ts +0 -143
- package/dist/index.es.js +12 -38
- package/dist/plugin.d.ts +0 -9
- package/dist/router-v5.cjs.js +1 -1
- package/dist/router-v5.d.ts +0 -9
- package/dist/router-v5.es.js +1 -1
- package/dist/router-v6.cjs.js +1 -1
- package/dist/router-v6.d.ts +0 -9
- package/dist/router-v6.es.js +1 -1
- package/dist/router.cjs.js +1 -1
- package/dist/router.d.ts +0 -9
- package/dist/router.es.js +1 -1
- package/dist/v18.cjs.js +1 -1
- package/dist/v18.d.ts +0 -9
- package/dist/v18.es.js +1 -1
- package/dist/v19.cjs.js +1 -1
- package/dist/v19.d.ts +0 -9
- package/dist/v19.es.js +1 -1
- package/package.json +5 -46
- package/src/.eslintrc.js +9 -0
- package/src/index.ts +1 -32
- package/src/remote/component.tsx +3 -3
- package/src/remote/create.tsx +4 -17
- package/tsconfig.json +1 -1
- package/vite.config.ts +0 -13
- package/dist/data-fetch-server-middleware.cjs.js +0 -163
- package/dist/data-fetch-server-middleware.d.ts +0 -15
- package/dist/data-fetch-server-middleware.es.js +0 -164
- package/dist/data-fetch-utils.cjs.js +0 -24
- package/dist/data-fetch-utils.d.ts +0 -86
- package/dist/data-fetch-utils.es.js +0 -26
- package/dist/index-C0fDZB5b.js +0 -45
- package/dist/index-CqxytsLY.mjs +0 -46
- package/dist/index.esm-BCeUd-x9.mjs +0 -418
- package/dist/index.esm-j_1sIRzg.js +0 -417
- package/dist/lazy-load-component-plugin-BbqmMGKu.mjs +0 -492
- package/dist/lazy-load-component-plugin-DgYHamxE.js +0 -491
- package/dist/lazy-load-component-plugin.cjs.js +0 -6
- package/dist/lazy-load-component-plugin.d.ts +0 -16
- package/dist/lazy-load-component-plugin.es.js +0 -6
- package/dist/lazy-utils.cjs.js +0 -24
- package/dist/lazy-utils.d.ts +0 -149
- package/dist/lazy-utils.es.js +0 -24
- package/dist/prefetch-BWabXlKU.js +0 -1332
- package/dist/prefetch-CXJhiNUD.mjs +0 -1333
- package/dist/utils-BTYYwZcb.mjs +0 -2016
- package/dist/utils-iEVlDmyk.js +0 -2015
- package/src/lazy/AwaitDataFetch.tsx +0 -215
- package/src/lazy/constant.ts +0 -30
- package/src/lazy/createLazyComponent.tsx +0 -418
- package/src/lazy/data-fetch/cache.ts +0 -296
- package/src/lazy/data-fetch/call-data-fetch.ts +0 -13
- package/src/lazy/data-fetch/data-fetch-server-middleware.ts +0 -196
- package/src/lazy/data-fetch/index.ts +0 -16
- package/src/lazy/data-fetch/inject-data-fetch.ts +0 -109
- package/src/lazy/data-fetch/prefetch.ts +0 -106
- package/src/lazy/data-fetch/runtime-plugin.ts +0 -115
- package/src/lazy/index.ts +0 -35
- package/src/lazy/logger.ts +0 -6
- package/src/lazy/types.ts +0 -75
- package/src/lazy/utils.ts +0 -372
- package/src/lazy/wrapNoSSR.tsx +0 -10
- package/src/plugins/lazy-load-component-plugin.ts +0 -62
package/src/lazy/wrapNoSSR.tsx
DELETED
|
@@ -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;
|