Skip to content

Commit e2ab44d

Browse files
committed
refactor(rsc-mf): keep remote exposes as plain userland strings
1 parent 3b75a5c commit e2ab44d

2 files changed

Lines changed: 4 additions & 12 deletions

File tree

tests/integration/rsc-mf/remote/module-federation.config.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import path from 'path';
22
import { createModuleFederationConfig } from '@module-federation/modern-js-v3';
3-
import {
4-
type ExposeDefinitionInput,
5-
createRscExposeDefinitions,
6-
} from './src/runtime/createRscExposeDefinitions';
3+
import { createRscExposeDefinitions } from './src/runtime/createRscExposeDefinitions';
74

85
const LAYERS = {
96
ssr: 'server-side-rendering',
@@ -18,7 +15,7 @@ const reactDomServerImport = path.join(
1815
'react-dom.react-server.js',
1916
);
2017
const reactServerDomClientImport = 'react-server-dom-rspack/client.browser';
21-
const remoteExposeImports: Record<string, ExposeDefinitionInput> = {
18+
const remoteExposeImports: Record<string, string> = {
2219
'./RemoteClientCounter': './src/components/RemoteClientCounter.tsx',
2320
'./RemoteClientBadge': './src/components/RemoteClientBadge.tsx',
2421
'./RemoteServerCard': './src/components/RemoteServerCard.tsx',
@@ -31,12 +28,7 @@ const remoteExposeImports: Record<string, ExposeDefinitionInput> = {
3128
'./nestedActions': './src/components/nestedActions.ts',
3229
'./defaultAction': './src/components/defaultAction.ts',
3330
'./actionBundle': './src/components/actionBundle.ts',
34-
'./infoBundle': {
35-
import: [
36-
'./src/components/infoBundle.ts',
37-
'./src/components/infoBundle.ts',
38-
],
39-
},
31+
'./infoBundle': './src/components/infoBundle.ts',
4032
};
4133

4234
const sharedByScope = [

tests/integration/rsc-mf/tests/moduleFederationConfig.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ describe('rsc-mf module federation config contracts', () => {
139139
);
140140
});
141141

142-
it('deduplicates repeated imports in object expose definitions', () => {
142+
it('normalizes string expose definitions into callback-bootstrapped imports', () => {
143143
const remoteConfig = loadRemoteConfig();
144144
const infoBundleExpose = remoteConfig.exposes?.['./infoBundle'] as
145145
| {

0 commit comments

Comments
 (0)