Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2a9fc49
Fix path join for downloading remote types in FederatedTypesPlugin.ts
philip-lempke Oct 27, 2025
4f5ea10
Merge branch 'main' into patch-1
ScriptedAlchemy Oct 29, 2025
94ecab3
fix: add trailing comma to URL constructor
ScriptedAlchemy Oct 29, 2025
fa65f29
feat(bridge-react): add rerender option to createBridgeComponent
ScriptedAlchemy Oct 30, 2025
ddcf793
fix(bridge-react): properly implement shouldRecreate functionality
ScriptedAlchemy Oct 30, 2025
d5b4061
fix(bridge-react): properly implement shouldRecreate functionality
ScriptedAlchemy Oct 30, 2025
537182e
revert: restore FederatedTypesPlugin.ts to main version
ScriptedAlchemy Oct 30, 2025
88557b5
chore(bridge-react): changeset patch bump for rerender option (#4171)
ScriptedAlchemy Oct 30, 2025
e730e0d
Merge remote-tracking branch 'origin/main' into patch-1
ScriptedAlchemy Oct 30, 2025
a29162b
test(bridge-react): avoid direct jsdom import; fallback to global window
ScriptedAlchemy Nov 7, 2025
f053a00
fix(bridge-react): preserve component state on rerender
ScriptedAlchemy Nov 7, 2025
1a824ff
test(bridge-react): assert lifecycle destroy emits on recreation and …
ScriptedAlchemy Nov 7, 2025
996261f
test(bridge-react): assert state stability + extraProps injection
ScriptedAlchemy Nov 7, 2025
ba6ae5c
Merge branch 'main' into patch-1
ScriptedAlchemy Nov 7, 2025
29d94a9
fix(bridge-react): fallback to custom render on updates when returned…
ScriptedAlchemy Nov 7, 2025
2a4045b
test(bridge-react): stabilize fallback custom-render test
ScriptedAlchemy Nov 7, 2025
d48a8c1
test(bridge-react): reset mocked federationRuntime between tests to a…
ScriptedAlchemy Nov 7, 2025
22591c1
chore(bridge-react): format rerender-issue.spec.tsx
ScriptedAlchemy Nov 7, 2025
c86b975
test(bridge-react): add hydration and key-based remount coverage; ass…
ScriptedAlchemy Nov 7, 2025
18ea1a6
refactor(bridge-react): reduce usage; add type guards and precise ty…
ScriptedAlchemy Nov 7, 2025
7ec9ec5
style: fix formatting issues
ScriptedAlchemy Nov 7, 2025
3716f5e
fix: adjust bridge legacy react handling
ScriptedAlchemy Nov 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .changeset/rerender-functionality.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
"@module-federation/bridge-react": patch
---

feat(bridge-react): add rerender option to createBridgeComponent

- Add rerender option to ProviderFnParams interface for custom rerender handling
- Update bridge-base implementation to support custom rerender logic with proper shouldRecreate functionality
- Add component state tracking to detect rerenders vs initial renders
- Properly unmount and recreate roots when shouldRecreate is true
- Preserve component state when shouldRecreate is false
- Maintain backward compatibility for existing code
- Add comprehensive test suite for rerender functionality

This addresses issue #4171 where remote apps were being recreated on every host rerender, causing loss of internal state.
3 changes: 2 additions & 1 deletion packages/bridge/bridge-react/__tests__/prefetch.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { prefetch } from '../src/lazy/data-fetch/prefetch';
import type { DataFetchParams } from '../src';
import * as utils from '../src/lazy/utils';
import logger from '../src/lazy/logger';
import helpers from '@module-federation/runtime/helpers';
Expand Down Expand Up @@ -113,7 +114,7 @@ describe('prefetch', () => {
await prefetch({
id: 'remote1/component1',
instance: mockInstance,
dataFetchParams: { some: 'param', isDowngrade: false } as any,
dataFetchParams: { some: 'param', isDowngrade: false } as DataFetchParams,
preloadComponentResource: true,
});

Expand Down
Loading
Loading