Skip to content

Commit 71fc1b4

Browse files
committed
chore: more tests
1 parent b86f928 commit 71fc1b4

File tree

4 files changed

+39
-26
lines changed

4 files changed

+39
-26
lines changed

apps/lynx-host/lynx.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff 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,

apps/lynx-host/src/components/SimpleMFDemo.tsx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,30 @@
22
* Module Federation demo - testing host configuration first
33
*/
44
import { 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

611
export 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' }}>

apps/lynx-host/src/index.tsx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff 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

268
import { App } from './App.jsx';
279

apps/lynx-remote/lynx.config.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { pluginModuleFederationRspeedy } from '@module-federation/rspeedy-plugin
88
export 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
],

0 commit comments

Comments
 (0)