Skip to content

Conversation

@JoviDeCroock
Copy link
Member

When preact suspends it creates a "parked" vnode structure, the real DOM is discarded but the virtual tree remains in-memory. This means that when a component has suspended but never actually mounted that it is absent of any vnode properties.

When a suspended tree is unmounted we clear all properties another time but suspense has already cleared _component which means that we will never dispose the effect, any signal update contained within the component can therefor cause re-renders.

With this patch we rely on the __R internal property, people using native Suspense will see this error clear up.

A repro can be seen at
https://stackblitz.com/edit/vitejs-vite-bzsqxq1w?file=src%2Fsignals-patch.js,src%2Fapp.tsx&terminal=dev

  • replacing signals-patch with @preact/signals will reproduce the bug.

When preact suspends it creates a "parked" vnode structure, the real
DOM is discarded but the virtual tree remains in-memory. This means
that when a component has suspended but never actually mounted that
it is absent of any vnode properties.

When a suspended tree is unmounted we clear all properties another time
but suspense has already cleared `_component` which means that we will
never dispose the `effect`, any signal update contained within the
component can therefor cause re-renders.

With this patch we rely on the __R internal property, people using
native Suspense will see this error clear up.

A repro can be seen at
https://stackblitz.com/edit/vitejs-vite-bzsqxq1w?file=src%2Fsignals-patch.js,src%2Fapp.tsx&terminal=dev
- replacing signals-patch with @preact/signals will reproduce the bug.
@changeset-bot
Copy link

changeset-bot bot commented Jan 29, 2026

🦋 Changeset detected

Latest commit: e4bbb66

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@preact/signals Patch
preact-signals-devtools Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link

netlify bot commented Jan 29, 2026

Deploy Preview for preact-signals-demo ready!

Name Link
🔨 Latest commit e4bbb66
🔍 Latest deploy log https://app.netlify.com/projects/preact-signals-demo/deploys/697b93f369de8f0008f78a98
😎 Deploy Preview https://deploy-preview-858--preact-signals-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Contributor

Size Change: +36 B (+0.02%)

Total Size: 153 kB

Filename Size Change
docs/dist/assets/EmbeddedDevtools.********.js 16.1 kB +8 B (+0.05%)
docs/dist/assets/signals.module.********.js 2.57 kB +3 B (+0.12%)
docs/dist/assets/Unmount.********.js 648 B -1 B (-0.15%)
docs/dist/basic-********.js 246 B +1 B (+0.41%)
packages/devtools-ui/dist/devtools-ui.js 14.7 kB +4 B (+0.03%)
packages/devtools-ui/dist/devtools-ui.mjs 14.2 kB +4 B (+0.03%)
packages/preact/dist/signals.js 1.71 kB +8 B (+0.47%)
packages/preact/dist/signals.mjs 1.68 kB +9 B (+0.54%)
ℹ️ View Unchanged
Filename Size
docs/dist/assets/bench.********.js 1.59 kB
docs/dist/assets/client.********.js 46.3 kB
docs/dist/assets/devtools.********.js 1.15 kB
docs/dist/assets/index.********.js 835 B
docs/dist/assets/jsxRuntime.module.********.js 297 B
docs/dist/assets/preact.module.********.js 4.76 kB
docs/dist/assets/signals-core.module.********.js 1.56 kB
docs/dist/assets/style.********.css 3.8 kB
docs/dist/assets/style.********.js 21 B
docs/dist/nesting-********.js 1.13 kB
docs/dist/react-********.js 242 B
packages/core/dist/signals-core.js 1.59 kB
packages/core/dist/signals-core.mjs 1.6 kB
packages/debug/dist/debug.js 4.49 kB
packages/debug/dist/debug.mjs 4.01 kB
packages/devtools-adapter/dist/devtools-adapter.js 2.17 kB
packages/devtools-adapter/dist/devtools-adapter.mjs 1.88 kB
packages/preact-transform/dist/signals-*********.js 1.3 kB
packages/preact-transform/dist/signals-transform.mjs 1.29 kB
packages/preact-transform/dist/signals-transform.umd.js 1.42 kB
packages/react-transform/dist/signals-*********.js 6.81 kB
packages/react-transform/dist/signals-transform.mjs 6 kB
packages/react-transform/dist/signals-transform.umd.js 6.92 kB
packages/react/dist/signals.js 188 B
packages/react/dist/signals.mjs 150 B

compressed-size-action

@JoviDeCroock JoviDeCroock merged commit 49c85b3 into main Jan 30, 2026
6 checks passed
@JoviDeCroock JoviDeCroock deleted the backport branch January 30, 2026 16:46
@github-actions github-actions bot mentioned this pull request Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants