Skip to content

Commit e874c64

Browse files
authored
feat(react): add cache api (#3847)
1 parent e0ceca6 commit e874c64

File tree

118 files changed

+4509
-2075
lines changed

Some content is hidden

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

118 files changed

+4509
-2075
lines changed

.changeset/breezy-lemons-grin.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): export createLazyCompoent api

.changeset/curly-insects-wonder.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@module-federation/modern-js': patch
3+
---
4+
5+
refactor(modern-js-plugin): add subpath react to export createLazyCompoent and wrapNoSSR apis

.changeset/curly-pillows-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-vue3': minor
3+
---
4+
5+
refactor(vue3-bridge): rename createRemoteComponent as createRemoteAppComponent

.changeset/hip-hornets-exercise.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': minor
3+
---
4+
5+
refactor(bridge-react): rename createRemoteComponent as createRemoteAppComponent

.changeset/tender-rocks-leave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@module-federation/modern-js': minor
3+
---
4+
5+
refactor(modern-js-plugin): deprecate createRemoteComponent and createRemoteSSRComponent

.github/workflows/build-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
run: nproc
5757

5858
- name: Warm Nx Cache
59-
run: npx nx run-many --targets=build --projects=tag:type:pkg --parallel=4
59+
run: npx nx run-many --targets=build --projects=tag:type:pkg --parallel=4 --skip-nx-cache
6060

6161
- name: Run Build for All
6262
run: npx nx run-many --targets=build --projects=tag:type:pkg --parallel=4 --skip-nx-cache

.github/workflows/devtools.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
run: pnpm install
3939

4040
- name: Run Affected Build
41-
run: npx nx run-many --targets=build --projects=tag:type:pkg
41+
run: npx nx run-many --targets=build --projects=tag:type:pkg --skip-nx-cache
4242

4343
- name: Configuration xvfb
4444
shell: bash

apps/modern-component-data-fetch/host/src/routes/basic/page.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { kit, ERROR_TYPE } from '@module-federation/modern-js/runtime';
1+
import { getInstance } from '@module-federation/modern-js/runtime';
2+
import { ERROR_TYPE } from '@module-federation/modern-js/react';
23

3-
const { createRemoteComponent } = kit;
4-
5-
const Basic = createRemoteComponent({
4+
const Basic = getInstance()!.createLazyComponent({
65
loader: () => {
76
return import('remote/BasicComponent');
87
},

apps/modern-component-data-fetch/host/src/routes/client-downgrade/page.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { kit } from '@module-federation/modern-js/runtime';
1+
import { getInstance } from '@module-federation/modern-js/runtime';
22

3-
const { createRemoteComponent } = kit;
4-
5-
const ClientDowngrade = createRemoteComponent({
3+
const ClientDowngrade = getInstance()!.createLazyComponent({
64
loader: () => {
75
return import('remote/ClientDowngrade');
86
},

apps/modern-component-data-fetch/host/src/routes/csr/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { kit } from '@module-federation/modern-js/runtime';
1+
import { getInstance } from '@module-federation/modern-js/runtime';
22

3-
const { createRemoteComponent, wrapNoSSR } = kit;
4-
5-
const CsrWithFetchDataFromServerComponent = wrapNoSSR(createRemoteComponent)({
3+
const CsrWithFetchDataFromServerComponent = getInstance()!.createLazyComponent({
4+
noSSR: true,
65
loader: () => {
6+
console.log('calling');
77
return import('provider-csr');
88
},
99
loading: 'loading...',

0 commit comments

Comments
 (0)