This is a bigger release because it contains internal changes, feel free to check the README for all the new features!
What's Changed
- PostCSS error after Angular v21 and plugins relative to config file by @JGhignatti in #1022
- fix: Fix tests in error by @yatho in #997
- feat(native-federation): including sass on styleOptions by @rribeiro93 in #1018
- fix(nf): exhaustive secondary entrypoint resolving by @Aukevanoost in #1013
- docs,testing(native-federation-runtime): adds mvp of testing with vitest and playwright to native-federation-runtime by @aramirezj in #1004
New Contributors
- @yatho made their first contribution in #997
- @rribeiro93 made their first contribution in #1018
New! advanced external features
We're excited to announce some extra features and enhancements regarding the sharing of externals. All features are opt-in so this shouldn't break existing applications.
shareAll overrides
Instead of adding the "share" helper after the "shareAll" helper, it is now possible to add overrides to the shareAll helper! This prevents double entries from occuring and allows you to have a default config with overrides for certain externals:
before:
const { withNativeFederation, shareAll, share } = require('@softarc/native-federation/build');
module.exports = withNativeFederation({
name: 'host',
shared: {
...shareAll(
{
singleton: true,
strictVersion: true,
requiredVersion: 'auto',
}
),
...share({
'package-b': {
singleton: false,
strictVersion: true,
requiredVersion: 'auto'
},
})
},
});
after:
const { withNativeFederation, shareAll } = require('@softarc/native-federation/build');
module.exports = withNativeFederation({
name: 'host',
shared: {
...shareAll(
{
singleton: true,
strictVersion: true,
requiredVersion: 'auto',
},
{
overrides: {
'package-b': {
singleton: false,
strictVersion: true,
requiredVersion: 'auto'
},
},
},
),
},
});
A new buildtype!
Next to "separate" and "default", it is now also possible to build per "package", the only small difference with "separate" is that this runs an ESbuild task per package instead of per entrypoint (which is what "separate" does).
const { withNativeFederation, shareAll, share } = require('@softarc/native-federation/build');
module.exports = withNativeFederation({
name: 'host',
shared: {
...share({
'package-b': {
singleton: true,
strictVersion: true,
requiredVersion: 'auto',
build: 'package',
},
})
},
});
Enhanced pseudo-treeshaking!
It is now possible to tweak the secondary entrypoints of externals to include wildcard paths or to opt-out of the "ignoreUnusedDeps" feature per external! Read more about it in the docs!
Full Changelog: 21.0.3...21.0.4