Repository navigation
@linaria/react@8.4.0
Minor Changes
- 0129dda: Add the
forwardedAsprop to styled components. It is passed to the wrapped component as itsasprop, which makes it possible to change the element rendered by a wrapped component without replacing the component itself.
Patch Changes
-
75e11a7: Update WyW dependencies to 2.7.2
The
@wyw-in-js/*dependencies move from 2.7.1 to 2.7.2. Linaria styles are compiled by the WyW integration of your bundler, and each integration depends on an exact version of@wyw-in-js/transform, so update@wyw-in-js/vite,@wyw-in-js/webpack-loaderor the integration you use to 2.7.2 as well: the build runs the transform that the integration installs.Changes from this release that reach Linaria builds:
@wyw-in-js/sharedand@wyw-in-js/transformdepend onminimatch11 instead of 9, so a fresh install no longer resolves aminimatchrelease affected by GHSA-g3hv-75wg-m249 (denial of service through globparts amplification), which has no fix in the 9.x line.- Build-time evaluation with DOM emulation (
features.happyDOM, on by default) runs in a single JavaScript realm, so checks such as[] instanceof Arrayorerror instanceof TypeErrorin evaluated code give the same results as withhappyDOM: false. - A call to a function or class whose body assigns an outer binding with
=, such aslet n = 0; function init() { n = 5; } init();, is kept when a module is prepared for evaluation, so styles read the assigned value instead of the initial one. - Statements that read
new.targetare kept when a module is prepared for evaluation; before, they were removed as if they readimport.meta. - An SSR check such as
typeof(window),typeof (window as any)ortypeof window!is treated as"undefined"during build-time evaluation, as the baretypeof windowalready was. - The Rollup and esbuild integrations print processor diagnostics as warnings instead of dropping them.
- Processor lookups and the waits between transform steps are cheaper in projects with many modules or many transforms in flight.
Two changes can alter the CSS of existing code. With the default
hybridevaluation strategy, a module-level value that a function, constructor, method or callback changes while the module loads is now evaluated instead of resolved from its declaration:let size = 0; function init() { size += 5; } init();used to produce0and now produces5, and with thestaticstrategy such a value now fails with the usual message about values it could not resolve. A modulevarthat an interpolation reads above its declaration now gives the value that evaluation sees, as in theexecutestrategy. -
Updated dependencies [75e11a7]
- @linaria/core@8.4.0