Skip to content

Commit 80c93fe

Browse files
authored
Merge branch 'main' into fix/use-chalk-for-compat
2 parents 8be7ef9 + 2cb161e commit 80c93fe

File tree

137 files changed

+1927
-373
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+1927
-373
lines changed

.changeset/fix-federated-types-plugin-url-construction.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

.changeset/friendly-oranges-drop.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

apps/modernjs/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# @module-federation/modernjsapp
22

3+
## 0.1.115
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [a50e068]
8+
- @module-federation/enhanced@0.21.4
9+
10+
## 0.1.114
11+
12+
### Patch Changes
13+
14+
- @module-federation/enhanced@0.21.3
15+
316
## 0.1.113
417

518
### Patch Changes

apps/modernjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@module-federation/modernjsapp",
33
"private": true,
4-
"version": "0.1.113",
4+
"version": "0.1.115",
55
"scripts": {
66
"reset": "npx rimraf ./**/node_modules",
77
"dev": "modern dev",

apps/router-demo/router-host-2000/cypress/e2e/remote6.cy.ts

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,172 @@ describe('router-remote6-2006 in host', () => {
112112
cy.go('forward');
113113
cy.verifyContent('Remote6 about page');
114114
});
115+
116+
it('should increment outer counter without affecting inner counter', () => {
117+
cy.clickMenuItem('Remote6-ReactRouteV7');
118+
119+
// Navigate to detail page first
120+
cy.get('.self-remote6-detail-link').should('exist').click();
121+
cy.verifyContent('Remote6 detail page');
122+
123+
// Verify initial state
124+
cy.verifyContent('Outer Counter: 0');
125+
cy.get('[data-testid="remote6-inner-counter"]').should(
126+
'contain',
127+
'Inner Counter: 0',
128+
);
129+
130+
// Click outer increment button multiple times
131+
cy.get('[data-testid="remote6-outer-increment"]').click();
132+
cy.verifyContent('Outer Counter: 1');
133+
134+
cy.get('[data-testid="remote6-outer-increment"]').click();
135+
cy.verifyContent('Outer Counter: 2');
136+
137+
cy.get('[data-testid="remote6-outer-increment"]').click();
138+
cy.verifyContent('Outer Counter: 3');
139+
140+
// Inner counter should still be 0 (not affected by outer counter changes)
141+
cy.get('[data-testid="remote6-inner-counter"]').should(
142+
'contain',
143+
'Inner Counter: 0',
144+
);
145+
146+
// Increment outer counter again
147+
cy.get('[data-testid="remote6-outer-increment"]').click();
148+
cy.verifyContent('Outer Counter: 4');
149+
150+
// Inner counter should still be 0 (not affected)
151+
cy.get('[data-testid="remote6-inner-counter"]').should(
152+
'contain',
153+
'Inner Counter: 0',
154+
);
155+
});
156+
157+
it('should increment inner counter without affecting outer counter', () => {
158+
cy.clickMenuItem('Remote6-ReactRouteV7');
159+
160+
// Navigate to detail page first
161+
cy.get('.self-remote6-detail-link').should('exist').click();
162+
cy.verifyContent('Remote6 detail page');
163+
164+
// Verify initial state
165+
cy.verifyContent('Outer Counter: 0');
166+
cy.get('[data-testid="remote6-inner-counter"]').should(
167+
'contain',
168+
'Inner Counter: 0',
169+
);
170+
171+
// Click inner increment button
172+
cy.get('[data-testid="remote6-inner-increment"]').click();
173+
cy.get('[data-testid="remote6-inner-counter"]').should(
174+
'contain',
175+
'Inner Counter: 1',
176+
);
177+
178+
// Outer counter should still be 0 (not affected)
179+
cy.verifyContent('Outer Counter: 0');
180+
181+
// Increment inner counter more times
182+
cy.get('[data-testid="remote6-inner-increment"]').click();
183+
cy.get('[data-testid="remote6-inner-increment"]').click();
184+
cy.get('[data-testid="remote6-inner-counter"]').should(
185+
'contain',
186+
'Inner Counter: 3',
187+
);
188+
189+
// Outer counter should still be 0
190+
cy.verifyContent('Outer Counter: 0');
191+
192+
// Now increment outer counter
193+
cy.get('[data-testid="remote6-outer-increment"]').click();
194+
cy.verifyContent('Outer Counter: 1');
195+
196+
// Inner counter should be preserved at 3 (not reset - this proves BridgeWrapper is not recreated)
197+
cy.get('[data-testid="remote6-inner-counter"]').should(
198+
'contain',
199+
'Inner Counter: 3',
200+
);
201+
202+
// Increment outer counter more times
203+
cy.get('[data-testid="remote6-outer-increment"]').click();
204+
cy.get('[data-testid="remote6-outer-increment"]').click();
205+
cy.verifyContent('Outer Counter: 3');
206+
207+
// Inner counter should still be preserved at 3
208+
cy.get('[data-testid="remote6-inner-counter"]').should(
209+
'contain',
210+
'Inner Counter: 3',
211+
);
212+
});
213+
214+
it('should handle alternating clicks between outer and inner counters', () => {
215+
cy.clickMenuItem('Remote6-ReactRouteV7');
216+
217+
// Navigate to detail page first
218+
cy.get('.self-remote6-detail-link').should('exist').click();
219+
cy.verifyContent('Remote6 detail page');
220+
221+
// Verify initial state
222+
cy.verifyContent('Outer Counter: 0');
223+
cy.get('[data-testid="remote6-inner-counter"]').should(
224+
'contain',
225+
'Inner Counter: 0',
226+
);
227+
228+
// Click outer increment
229+
cy.get('[data-testid="remote6-outer-increment"]').click();
230+
cy.verifyContent('Outer Counter: 1');
231+
cy.get('[data-testid="remote6-inner-counter"]').should(
232+
'contain',
233+
'Inner Counter: 0',
234+
);
235+
236+
// Click inner increment
237+
cy.get('[data-testid="remote6-inner-increment"]').click();
238+
cy.verifyContent('Outer Counter: 1');
239+
cy.get('[data-testid="remote6-inner-counter"]').should(
240+
'contain',
241+
'Inner Counter: 1',
242+
);
243+
244+
// Click outer increment again
245+
cy.get('[data-testid="remote6-outer-increment"]').click();
246+
cy.verifyContent('Outer Counter: 2');
247+
cy.get('[data-testid="remote6-inner-counter"]').should(
248+
'contain',
249+
'Inner Counter: 1',
250+
);
251+
252+
// Click inner increment again
253+
cy.get('[data-testid="remote6-inner-increment"]').click();
254+
cy.verifyContent('Outer Counter: 2');
255+
cy.get('[data-testid="remote6-inner-counter"]').should(
256+
'contain',
257+
'Inner Counter: 2',
258+
);
259+
260+
// Click outer increment twice
261+
cy.get('[data-testid="remote6-outer-increment"]').click();
262+
cy.get('[data-testid="remote6-outer-increment"]').click();
263+
cy.verifyContent('Outer Counter: 4');
264+
cy.get('[data-testid="remote6-inner-counter"]').should(
265+
'contain',
266+
'Inner Counter: 2',
267+
);
268+
269+
// Click inner increment three times
270+
cy.get('[data-testid="remote6-inner-increment"]').click();
271+
cy.get('[data-testid="remote6-inner-increment"]').click();
272+
cy.get('[data-testid="remote6-inner-increment"]').click();
273+
cy.verifyContent('Outer Counter: 4');
274+
cy.get('[data-testid="remote6-inner-counter"]').should(
275+
'contain',
276+
'Inner Counter: 5',
277+
);
278+
279+
// Final verification: both counters maintain their independent state
280+
// This proves BridgeWrapper is not recreated and both states are preserved
281+
});
115282
});
116283
});

apps/router-demo/router-host-2000/src/App.tsx

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React, {
33
useEffect,
44
ForwardRefExoticComponent,
55
Suspense,
6+
useState,
67
} from 'react';
78
import { Route, Routes, useLocation } from 'react-router-dom';
89
import {
@@ -284,16 +285,29 @@ const App = () => {
284285
/>
285286
<Route
286287
path="/remote6/*"
287-
Component={() => (
288-
<Remote6App
289-
rootOptions={{
290-
identifierPrefix: 'remote6-instance-',
291-
onRecoverableError: (error: Error) => {
292-
console.error('[Host] Remote6 recoverable error:', error);
293-
},
294-
}}
295-
/>
296-
)}
288+
Component={() => {
289+
const [counter, setCounter] = useState(0);
290+
291+
return (
292+
<>
293+
<button
294+
data-testid="remote6-outer-increment"
295+
onClick={() => setCounter(counter + 1)}
296+
>
297+
Increment
298+
</button>
299+
<Remote6App
300+
outerCounter={counter}
301+
rootOptions={{
302+
identifierPrefix: 'remote6-instance-',
303+
onRecoverableError: (error: Error) => {
304+
console.error('[Host] Remote6 recoverable error:', error);
305+
},
306+
}}
307+
/>
308+
</>
309+
);
310+
}}
297311
/>
298312
</Routes>
299313
</div>

apps/router-demo/router-remote5-2005/CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# remote5
22

3+
## 1.1.22
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [444db72]
8+
- Updated dependencies [a50e068]
9+
- @module-federation/bridge-react@0.21.4
10+
- @module-federation/rsbuild-plugin@0.21.4
11+
12+
## 1.1.21
13+
14+
### Patch Changes
15+
16+
- @module-federation/bridge-react@0.21.3
17+
- @module-federation/rsbuild-plugin@0.21.3
18+
319
## 1.1.20
420

521
### Patch Changes

apps/router-demo/router-remote5-2005/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "remote5",
33
"private": true,
4-
"version": "1.1.20",
4+
"version": "1.1.22",
55
"scripts": {
66
"dev": "rsbuild dev",
77
"build": "rsbuild build",

apps/router-demo/router-remote6-2006/CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Changelog
22

3+
## 1.1.4
4+
5+
### Patch Changes
6+
7+
- 444db72: fix(bridge-react): hoist BridgeWrapper to prevent component recreation
8+
- Updated dependencies [444db72]
9+
- Updated dependencies [a50e068]
10+
- @module-federation/bridge-react@0.21.4
11+
- @module-federation/rsbuild-plugin@0.21.4
12+
13+
## 1.1.3
14+
15+
### Patch Changes
16+
17+
- @module-federation/bridge-react@0.21.3
18+
- @module-federation/rsbuild-plugin@0.21.3
19+
320
## 1.1.2
421

522
### Patch Changes

apps/router-demo/router-remote6-2006/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "remote6",
33
"private": true,
4-
"version": "1.1.2",
4+
"version": "1.1.4",
55
"scripts": {
66
"dev": "rsbuild dev",
77
"build": "rsbuild build",

0 commit comments

Comments
 (0)