6486 Commits
Author SHA1 Message Date
Jovi De Croock 66b6e565d2 Merge pull request #5336 from preactjs/release/11.1.0
11.1.0
11.1.0
2026-10-27 12:48:26 +01:00
Jovi De Croock 9a29751de0 11.1.0 2026-10-27 11:59:03 +01:00
Jovi De Croock a89164f903 Merge pull request #5335 from preactjs/harden-vnode-recognition
Harden vnode recognition
2026-10-27 11:57:01 +01:00
Jovi De Croock aa97758929 chore: restore existing render-to-string peer range 2026-10-27 09:57:18 +00:00
Jovi De Croock 67d3ff9ae5 fix: avoid String coercion when diffing symbol-marked VNodes
Use strict constructor equality and cover the coercion regression without timing assertions. Existing boxed String rendering remains covered.

Developed with AI assistance (Hermes/OpenAI).
2026-10-27 09:49:32 +00:00
Jovi De Croock f39ebc81fc Update Signals and SSR for symbol-marked VNodes 2026-10-27 10:10:54 +01:00
Jovi De Croock c8212f3a45 Merge branch 'main' into harden-vnode-recognition 2026-10-27 09:21:16 +01:00
Jovi De Croock 885a6bea0b Shorten vnode symbol registry key 2026-10-27 08:58:29 +01:00
Jovi De Croock a3d5f76f51 Harden vnode recognition 2026-10-27 07:37:58 +01:00
Jovi De Croock 1c0f1f8234 Merge pull request #5331 from playlikeboy/fix/input-list-attribute-types-5330 2026-10-25 10:37:45 +01:00
Shaswat Raj b21ad22e5d fix(types): allow list attribute on all valid input types (#5330)
Signed-off-by: Shaswat Raj <shaswat340@gmail.com>
2026-10-25 12:55:58 +05:30
Jovi De Croock 958adfa65b Merge pull request #5321 from preactjs/JoviDeCroock/layout-effect-error-isolation
Isolate useLayoutEffect errors to the throwing component
2026-10-23 17:54:34 +02:00
Jovi De Croock d9a50d799e Merge branch 'main' into JoviDeCroock/layout-effect-error-isolation 2026-10-23 17:52:28 +02:00
Jovi De Croock 697666724a Merge pull request #5233 from dylanpulver/fix-unitless-svg-aspect-ratio
Stop appending "px" to unitless SVG paint and aspect-ratio values
2026-10-23 17:52:12 +02:00
Jovi De Croock 59313dedc4 Merge branch 'main' into fix-unitless-svg-aspect-ratio 2026-10-23 17:50:47 +02:00
Jovi De Croock 4e1492c56d Merge pull request #5323 from preactjs/JoviDeCroock/compat-compiler-runtime
Add preact/compat/compiler-runtime
2026-10-23 17:50:39 +02:00
Jovi De Croock 683522a460 Merge branch 'main' into JoviDeCroock/compat-compiler-runtime 2026-10-23 17:48:00 +02:00
Jovi De Croock 7c23627f41 Merge pull request #5329 from preactjs/release/11.0.2
11.0.2
11.0.2
2026-10-23 17:42:45 +02:00
jdecroock b1fffe6a86 11.0.2 2026-10-23 09:23:52 +02:00
Jovi De Croock 1a07083585 Merge pull request #5328 from brevin-aq/fix/render-error-duplicate-children
fix: don't leave MATCHED on new vnodes when a child throws
2026-10-23 09:19:30 +02:00
jdecroock 8ab86ea2f8 fix: keep LIS candidacy separate from old vnode matching
Use a dedicated LIS_CANDIDATE bit so interrupted renders cannot leave new children marked MATCHED. Keep the inexpensive flag test in the minimal-move pass and clear the two new-vnode placement flags after diffing.

Add a regression test covering repeated render failures, DOM reuse, ref detachment, and component unmounting. Source and minified suites: 1415 passed, 11 skipped each.
2026-10-23 09:03:51 +02:00
brevinandClaude Opus 5.5 82d8c66b16 fix: don't leave MATCHED on new vnodes when a child throws
The minimal-move pass (#5174) marked matched new children with MATCHED
and relied on diffChildren's placement loop to clear it. When a child
throws and no error boundary catches it, that loop never finishes. The
new vnodes keep MATCHED and become the old tree of the next render,
where findMatchingIndex and the unmount loop skip them. The next
render then mounts a second copy and keeps the first one.

Derive the minimal-move candidates from `_index` instead, so no flag
is set on new vnodes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-23 04:37:42 +00:00
Dylan Pulver 4683a1e17c Stop appending px to unitless SVG paint and aspect-ratio values
IS_NON_DIMENSIONAL misses aspectRatio, fillOpacity, stopOpacity,
strokeOpacity and strokeMiterlimit. None accepts a <length>, so the
appended px makes the value invalid and the browser drops the whole
declaration: style={{ aspectRatio: 2 }} renders nothing at all.

All five are in React's isUnitlessNumber.
2026-10-21 18:47:43 -04:00
Ryan Christian 1dde7a8638 fix: correct type of createRef (#5326)
* fix: correct type of createRef

* test: correct ref usage
2026-10-21 12:41:40 -05:00
Jovi De Croock c204b92bc6 Add preact/compat/compiler-runtime 2026-10-21 07:32:03 +02:00
Jovi De Croock 6ba541ab03 Trim comments 2026-10-20 19:07:32 +02:00
Jovi De Croock 6c8be8bfa7 Isolate useLayoutEffect errors to the throwing component
A throwing layout effect or layout cleanup used to clear the render
callbacks of every component in the commit queue, so unrelated, still
mounted components lost their layout effects and their class
componentDidMount/componentDidUpdate/setState callbacks, and any other
error in the same commit was never reported.

Since #2193 the reset was needed because the thrower's leftover hook
states would otherwise be invoked as functions by commitRoot. Only the
throwing component's queue needs resetting, so replace it with a single
callback rethrowing the error: commitRoot then routes it to that
component's boundary through its own per-component catch, after every
layout effect ran. Deferring the routing also keeps an unhandled error
from stranding hook states that a later render would queue and run a
second time.
2026-10-20 16:01:13 +02:00
Jovi De Croock 74df25ef95 Merge pull request #5319 from preactjs/JoviDeCroock/golf-preact-core
Golf preact core
2026-10-20 09:59:39 +02:00
Jovi De Croock b8e0ad9a4b Or isHydrating into the suspended flags
isHydrating is MODE_HYDRATE or falsy here (render() and renderComponent() pass `_flags & MODE_HYDRATE`, diffElementNodes `false`, portals `null`), so the ternary is redundant.

-3 B gz / -3 B br.
2026-10-20 09:54:10 +02:00
Jovi De Croock 13249763ac Test newProps !== oldProps first in the cWRP guard
componentWillReceiveProps is called under the same conditions; only the number of `getDerivedStateFromProps` lookups on unchanged props drops (observable only through a static getter).

-4 B gz / -3 B br.
2026-10-20 09:54:08 +02:00
Jovi De Croock ba2598ad1f Let setStyle default removed style values
setStyle already maps `value == null` to '', so the removal loop can omit the argument.

-2 B gz / -2 B br.
2026-10-20 09:54:07 +02:00
Jovi De Croock 353248309c Decide error boundaries once in _catchError
`handled` is now assigned before every read (`ctor && ctor.getDerivedStateFromError`, then 1 after componentDidCatch), and the DIRTY check runs once after both lifecycles, at the same point as before. The catch-side `handled = 0` reset is no longer needed: the next ancestor overwrites `handled` before reading it, so the #5284 carry-over can't come back.

-4 B gz / -1 B br.
2026-10-20 09:54:06 +02:00
Jovi De Croock b13a013be6 Merge pull request #5315 from preactjs/JoviDeCroock/streamed-range-ownership
Retain and improve deferred hydration range markers
2026-10-20 09:44:40 +02:00
Jovi De Croock e4c2527d37 Merge branch 'main' into JoviDeCroock/streamed-range-ownership 2026-10-20 09:38:51 +02:00
Jovi De Croock f1e2327427 Golf: collect a pending range's nodes through rangeEnd() on unmount
rangeEnd() already walks the range, so let it collect the inner nodes
instead of re-walking nextSibling until the end marker. The array is only
allocated for components that own a range (`_excess` set).

-11 B gz / -10 B br.
2026-10-20 09:31:43 +02:00
Jovi De Croock bd05a025d6 Merge pull request #5318 from preactjs/JoviDeCroock/compat-signal-style
Leave non-plain style objects untouched in compat
2026-10-20 09:09:02 +02:00
Jovi De Croock 9301dc06a5 Only append px to plain style objects in compat 2026-10-20 08:55:34 +02:00
Jovi De Croock 17196e5626 Merge branch 'main' into JoviDeCroock/streamed-range-ownership 2026-10-19 17:13:05 +02:00
Jovi De Croock e736c2df9c Merge pull request #5265 from preactjs/JoviDeCroock/rerender-queue-throw
Reschedule queued components when a render throws
2026-10-19 17:12:50 +02:00
Jovi De Croock 76aaf5acf6 Merge branch 'main' into JoviDeCroock/rerender-queue-throw 2026-10-19 16:54:42 +02:00
Jovi De Croock 9f57a3741d Merge branch 'main' into JoviDeCroock/streamed-range-ownership 2026-10-19 16:53:32 +02:00
Jovi De Croock 66b0c44783 Merge pull request #5316 from preactjs/JoviDeCroock/core-diff-golf
Reduce core diff bundle size
2026-10-19 16:53:22 +02:00
Jovi De Croock 9dacaa5ea8 Merge branch 'main' into JoviDeCroock/core-diff-golf 2026-10-19 14:45:07 +02:00
Jovi De Croock e85be31af9 Merge pull request #5317 from preactjs/JoviDeCroock/core-bookkeeping-golf
Trim core scheduling and DOM bookkeeping
2026-10-19 14:25:42 +02:00
Jovi De Croock 1e4e6fd16b Trim core scheduling and DOM bookkeeping
Authored by gpt6.1-sol.
2026-10-19 10:39:37 +02:00
Jovi De Croock a9dc9b0107 Reduce core diff bundle size
Authored by gpt6.1-sol.
2026-10-19 10:39:05 +02:00
Jovi De Croock 54a8f7e5c6 Trim redundant streamed range comments 2026-10-19 08:51:10 +02:00
Jovi De Croock 6ea5316016 Trim streamed range bookkeeping and skip empty range lookups 2026-10-19 08:35:04 +02:00
Jovi De Croock 564ad29b09 Drop a resolved streamed range's markers when its owner unmounts
Once a boundary resolved, nothing referenced its `<!--$s-->` markers, so
unmounting it left an empty pair behind. With streaming that isn't inert: a
`<preact-island>` chunk arriving after the unmount finds the empty range and
inserts the server HTML again, so unmounted content reappears.

Keep `_excess` after the resume (the resume path is gated on MODE_SUSPENDED,
so it is never re-entered) and remove the markers in unmount. A resolved
owner only removes the two markers: its content went with its child vnodes,
and after a keyed reorder the markers may surround a sibling's content.
Resuming stays mutation-free.

preact 4588 -> 4595 B br (+7)
2026-10-19 07:53:04 +02:00
Jovi De Croock 43ec455f9e Resume an empty streamed range in place
A resumed range starts its cursor at the first kept node. An empty range
(`<!--$s--><!--/$s-->`, e.g. a streamed Suspense without a fallback) has
none, so the resolved content was appended at the end of the parent instead
of between its markers. Fall back to the end marker.

preact 4583 -> 4588 B br (+5)
2026-10-19 07:53:04 +02:00