Releases: angular-architects/module-federation-plugin
20.0.0
- feat(nf): migrate to angular 20
Full Changelog: 19.0.23...20.0.0
19.0.23
What's Changed
- fix(index-file): fixed the double quote issue by @asollberger in #849
Full Changelog: 19.0.19...19.0.23
19.0.19
This release solves several issues that occurred with Angular 19.2, and it also solves issues with an entire class of npm packages using Singletons. For this, it delegates directly to the underlying bundler for chunk splitting. Hence, we don't need the transient flag anymore. transient deps will end up in their own bundles automatically when required (when used from more than one other dependencies). In this regards, Native Federation now behaves like Module Federation.
19.0.10
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 bundlesexternal: 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
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
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.
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
- feat(nf): add shareAngularLocales helper
- feat(nf): support angular i18n
Native Federation 16.3
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
@angular-architects/module-federation 15.0.0
- Updated for Angular 15
npm run run:allnow also works in an Nx workspace- New
skipconfig property for skipping shared mappings, shared deps, and secondary entry points loadRemoteModuledefaults totype: 'manifest'if there was a manifest loaded- New
initFederationfunction as an alternative for both,loadManifestandsetManifest. Also, this provides feature parity with Native Federation - The
initschematic now generates a call toinitFederation(i/oloadManifest) when using the flag--type dynamic-host