File tree Expand file tree Collapse file tree 4 files changed +39
-26
lines changed
Expand file tree Collapse file tree 4 files changed +39
-26
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,12 @@ export default defineConfig({
2727 remotes : {
2828 lynx_remote : 'lynx_remote@http://localhost:3001/mf-manifest.json' ,
2929 } ,
30- // Disable d.ts live tooling and dynamic type-hints to avoid ws usage on Lynx main thread.
30+ // shared: {
31+ // '@lynx-js/react': {
32+ // singleton: true,
33+ // eager: false,
34+ // },
35+ // },
3136 dts : false ,
3237 dev : {
3338 disableDynamicRemoteTypeHints : true ,
Original file line number Diff line number Diff line change 22 * Module Federation demo - testing host configuration first
33 */
44import { useState } from '@lynx-js/react' ;
5+ import {
6+ createInstance ,
7+ loadRemote ,
8+ } from '@module-federation/enhanced/runtime' ;
9+ import RspeedyCorePlugin from '@module-federation/rspeedy-core-plugin' ;
510
611export function SimpleMFDemo ( ) {
712 const [ status ] = useState ( 'Host App Ready' ) ;
8-
13+ // Initialize Module Federation with the rspeedy runtime plugin
14+ createInstance ( {
15+ name : 'lynx_host' ,
16+ remotes : [
17+ // Add your remote applications here
18+ {
19+ name : 'remote-app' ,
20+ entry : 'http://localhost:3001/mf-manifest.json' ,
21+ } ,
22+ ] ,
23+ plugins : [
24+ // Use the rspeedy core plugin to bridge with Lynx's native script loading
25+ RspeedyCorePlugin ( ) ,
26+ ] ,
27+ } ) ;
28+ const component = loadRemote ( 'remote-app/SimpleMFDemo' ) ;
929 return (
1030 < view style = { { padding : '20px' } } >
1131 < text style = { { fontSize : '18px' , fontWeight : 'bold' , color : '#00b894' } } >
Original file line number Diff line number Diff line change @@ -4,24 +4,6 @@ import { root } from '@lynx-js/react';
44/**
55 * Module Federation setup for Lynx/rspeedy
66 */
7- import { createInstance } from '@module-federation/enhanced/runtime' ;
8- import RspeedyCorePlugin from '@module-federation/rspeedy-core-plugin' ;
9-
10- // Initialize Module Federation with the rspeedy runtime plugin
11- createInstance ( {
12- name : 'lynx_host' ,
13- remotes : [
14- // Add your remote applications here
15- // {
16- // name: 'remote-app',
17- // entry: 'http://localhost:3001/mf-manifest.json',
18- // },
19- ] ,
20- plugins : [
21- // Use the rspeedy core plugin to bridge with Lynx's native script loading
22- RspeedyCorePlugin ( ) ,
23- ] ,
24- } ) ;
257
268import { App } from './App.jsx' ;
279
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { pluginModuleFederationRspeedy } from '@module-federation/rspeedy-plugin
88export default defineConfig ( {
99 server : {
1010 port : 3001 ,
11+ host : '10.210.20.64' ,
1112 } ,
1213 dev : {
1314 hmr : false ,
@@ -26,13 +27,18 @@ export default defineConfig({
2627 exposes : {
2728 './SimpleMFDemo' : './src/components/SimpleMFDemoCompiled.tsx' ,
2829 } ,
29- shared : {
30- '@lynx-js/react' : {
31- singleton : true ,
32- eager : false ,
33- } ,
34- } ,
30+ // shared: {
31+ // '@lynx-js/react': {
32+ // singleton: true,
33+ // eager: false,
34+ // },
35+ // },
3536 dts : false ,
37+ dev : {
38+ disableDynamicRemoteTypeHints : true ,
39+ disableLiveReload : true ,
40+ disableHotTypesReload : true ,
41+ } ,
3642 } ) ,
3743 pluginTypeCheck ( ) ,
3844 ] ,
You can’t perform that action at this time.
0 commit comments