@vercel/microfrontends
2.4.2 · 20 Oct 20261.8M / weekRepositoryHomepagenpmAtom feed
1.5.0 is the newest release of 1.x.
In short
1 new
Release note
The section about @vercel/microfrontends of a note shared by several packages.
Minor Changes
Improve
PrefetchCrossZoneLinksProviderperformance.Stops components using this context from rerendering every time
prefetchHrefis called on an unseenhref.Batches multiple prefetch calls together before causing a new render.
Improve
MicrofrontendConfigClientcaching.Reuses clients when calling
MicrofrontendConfigClient.fromEnv()with the same parameters as a previous call. This improves the hit rate of the path cache when there aren't dynamic paths.Caches the
hasDynamicPathscheck so that it doesn't need to be recalculated for each use of the hook.When the promise for the server-fetched config resolves, it stores a cached copy of that directly in a new variable so that future invocations of
useClientConfig()can have the correct config in their initial render.Adds a
regexpCacheto cache the resulting regex for each path, to avoid callingpathToRegexpin most cases beyond the initial few links.
Remove the custom
@vercel/microfrontendsImagecomponent.The wrapper around Next.js
Imageis no longer needed, as the vercel proxy now handles image optimisation request routing for microfrontends.If you are currently importing
{ Image } from '@vercel/microfrontends/next/client'you can replace this withImage from 'next/image'.
Use
defineServerinstead of custom webpack EnvironmentPlugin when the version of Next.js is new enough to support it.vercel/next.js#79225 added support to Next.js for defining server-only compile-time constants independent of the bundler.
Like
compiler.define, this allows users to create compile-time constants both Turbopack and webpack from a single API.compiler.defineServerinstead only makes these constants available for server or edge environments, not the client environment.
The new behaviour is used by default when the version of Next.js is new enough to support it. Otherwise the custom webpack EnvironmentPlugin is used.
Optionally, you can specify
preferWebpackEnvironmentPlugin. This will use the legacywebpack.EnvironmentPlugininstead of Next.js'sdefineServeroption, even when Next.js is new enough to support it.
Remove support for
projectIdinmicrofrontends.json.projectIdwas deprecated in a previous release. This release removes support for the field entirely.If you are still using
projectId, see the previous release notes inCHANGELOG.mdfor removing it.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.