Skip to content

Commit 7f870fa

Browse files
committed
refactor(rsc-mf): route exposed modules through runtime bootstrap wrappers
1 parent d6464ff commit 7f870fa

8 files changed

Lines changed: 22 additions & 8 deletions

File tree

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ export default createModuleFederationConfig({
108108
filename: 'static/remoteEntry.js',
109109
exposes: {
110110
'./RemoteClientCounter': {
111-
import: './src/components/RemoteClientCounter.tsx',
111+
import: './src/runtime/exposes/RemoteClientCounter.tsx',
112112
layer: LAYERS.rsc,
113113
} as any,
114114
'./src/components/RemoteClientCounter.tsx': {
115-
import: './src/components/RemoteClientCounter.tsx',
115+
import: './src/runtime/exposes/RemoteClientCounter.tsx',
116116
layer: LAYERS.rsc,
117117
} as any,
118118
'./RemoteClientBadge': {
119-
import: './src/components/RemoteClientBadge.tsx',
119+
import: './src/runtime/exposes/RemoteClientBadge.tsx',
120120
layer: LAYERS.rsc,
121121
} as any,
122122
'./RemoteServerCard': {
@@ -144,19 +144,19 @@ export default createModuleFederationConfig({
144144
layer: LAYERS.rsc,
145145
} as any,
146146
'./actions': {
147-
import: './src/components/actions.ts',
147+
import: './src/runtime/exposes/actions.ts',
148148
layer: LAYERS.rsc,
149149
} as any,
150150
'./nestedActions': {
151-
import: './src/components/nestedActions.ts',
151+
import: './src/runtime/exposes/nestedActions.ts',
152152
layer: LAYERS.rsc,
153153
} as any,
154154
'./defaultAction': {
155-
import: './src/components/defaultAction.ts',
155+
import: './src/runtime/exposes/defaultAction.ts',
156156
layer: LAYERS.rsc,
157157
} as any,
158158
'./actionBundle': {
159-
import: './src/components/actionBundle.ts',
159+
import: './src/runtime/exposes/actionBundle.ts',
160160
layer: LAYERS.rsc,
161161
} as any,
162162
'./infoBundle': {

tests/integration/rsc-mf/remote/src/components/RemoteClientCounter.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import './RemoteClientCounter.css';
44
import { incrementRemoteCount, remoteActionEcho } from './actions';
55
import { defaultRemoteAction } from './defaultAction';
66
import { nestedRemoteAction } from './nestedActions';
7-
import '../runtime/initServerCallback';
87

98
export function RemoteClientCounter() {
109
const [localCount, setLocalCount] = useState(0);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import '../initServerCallback';
2+
export { default } from '../../components/RemoteClientBadge';
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import '../initServerCallback';
2+
export { RemoteClientCounter } from '../../components/RemoteClientCounter';
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import '../initServerCallback';
2+
export * from '../../components/actionBundle';
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import '../initServerCallback';
2+
export {
3+
incrementRemoteCount,
4+
remoteActionEcho,
5+
} from '../../components/actions';
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import '../initServerCallback';
2+
export { defaultRemoteAction } from '../../components/defaultAction';
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import '../initServerCallback';
2+
export { nestedRemoteAction } from '../../components/nestedActions';

0 commit comments

Comments
 (0)