Skip to content

Commit b2bfa48

Browse files
chore: format all files (#2982)
1 parent 0bae844 commit b2bfa48

File tree

19 files changed

+74
-85
lines changed

19 files changed

+74
-85
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ You can consider the module federation capabilities provided by this repository
2828

2929
## ✨ What new features does Module Federation provide?
3030

31-
* 🎨 Module Federation Runtime
32-
* 🧩 Runtime Plugins System
33-
* 📝 Manifest
34-
* 🚀 Dynamic type prompt
35-
* 🛠️ Chrome Devtool
31+
- 🎨 Module Federation Runtime
32+
- 🧩 Runtime Plugins System
33+
- 📝 Manifest
34+
- 🚀 Dynamic type prompt
35+
- 🛠️ Chrome Devtool
3636

3737
## 📚 Getting Started
3838

apps/manifest-demo/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
This example demos manifest
44

5-
- `manifest-webpack-host` consumes remote and generate manifest.
6-
- `3009-webpack-provider` exposes a blue button component and generate manifest.
7-
- `3010-rspack-provider` exposes a red button component and generate manifest.
5+
- `manifest-webpack-host` consumes remote and generate manifest.
6+
- `3009-webpack-provider` exposes a blue button component and generate manifest.
7+
- `3010-rspack-provider` exposes a red button component and generate manifest.
88
- `3011-rspack-manifest-provider`: expose component and generate manifest.
99
- `3012-rspack-js-entry-provider`: expose component and not generate manifest.
1010

apps/modernjs-ssr/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414

1515
```bash
1616
# Root directory
17-
pnpm i
17+
pnpm i
1818

19-
nx build modern-js-plugin
19+
nx build modern-js-plugin
2020

21-
pnpm run app:modern:dev
21+
pnpm run app:modern:dev
2222

2323
open http://localhost:3050/
2424
```

apps/router-demo/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ open http://localhost:2100/
1313

1414
> Scenario description
1515
16-
* This demo mainly demonstrates how to use the mf bridge library to load a module with routing
17-
* How to load modules between vue and react projects
16+
- This demo mainly demonstrates how to use the mf bridge library to load a module with routing
17+
- How to load modules between vue and react projects
1818

1919
## Test run
2020

21-
* nx e2e router-host-2000 --watch
21+
- nx e2e router-host-2000 --watch

apps/router-demo/router-host-2000/src/pages/Remote1.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,16 @@ type RemoteKeys = RemoteKeys_0 | RemoteKeys_1;
9494
type PackageType<T, R = any> = T extends RemoteKeys_0
9595
? PackageType_0<T>
9696
: T extends RemoteKeys_1
97-
? PackageType_1<T>
98-
: R;
97+
? PackageType_1<T>
98+
: R;
9999
type GetType<T, Y extends keyof T> = T[Y];
100100
type GetProvderComponentType<
101101
T extends RemoteKeys,
102102
Y extends keyof PackageType<T>,
103-
> = GetType<PackageType<T>, Y> extends (...args: Array<any>) => any
104-
? ReturnType<GetType<PackageType<T>, Y>>
105-
: any;
103+
> =
104+
GetType<PackageType<T>, Y> extends (...args: Array<any>) => any
105+
? ReturnType<GetType<PackageType<T>, Y>>
106+
: any;
106107

107108
type GetObjectVal<
108109
T extends Record<string, any>,

apps/router-demo/router-host-v5-2200/src/pages/Remote1.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,16 @@ type RemoteKeys = RemoteKeys_0 | RemoteKeys_1;
9494
type PackageType<T, R = any> = T extends RemoteKeys_0
9595
? PackageType_0<T>
9696
: T extends RemoteKeys_1
97-
? PackageType_1<T>
98-
: R;
97+
? PackageType_1<T>
98+
: R;
9999
type GetType<T, Y extends keyof T> = T[Y];
100100
type GetProvderComponentType<
101101
T extends RemoteKeys,
102102
Y extends keyof PackageType<T>,
103-
> = GetType<PackageType<T>, Y> extends (...args: Array<any>) => any
104-
? ReturnType<GetType<PackageType<T>, Y>>
105-
: any;
103+
> =
104+
GetType<PackageType<T>, Y> extends (...args: Array<any>) => any
105+
? ReturnType<GetType<PackageType<T>, Y>>
106+
: any;
106107

107108
type GetObjectVal<
108109
T extends Record<string, any>,

packages/bridge/bridge-react-webpack-plugin/README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ React bridge is used to load the routing module in mf, so that the routing modul
44

55
> When to use
66
7-
* Load the route module
8-
* Load across the front end framework
9-
7+
- Load the route module
8+
- Load across the front end framework
109

1110
## How to use
1211

@@ -130,5 +129,3 @@ root.render(
130129
<App />
131130
);
132131
```
133-
134-

packages/bridge/bridge-react/README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ React bridge is used to load the routing module in mf, so that the routing modul
44

55
> When to use
66
7-
* Load the route module
8-
* Load across the front end framework
9-
7+
- Load the route module
8+
- Load across the front end framework
109

1110
## How to use
1211

@@ -130,5 +129,3 @@ root.render(
130129
<App />
131130
);
132131
```
133-
134-

packages/bridge/bridge-shared/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
55
```js
66
// browser
7-
localStorage.setItem('debug','true');
8-
localStorage.setItem('debug:stack','true');
7+
localStorage.setItem('debug', 'true');
8+
localStorage.setItem('debug:stack', 'true');
99

1010
// node
1111
process.env.DEBUG = 'true';
12-
```
12+
```

packages/chrome-devtools/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Module Federation Chrome Devtools
22

33
## Ability
4-
* Proxy online Module Federation remote module to local
5-
* Let proxied remote module get hmr
4+
5+
- Proxy online Module Federation remote module to local
6+
- Let proxied remote module get hmr
67

78
https://module-federation.io/

packages/esbuild/.swcrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
".*\\.spec.tsx?$",
2424
".*\\.test.tsx?$",
2525
"./src/jest-setup.ts$",
26-
"./**/jest-setup.ts$",
27-
// ".*.js$"
26+
"./**/jest-setup.ts$"
27+
// ".*.js$"
2828
]
2929
}

packages/esbuild/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ module.exports = withFederation({
7777
}),
7878
},
7979
});
80-
8180
```
8281

8382
The `moduleFederationPlugin` accepts a configuration object with the following properties:
@@ -110,7 +109,5 @@ Creates an esbuild plugin for Module Federation.
110109
- `remotes` (object, optional): An object specifying the remote applications and their entry points.
111110
- `exposes` (object, optional): An object specifying the modules to be exposed by the host application.
112111
- `shared` (array, optional): An array of package names to be shared between the host and remote applications.
113-
114-
Returns an esbuild plugin instance.
115-
116112

113+
Returns an esbuild plugin instance.

packages/esbuild/src/adapters/lib/commonjs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ export function commonjs({
132132
typeof ignore === 'function'
133133
? ignore
134134
: Array.isArray(ignore)
135-
? (path: string) => ignore.includes(path)
136-
: () => false;
135+
? (path: string) => ignore.includes(path)
136+
: () => false;
137137

138138
return {
139139
name: 'commonjs',

packages/manifest/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@ containerManager.init(options);
2222
options.exposes = containerManager.containerPluginExposesOptions;
2323
```
2424

25-
2. use StatsPlugin in webpack.config.js
25+
2. use StatsPlugin in webpack.config.js
2626

2727
```js
2828
import { StatsPlugin } from '@module-federation/manifest';
2929

3030
new StatsPlugin(mfOptions, {
31-
pluginVersion: pkg.version,
32-
bundler: 'webpack',
33-
}).apply(compiler);
34-
31+
pluginVersion: pkg.version,
32+
bundler: 'webpack',
33+
}).apply(compiler);
3534
```

packages/native-federation-tests/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ const config: UserConfig = {
215215
NativeFederationTestsHost({
216216
/* options */
217217
}),
218-
]
219-
}
218+
],
219+
};
220220
```
221221

222222
<br>

packages/native-federation-typescript/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ const config: UserConfig = {
211211
NativeFederationTypeScriptHost({
212212
/* options */
213213
}),
214-
]
215-
}
214+
],
215+
};
216216
```
217217

218218
<br>

packages/nextjs-mf/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -277,26 +277,26 @@ new NextFederationPlugin({
277277

278278
Ive added a util for dynamic chunk loading, in the event you need to load remote containers dynamically.
279279

280-
281280
```js
282281
import { loadRemote, init } from '@module-federation/runtime';
283282
// if i have remotes in my federation plugin, i can pass the name of the remote
284-
loadRemote('home/exposedModule')
283+
loadRemote('home/exposedModule');
285284
// if i want to load a custom remote not known at build time.
286285
init({
287286
name: 'hostname',
288287
remotes: [
289288
{
290289
name: 'home',
291-
entry: 'http://somthing.com/remoteEntry.js'
292-
}
290+
entry: 'http://somthing.com/remoteEntry.js',
291+
},
293292
],
294-
force: true // may be needed to sideload remotes after the fact.
295-
})
296-
loadRemote('home/exposedModule')
293+
force: true, // may be needed to sideload remotes after the fact.
294+
});
295+
loadRemote('home/exposedModule');
297296
```
298297

299298
**revalidate**
299+
300300
### Hot Reloading with `revalidate` in Production Environments
301301

302302
In production environments, ensuring that your server can dynamically reload and update without requiring a full restart is crucial for maintaining uptime and providing the latest features to your users without disruption. The `revalidate` utility from `@module-federation/nextjs-mf/utils` facilitates this by enabling hot reloading of the node server (not the client). This section outlines two implementations for integrating `revalidate` into your Next.js application to leverage hot reloading capabilities.

packages/node/README.md

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,50 +35,48 @@ yarn add @module-federation/node
3535
## 🚀 Usage
3636

3737
There are two approaches to using the plugins exported from this package, dependent on your use case.
38+
3839
### Use as Runtime Plugin
3940

40-
`module-federation/enhanced` supports runtime plugins.
41+
`module-federation/enhanced` supports runtime plugins.
4142

4243
```js
4344
const { ModuleFederationPlugin } = require('@module-federation/enhanced');
4445

4546
const options = {
4647
target: 'async-node',
4748
output: {
48-
chunkFilename: '[id]-[chunkhash].js' // important to hash chunks
49+
chunkFilename: '[id]-[chunkhash].js', // important to hash chunks
4950
},
5051
plugins: [
5152
new ModuleFederationPlugin({
5253
name: 'app1',
5354
exposes: {},
5455
remotes: {
55-
app2: 'app2@http://'
56+
app2: 'app2@http://',
5657
},
57-
runtimePlugins: [
58-
require.resolve('@module-federation/node/runtimePlugin')
59-
],
58+
runtimePlugins: [require.resolve('@module-federation/node/runtimePlugin')],
6059
remoteType: 'script',
61-
library: { type: 'commonjs-module', name: 'app1' }
62-
})
63-
]
60+
library: { type: 'commonjs-module', name: 'app1' },
61+
}),
62+
],
6463
};
65-
6664
```
6765

6866
or you can enable it with some presets via UniversalFederation
6967

7068
```js
7169
new UniversalFederationPlugin({
72-
name: 'website2',
73-
library: { type: 'commonjs-module' },
74-
isServer: true, // or false
75-
remotes: {},
76-
filename: 'remoteEntry.js',
77-
useRuntimePlugin: true, // uses the module-federation/enhanced runtime plugin api
78-
exposes: {
79-
'./SharedComponent': './remoteServer/SharedComponent',
80-
},
81-
})
70+
name: 'website2',
71+
library: { type: 'commonjs-module' },
72+
isServer: true, // or false
73+
remotes: {},
74+
filename: 'remoteEntry.js',
75+
useRuntimePlugin: true, // uses the module-federation/enhanced runtime plugin api
76+
exposes: {
77+
'./SharedComponent': './remoteServer/SharedComponent',
78+
},
79+
});
8280
```
8381

8482
### UniversalFederationPlugin

packages/retry-plugin/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ export default defineConfig({
4343

4444
```
4545

46-
47-
4846
## Documentation
4947

5048
See [https://module-federation.io/plugin/plugins/retry-plugin.html](https://module-federation.io/plugin/plugins/retry-plugin.html) for details.

0 commit comments

Comments
 (0)