Skip to content

Commit 18c2874

Browse files
committed
docs(nf): mention demo repo
1 parent 6e9e33a commit 18c2874

File tree

10 files changed

+32
-18
lines changed

10 files changed

+32
-18
lines changed

libs/mf/src/utils/share-utils.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ function _findSecondaries(
101101

102102
const dirs = files
103103
.map((f) => path.join(libPath, f))
104-
.filter((f) => fs.lstatSync(f).isDirectory() && !f.endsWith('node_modules'));
104+
.filter(
105+
(f) => fs.lstatSync(f).isDirectory() && !f.endsWith('node_modules')
106+
);
105107

106108
const secondaries = dirs.filter((d) =>
107109
fs.existsSync(path.join(d, 'package.json'))
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "@softarc/native-federation",
3-
"version": "2.0.16",
3+
"version": "2.0.17",
44
"type": "commonjs",
55
"license": "MIT",
66
"dependencies": {
77
"json5": "^2.2.0",
88
"npmlog": "^6.0.2",
9-
"@softarc/native-federation-runtime": "2.0.16"
9+
"@softarc/native-federation-runtime": "2.0.17"
1010
}
1111
}

libs/native-federation-core/src/lib/config/share-utils.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ function _findSecondaries(
112112

113113
const secondaries = files
114114
.map((f) => path.join(libPath, f))
115-
.filter((f) => fs.lstatSync(f).isDirectory() && !f.endsWith('node_modules'));
115+
.filter(
116+
(f) => fs.lstatSync(f).isDirectory() && !f.endsWith('node_modules')
117+
);
116118

117119
for (const s of secondaries) {
118120
if (fs.existsSync(path.join(s, 'package.json'))) {

libs/native-federation-esbuild/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@softarc/native-federation-esbuild",
3-
"version": "2.0.16",
3+
"version": "2.0.17",
44
"type": "commonjs",
55
"dependencies": {
66
"@rollup/plugin-commonjs": "^22.0.2",
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"name": "@softarc/native-federation-node",
3-
"version": "2.0.16"
3+
"version": "2.0.17"
44
}

libs/native-federation-runtime/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@softarc/native-federation-runtime",
3-
"version": "2.0.16",
3+
"version": "2.0.17",
44
"dependencies": {
55
"tslib": "^2.3.0"
66
},

libs/native-federation/README.md

+16-6
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ We will at least provide a new version of this package per Angular major. If nec
3434
- Use version 18.2.x for Angular 18.2.x
3535
- Use version 19.x for Angular 19.x
3636

37+
## Demo Repo
38+
39+
In this [demo repo](https://github.com/manfredsteyer/nf-test.git), we test Native Federation together with several known UI libraries for Angular. For this, we compile demo apps build with them with Native Federation.
40+
41+
<a href="https://github.com/manfredsteyer/nf-test.git" target="_blank">
42+
<img width="500" src="https://github.com/angular-architects/module-federation-plugin/blob/main/libs/native-federation/demo-repo.png">
43+
</a>
44+
45+
This is primarily for testing purposes. For an **initial example and/or an tutorial please look below.**
46+
3747
## Migration from Module Federation
3848

3949
If you currently use Angular with Module Federation, you can follow our [Migration Guide](https://github.com/angular-architects/module-federation-plugin/blob/main/libs/native-federation/docs/migrate.md) to migrate to Native Federation and Angular's new fast esbuild-based build system.
@@ -350,18 +360,18 @@ The good message is, that the official Angular Package Format defines the usage
350360

351361
### How to Deal with Transitive Dependencies?
352362

353-
Since version >=18.2.7, transitive dependencies can also be shared. For instance, `primeng` uses a lib `@primeuix/styled` for theming. The latter one is now shared too if `primeng` is. This prevents possible challenges but also results in more bundles.
363+
Since version >=18.2.7, transitive dependencies can also be shared. For instance, `primeng` uses a lib `@primeuix/styled` for theming. The latter one is now shared too if `primeng` is. This prevents possible challenges but also results in more bundles.
354364

355365
To activate sharing transient dependencies, set the new `transient` flag provided by `share` and `shareAll` to `true`:
356366

357367
```js
358368
module.exports = withNativeFederation({
359369
shared: {
360-
...shareAll({
361-
singleton: true,
362-
strictVersion: true,
363-
requiredVersion: 'auto',
364-
transient: true
370+
...shareAll({
371+
singleton: true,
372+
strictVersion: true,
373+
requiredVersion: 'auto',
374+
transient: true
365375
}),
366376
},
367377
[...]

libs/native-federation/demo-repo.png

223 KB
Loading

libs/native-federation/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular-architects/native-federation",
3-
"version": "19.0.3",
3+
"version": "19.0.4",
44
"main": "src/index.js",
55
"generators": "./collection.json",
66
"builders": "./builders.json",
@@ -20,8 +20,8 @@
2020
},
2121
"dependencies": {
2222
"@babel/core": "^7.19.0",
23-
"@softarc/native-federation": "2.0.16",
24-
"@softarc/native-federation-runtime": "2.0.16",
23+
"@softarc/native-federation": "2.0.17",
24+
"@softarc/native-federation-runtime": "2.0.17",
2525
"@types/browser-sync": "^2.29.0",
2626
"@chialab/esbuild-plugin-commonjs": "^0.18.0",
2727
"browser-sync": "^3.0.2",

libs/native-federation/src/utils/angular-esbuild-adapter.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function createAngularBuildAdapter(
6969
watch,
7070
dev,
7171
hash,
72-
platform
72+
platform,
7373
} = options;
7474

7575
const files = await runEsbuild(
@@ -281,7 +281,7 @@ async function runEsbuild(
281281
format: 'esm',
282282
target: ['esnext'],
283283
logLimit: kind === 'shared-package' ? 1 : 0,
284-
plugins: plugins as any || [
284+
plugins: (plugins as any) || [
285285
createCompilerPlugin(
286286
pluginOptions.pluginOptions,
287287
pluginOptions.styleOptions

0 commit comments

Comments
 (0)