You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(html): keep minifying a document the round-trip guard checks (#21842)
* fix(html): keep minifying a document the round-trip guard checks
The printer verifies a handful of parse shapes by re-parsing its own
output and comparing tree digests, but compared them byte for byte — so
collapsed whitespace, a dropped comment, a minified inline sheet and a
respelled attribute value all read as a moved node, and the whole
document came back unminified. A nested list item is enough to turn the
guard on, which is most nav menus and every rendered Markdown list.
Digest both trees the way the print leaves them instead; a node that
really moves still reshapes the tree and still hands the source back.
Alongside it, in the CSS minifier: `flex` and the four logical
`border-<edge>` shorthands now merge out of their longhands — the edges
state their grammar as `<'border-top'>`, so the generator follows that
reference rather than listing them, and Chromium says both reset nothing
their longhands do not, where `border` itself clears every
`border-image-*` and so stays out. Two printing costs go with them:
whether a sibling opens an `@layer` block is read off the node rather
than off its printed text, which had flattened every rule's rope at
every nesting level, and the print store grows in place rather than
copying what it already holds at each step.
* chore: format the regenerated changelog
The release commit wrote a code span prettier respaces, which fails
`fmt:check` on every branch grown from it.
* fix(html): put a deferred body back before the round-trip guard reads it
An `<svg>` subtree, an inline `<style>` and an `<iframe srcdoc>` print as a
marker for an asynchronous renderer to answer, so the guard's re-parse read
text where the node stood and handed the whole document back unminified.
* chore: shorten the changeset and a test comment to their limits
* test(html): cover the deferred-svg guard where the print is deterministic
The config case reached the deferred path only where the minimizer plugin
handed the renderer through, so its snapshot recorded a transform CI never
applied. A `processAsync` unit test drives the same guard directly.
* chore(html): shorten the deferred-write comment to two lines
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -799,7 +799,7 @@
799
799
800
800
- Fix snapshot validity check for context dependencies in watch mode by treating watchpack's existence-only entries (`{}`) as cache misses. (by [@alexander-akait](https://github.com/alexander-akait) in [#20916](https://github.com/webpack/webpack/pull/20916))
801
801
802
-
- Support no-expression template literals in computed member access (e.g. ``import.meta[`url`]``). (by [@alexander-akait](https://github.com/alexander-akait) in [#20889](https://github.com/webpack/webpack/pull/20889))
802
+
- Support no-expression template literals in computed member access (e.g. ``import.meta[`url`]``). (by [@alexander-akait](https://github.com/alexander-akait) in [#20889](https://github.com/webpack/webpack/pull/20889))
803
803
804
804
- Improve tree-shaking in `isPure`: handle more expression types (`ArrayExpression`, `ObjectExpression`, `NewExpression`, `ChainExpression`, `UnaryExpression` (safe operators), `MetaProperty`, `TaggedTemplateExpression`, `BinaryExpression` (strict equality)), prevent `/*#__PURE__*/` comments from leaking across `ObjectExpression` properties, and detect PURE comments inside `TemplateLiteral` interpolations. (by [@alexander-akait](https://github.com/alexander-akait) in [#20723](https://github.com/webpack/webpack/pull/20723))
0 commit comments