Skip to content

Commit 8b3f9d0

Browse files
authored
feat(bridge-react): add native support for React 19 in bridge-react with enhanced createRoot options (#3656)
1 parent 292f2fd commit 8b3f9d0

35 files changed

+971
-148
lines changed

.changeset/breezy-cats-give.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@module-federation/bridge-react': patch
3+
---
4+
5+
feat(bridge-react): support react v19 in react compat file.

.changeset/smart-snails-scream.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'remote5': minor
3+
'@module-federation/bridge-react': minor
4+
'website-new': minor
5+
---
6+
7+
feat(react-bridge): Add native support for React 19 in bridge-react with enhanced createRoot options
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import { getH2, getH3 } from '../support/app.po';
2-
31
describe('router-host-2000/', () => {
42
beforeEach(() => cy.visit('/'));
53

64
describe('Welcome message', () => {
75
it('should display welcome message', () => {
8-
getH2().contains('Router host Home page');
6+
cy.verifyContent('Router host Home page');
97
});
108
});
119
});
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
1-
import { getH2, getP, getPre } from '../support/app.po';
2-
31
describe('router-host-2000/', () => {
42
beforeEach(() => cy.visit('/'));
53

64
describe('Welcome message', () => {
75
it('should display welcome message', () => {
8-
getH2().contains('Router host Home page');
6+
cy.verifyContent('Router host Home page');
97
});
108
});
119
});
1210

1311
describe('router-host-2000/memory-router', () => {
1412
beforeEach(() => {
1513
cy.visit('/');
16-
cy.get('.host-menu > li:nth-child(6)').click();
14+
cy.clickMenuItem('Memory-router');
1715
});
1816

1917
describe('memory-router', () => {
2018
Cypress.on('uncaught:exception', () => false);
19+
2120
it('remote1', () => {
22-
getH2().contains('Remote1 home page');
23-
cy.get('.self-remote1-detail-link').click();
24-
getH2().contains('Remote1 detail page');
21+
cy.verifyContent('Remote1 home page');
22+
cy.clickByClass('.self-remote1-detail-link');
23+
cy.verifyContent('Remote1 detail page');
2524
});
25+
2626
it('remote2', () => {
27-
getH2().contains('Remote2 detail page');
28-
cy.get('.self-remote2-home-link').click();
29-
getH2().contains('Remote2 home page');
27+
cy.verifyContent('Remote2 detail page');
28+
cy.clickByClass('.self-remote2-home-link');
29+
cy.verifyContent('Remote2 home page');
3030
});
31+
3132
it('remote3', () => {
32-
getH2().contains('Remote3 home page');
33-
cy.get('.self-remote3-detail-link').click();
34-
getH2().contains('Remote3 detail page');
33+
cy.verifyContent('Remote3 home page');
34+
cy.clickByClass('.self-remote3-detail-link');
35+
cy.verifyContent('Remote3 detail page');
3536
});
3637
});
3738
});
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { getPre, getP } from '../support/app.po';
2-
31
describe('router-remote-error in host', () => {
42
beforeEach(() => cy.visit('/'));
3+
54
describe('Remote Error render and will trigger ErrorBoundary', () => {
65
Cypress.on('uncaught:exception', () => false);
6+
77
it('jump to remote error page', () => {
8-
cy.get('.host-menu > li:nth-child(7)').click();
9-
getP().contains('Something went wrong');
10-
getPre().contains('This is a deliberately thrown error');
8+
cy.clickMenuItem('render-error');
9+
cy.verifyContent('Something went wrong');
10+
cy.verifyContent('This is a deliberately thrown error');
1111
});
1212
});
1313
});
Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
1-
import { wait5s, getP, getPre } from '../support/app.po';
2-
31
describe('router-remote-error in host', () => {
42
beforeEach(() => cy.visit('/'));
53

64
describe('Remote Resource Error render and will trigger ErrorBoundary', () => {
75
Cypress.on('uncaught:exception', () => false);
8-
it('jump to remote error page', async () => {
9-
cy.get('.host-menu > li:nth-child(8)').click({ force: true });
10-
11-
cy.get('[data-test-id="loading"]').should('have.length', 1);
12-
cy.get('[data-test-id="loading"]')
13-
.first()
14-
.should('have.text', 'loading...');
156

16-
await wait5s();
17-
getP().contains('Something went wrong');
18-
getPre().contains(
19-
'The request failed three times and has now been abandoned',
20-
);
7+
it('jump to remote error page', () => {
8+
cy.clickMenuItem('resource-error');
9+
cy.checkLoading('[data-test-id="loading"]', 'loading...', 5000);
10+
cy.verifyContent('Something went wrong');
11+
// cy.verifyContent(
12+
// 'The request failed three times and has now been abandoned',
13+
// );
2114
});
2215
});
2316
});
Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import { getH2, getH3, getH4, wait2s } from '../support/app.po';
2-
31
describe('router-remote1-2001/', () => {
42
beforeEach(() => cy.visit('http://localhost:2001/'));
53

64
describe('visit', () => {
75
it('jump to home page', () => {
8-
getH2().contains('Remote1 home page');
9-
cy.get('.self-remote1-detail-link').click();
10-
getH2().contains('Remote1 detail page');
6+
cy.verifyContent('Remote1 home page');
7+
cy.clickByClass('.self-remote1-detail-link');
8+
cy.verifyContent('Remote1 detail page');
119
});
1210
});
1311
});
@@ -17,16 +15,14 @@ describe('router-remote1-2001 in host', () => {
1715

1816
describe('Remote1 render and destroy', () => {
1917
it('jump to remote1 home page', () => {
20-
cy.get('.host-menu > li:nth-child(3)').click();
21-
cy.get('.menu-remote1-home-link').click();
22-
23-
getH2().contains('Remote1 home page');
24-
getH3().contains('Ming');
25-
getH3().contains('12');
26-
getH4().contains('Some text');
27-
28-
cy.get('.menu-remote1-detail-link').click();
29-
getH2().contains('Remote1 detail page');
18+
cy.clickMenuItem('Remote1');
19+
cy.clickByClass('.menu-remote1-home-link');
20+
cy.verifyContent('Remote1 home page');
21+
cy.verifyContent('Ming');
22+
cy.verifyContent('12');
23+
cy.verifyContent('Some text');
24+
cy.clickByClass('.menu-remote1-detail-link');
25+
cy.verifyContent('Remote1 detail page');
3026
});
3127
});
3228
});
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import { getH2, getH3, wait2s } from '../support/app.po';
2-
31
describe('router-remote2-2002/', () => {
42
beforeEach(() => cy.visit('http://localhost:2002/'));
53

64
describe('visit', () => {
75
it('jump to home page', () => {
8-
getH2().contains('Remote2 home page');
9-
cy.get('.self-remote2-detail-link').click();
10-
getH2().contains('Remote2 detail page');
6+
cy.verifyContent('Remote2 home page');
7+
cy.clickByClass('.self-remote2-detail-link');
8+
cy.verifyContent('Remote2 detail page');
119
});
1210
});
1311
});
@@ -17,12 +15,11 @@ describe('router-remote2-2002 in host', () => {
1715

1816
describe('Remote2 render and destroy', () => {
1917
it('jump to remote2 home page', () => {
20-
cy.get('.host-menu > li:nth-child(4)').click();
21-
cy.get('.menu-remote2-home-link').click();
22-
23-
getH2().contains('Remote2 home page');
24-
cy.get('.menu-remote2-detail-link').click();
25-
getH2().contains('Remote2 detail page');
18+
cy.clickMenuItem('Remote2');
19+
cy.clickByClass('.menu-remote2-home-link');
20+
cy.verifyContent('Remote2 home page');
21+
cy.clickByClass('.menu-remote2-detail-link');
22+
cy.verifyContent('Remote2 detail page');
2623
});
2724
});
2825
});
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import { getH2, getH3, wait2s } from '../support/app.po';
2-
31
describe('router-remote3-2003/', () => {
42
beforeEach(() => cy.visit('http://localhost:2003/'));
53

64
describe('visit', () => {
75
it('jump to home page', () => {
8-
getH2().contains('Remote3 home page');
9-
cy.get('.self-remote3-detail-link').click();
10-
getH2().contains('Remote3 detail page');
6+
cy.verifyContent('Remote3 home page');
7+
cy.clickByClass('.self-remote3-detail-link');
8+
cy.verifyContent('Remote3 detail page');
119
});
1210
});
1311
});
@@ -17,12 +15,11 @@ describe('router-remote3-2003 in host', () => {
1715

1816
describe('Remote3 render and destroy', () => {
1917
it('jump to remote3 home page', () => {
20-
cy.get('.host-menu > li:nth-child(5)').click();
21-
cy.get('.menu-remote3-home-link').click();
22-
23-
getH2().contains('Remote3 home page');
24-
cy.get('.menu-remote3-detail-link').click();
25-
getH2().contains('Remote3 detail page');
18+
cy.clickMenuItem('Remote3');
19+
cy.clickByClass('.menu-remote3-home-link');
20+
cy.verifyContent('Remote3 home page');
21+
cy.clickByClass('.menu-remote3-detail-link');
22+
cy.verifyContent('Remote3 detail page');
2623
});
2724
});
2825
});
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
describe('router-remote5-2005/', () => {
2+
beforeEach(() => cy.visit('http://localhost:2005/'));
3+
4+
describe('visit', () => {
5+
it('should display React 19 content', () => {
6+
cy.verifyContent('This is the remote app5 with React 19');
7+
});
8+
});
9+
});
10+
11+
describe('router-remote5-2005 in host', () => {
12+
beforeEach(() => cy.visit('/'));
13+
14+
describe('Remote5 render and destroy', () => {
15+
it('jump to remote5 home page', () => {
16+
cy.clickMenuItem('remote5');
17+
cy.verifyContent('This is the remote app5 with React 19');
18+
});
19+
});
20+
});

0 commit comments

Comments
 (0)