Skip to content

Releases: angular-architects/module-federation-plugin

19.0.10

16 Feb 12:28
Compare
Choose a tag to compare

Big thanks to our contributors!

Features

feat(nf-runtime): added cacheTag option

initFederation now has a cacheTag option. If you set it, e.g., to Date.now(), it will be appended to the URLs of the fetched remoteEntries.json files to prevent caching.

Big thanks to Alain Sollberger for this contribution!

feat(nf): allow to version repo-internal libs (mapped paths)

We can now assign a version number to monorepo-internal libs (mapped paths). This allows to detect conflicts in cases where different micro frontends of the same monorepo were deployed independently and a shared internal lib was changed in between the two deployments.

To use this feature, just assign a version number in the libs package.json and activate the new feature using the new feature map:

module.exports = withNativeFederation({

  [...]

  features: {
    mappingVersion: true,
  },
  
});

The new feature map activates features that might cause breaking changes. Without explicitly activating these features, the usual backwards-compatible behavior is used.

feat(nf): Allow building dev bundles without using the dev-server

So far, the dev option activated both, producing dev bundles and starting the dev server. The new devServer flag allows to opt out of using the dev server so that dev bundles end up in the `dist folder.

"build": {
	"builder": "@angular-architects/native-federation:build",
	"options": {},
	"configurations": {
		"production": {
			"target": "demo:esbuild:production"
		},
		"development": {
			"target": "demo:esbuild:development",
			"dev": true
		},
		"dev-bundles": {
			"target": "demo:esbuild:development",
			"dev": true,
			"devServer": false
		}
	},
	"defaultConfiguration": "production"
},

In this case, you can run the additional configuration using ng run demo:build:dev-bundles.

feat(nf-core): add externals config option to manually add externals

The federation config now has an externals flag to add app-specific externals. These are libs that are excluded when creating the bundles. This can be used, for example, to ignore optional dependencies some of your shared libraries reference.

At first glance, Β΄externalsseems to work similarly to theskip` flag. However, there are differences:

  • skip: The mentioned packages are skipped from sharing. Hence, they end up in the application bundles
  • external: The mentioned packages are not build at all.

feat(nf-core): Skip node libs by default when build for the browser

So far, Native Federation has had issues when detecting Node.js-based libs when building for the browser. The solution was to skip such libs or to move them to the devDependencies not discovered by the shareAll helper. The latter one is the right solution for build-time libs anyway.

Now, to streamline this, Native Federation is excluding all Node.js-based libraries when building for the browser.

feat(nf): add build flag with options default and separate

Before, all deps were built together to improve build performance. Now, you can set the new option build found in the share config to separate for selected shared deps. In this case, they will be built separately. This is necessary in rare cases, e.g., where a lib imports parts of itself using its official package name.

As Native Federation uses externals such imports would not be bundled in when built together with other deps. However, if we build it separately, we can remove itself from the external list for this one build.

feat(nf): add platform flag

There is now a platform flag in the shared config that can be set to node or browser so that the shared dependency is built for the respective platform. For some Angular-internal libs such as @angular/platform-server or @angular/ssr platform=node is assumed automatically. Internally, a constant `DEFAULT_SERVER_DEPS_LISTΒ΄ is used to identify them.

Docs

docs(nf): mention demo repo

Our readme now points to our new example repo that shows how to use Native Federation with popular UI libs: ag-grid, Angular Material, VMWare Clarity, Kendo UI, ng-bootstrap, ng-zorro, primeng.

Fixes

fix(nf): update script tags in place to respect #733

This solves issues with using deployUrl option provided by the Angular CLI.

fix(nativeFederation): fixes the missing behaviour of the param outputPath

We now can directly set the outputPath property for the NativeFederationBuilder.

Big thanks to Alejandro for this contribution.

fix(nf): backslashes not converted to slashes in sub dependency paths

Big thanks to Bernd Konnerth for the PR with this fix!

Native Federation 19.0.0

21 Dec 14:17
Compare
Choose a tag to compare

All features of version 19.0.0 are also found in 18@latest.

  • Provide support for Angular SSR and Incremental Hydration (see blog)
  • Provide support for hybrid mode using both, Module Federation and Native Federation (see blog)
  • Support sharing transitive dependencies (see readme)
  • Support manually providing entry points (see readme)
  • Fix issues with watch mode and ng build

Native Federation 18.1

07 Aug 21:35
Compare
Choose a tag to compare

Changes

  • Use the official private API in @angular/build so that we don't need to patch this package anymore. This resolves several issues.
  • Add migration guide for migrating from Module Federation to readme
  • Add hash to generated bundle names to prevent situations where several bundles get the same name
  • Allow ng build --base-href /my-base-path/
  • Fix: Make sure the process exits when there is an error

Native Federation 17.1.

21 Jan 15:25
Compare
Choose a tag to compare

CLI-Integration

Since 17.1, Native Federation for Angular uses the Angular CLI's esbuild-based Application Builder and the CLI's Dev Server to keep track with all the innovations and performance-improvements in that space.

19.0.16

02 Mar 20:35
Compare
Choose a tag to compare
  • feat(nf): add shareAngularLocales helper
  • feat(nf): support angular i18n

Details in Readme

Native Federation 16.3

10 Sep 12:54
Compare
Choose a tag to compare

Performance πŸš€

This release brings tremendous performance improvements due to:

  • calling esbuild less often with more coarse-grained tasks
  • Not writing files to disk in dev mode

This brings the excellent performance known by Angular's esbuild builder this package currently delegates to.

Remove Schematic

You can now remove the native-federation config with the new remove schematic:

ng g @angular-architects/native-federation:remove --project xyz

Details & Tutorial

https://www.npmjs.com/package/@angular-architects/native-federation

15.0.0

17 Nov 21:47
Compare
Choose a tag to compare

@angular-architects/module-federation 15.0.0

  • Updated for Angular 15
  • npm run run:all now also works in an Nx workspace
  • New skip config property for skipping shared mappings, shared deps, and secondary entry points
  • loadRemoteModule defaults to type: 'manifest' if there was a manifest loaded
  • New initFederation function as an alternative for both, loadManifest and setManifest. Also, this provides feature parity with Native Federation
  • The init schematic now generates a call to initFederation (i/o loadManifest) when using the flag --type dynamic-host

14.3.0

05 Jun 21:53
Compare
Choose a tag to compare

14.3.0 - Angular 14 Support & More

Update

This library supports ng update:

ng update @angular-architects/module-federation

If you update by hand (e. g. via npm install), make sure you also install a respective version of ngx-build-plus (version 14 for Angular 14, version 13 for Angular 13, etc.)

Breaking Changes

  • shareAll now uses the DEFAULT_SKIP_LIST by default.

Features

  • add withModuleFederationPlugin to simplify the generated (ca26aeb)
  • mf-runtime: load remotes in parallel (5615917)
  • mf-runtime: supporting mf manifests (64ec2dc)
  • mf: add support for eager and pinned (623837c)
  • mf: add type option to ng-add (c57d87f)
  • mf: dev-server (run:all) accepts project names via command line args (b765515)
  • mf: respect APF v14 for discovering secondaries (00344c2)

Documentation

  • update readme and tutorial for v14.3 (fbdb463)

14.2.0

12 Mar 23:11
Compare
Choose a tag to compare
  • fix: Use "number" for port parameter during init #147
  • feature: new appType makes bootstrap helper automatically call shareNgZone or connectRouter. No need to call it in the AppComponent by hand. See usage in the updated readme

14.1.1

13 Feb 20:43
Compare
Choose a tag to compare
  • fix: install ngx-build-plus via schematic to avoid issues with yarn (commit)