diff --git a/libs/mf/src/utils/share-utils.ts b/libs/mf/src/utils/share-utils.ts index b08fd73..039310d 100644 --- a/libs/mf/src/utils/share-utils.ts +++ b/libs/mf/src/utils/share-utils.ts @@ -101,7 +101,9 @@ function _findSecondaries( const dirs = files .map((f) => path.join(libPath, f)) - .filter((f) => fs.lstatSync(f).isDirectory() && !f.endsWith('node_modules')); + .filter( + (f) => fs.lstatSync(f).isDirectory() && !f.endsWith('node_modules') + ); const secondaries = dirs.filter((d) => fs.existsSync(path.join(d, 'package.json')) diff --git a/libs/native-federation-core/package.json b/libs/native-federation-core/package.json index 35a7cff..48dbeea 100644 --- a/libs/native-federation-core/package.json +++ b/libs/native-federation-core/package.json @@ -1,11 +1,11 @@ { "name": "@softarc/native-federation", - "version": "2.0.16", + "version": "2.0.17", "type": "commonjs", "license": "MIT", "dependencies": { "json5": "^2.2.0", "npmlog": "^6.0.2", - "@softarc/native-federation-runtime": "2.0.16" + "@softarc/native-federation-runtime": "2.0.17" } } diff --git a/libs/native-federation-core/src/lib/config/share-utils.ts b/libs/native-federation-core/src/lib/config/share-utils.ts index fe180fc..03e56a2 100644 --- a/libs/native-federation-core/src/lib/config/share-utils.ts +++ b/libs/native-federation-core/src/lib/config/share-utils.ts @@ -112,7 +112,9 @@ function _findSecondaries( const secondaries = files .map((f) => path.join(libPath, f)) - .filter((f) => fs.lstatSync(f).isDirectory() && !f.endsWith('node_modules')); + .filter( + (f) => fs.lstatSync(f).isDirectory() && !f.endsWith('node_modules') + ); for (const s of secondaries) { if (fs.existsSync(path.join(s, 'package.json'))) { diff --git a/libs/native-federation-esbuild/package.json b/libs/native-federation-esbuild/package.json index 75e7963..764ba89 100644 --- a/libs/native-federation-esbuild/package.json +++ b/libs/native-federation-esbuild/package.json @@ -1,6 +1,6 @@ { "name": "@softarc/native-federation-esbuild", - "version": "2.0.16", + "version": "2.0.17", "type": "commonjs", "dependencies": { "@rollup/plugin-commonjs": "^22.0.2", diff --git a/libs/native-federation-node/package.json b/libs/native-federation-node/package.json index 384d353..f89c58e 100644 --- a/libs/native-federation-node/package.json +++ b/libs/native-federation-node/package.json @@ -1,4 +1,4 @@ { "name": "@softarc/native-federation-node", - "version": "2.0.16" + "version": "2.0.17" } diff --git a/libs/native-federation-runtime/package.json b/libs/native-federation-runtime/package.json index 20b81a2..153eb61 100644 --- a/libs/native-federation-runtime/package.json +++ b/libs/native-federation-runtime/package.json @@ -1,6 +1,6 @@ { "name": "@softarc/native-federation-runtime", - "version": "2.0.16", + "version": "2.0.17", "dependencies": { "tslib": "^2.3.0" }, diff --git a/libs/native-federation/README.md b/libs/native-federation/README.md index a77b934..1cdd59b 100644 --- a/libs/native-federation/README.md +++ b/libs/native-federation/README.md @@ -34,6 +34,16 @@ We will at least provide a new version of this package per Angular major. If nec - Use version 18.2.x for Angular 18.2.x - Use version 19.x for Angular 19.x +## Demo Repo + +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. + + + + + +This is primarily for testing purposes. For an **initial example and/or an tutorial please look below.** + ## Migration from Module Federation 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 ### How to Deal with Transitive Dependencies? -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. +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. To activate sharing transient dependencies, set the new `transient` flag provided by `share` and `shareAll` to `true`: ```js module.exports = withNativeFederation({ shared: { - ...shareAll({ - singleton: true, - strictVersion: true, - requiredVersion: 'auto', - transient: true + ...shareAll({ + singleton: true, + strictVersion: true, + requiredVersion: 'auto', + transient: true }), }, [...] diff --git a/libs/native-federation/demo-repo.png b/libs/native-federation/demo-repo.png new file mode 100644 index 0000000..4dc8d9f Binary files /dev/null and b/libs/native-federation/demo-repo.png differ diff --git a/libs/native-federation/package.json b/libs/native-federation/package.json index 538a900..6a3c2c2 100644 --- a/libs/native-federation/package.json +++ b/libs/native-federation/package.json @@ -1,6 +1,6 @@ { "name": "@angular-architects/native-federation", - "version": "19.0.3", + "version": "19.0.4", "main": "src/index.js", "generators": "./collection.json", "builders": "./builders.json", @@ -20,8 +20,8 @@ }, "dependencies": { "@babel/core": "^7.19.0", - "@softarc/native-federation": "2.0.16", - "@softarc/native-federation-runtime": "2.0.16", + "@softarc/native-federation": "2.0.17", + "@softarc/native-federation-runtime": "2.0.17", "@types/browser-sync": "^2.29.0", "@chialab/esbuild-plugin-commonjs": "^0.18.0", "browser-sync": "^3.0.2", diff --git a/libs/native-federation/src/utils/angular-esbuild-adapter.ts b/libs/native-federation/src/utils/angular-esbuild-adapter.ts index a37d2ca..3223a7d 100644 --- a/libs/native-federation/src/utils/angular-esbuild-adapter.ts +++ b/libs/native-federation/src/utils/angular-esbuild-adapter.ts @@ -69,7 +69,7 @@ export function createAngularBuildAdapter( watch, dev, hash, - platform + platform, } = options; const files = await runEsbuild( @@ -281,7 +281,7 @@ async function runEsbuild( format: 'esm', target: ['esnext'], logLimit: kind === 'shared-package' ? 1 : 0, - plugins: plugins as any || [ + plugins: (plugins as any) || [ createCompilerPlugin( pluginOptions.pluginOptions, pluginOptions.styleOptions