fix: make prefresh hmr integration easier - #728
Merged
Conversation
✅ Deploy Preview for preact-signals-demo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
marvinhagemeister
marked this pull request as draft
July 29, 2025 11:16
Contributor
|
Size Change: -210 B (-0.24%) Total Size: 87.3 kB
ℹ️ View Unchanged
|
marvinhagemeister
force-pushed
the
signal-hmr
branch
from
July 29, 2025 11:33
856ca2b to
9e92589
Compare
🦋 Changeset detectedLatest commit: 0fd9503 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
The callback to `useMemo` is assumed to be pure during HMR and will be re-triggered. This in turn broke the `useSignal` hooks HMR as they used side-effectful callbacks.
marvinhagemeister
force-pushed
the
signal-hmr
branch
from
July 29, 2025 11:37
9e92589 to
0fd9503
Compare
marvinhagemeister
marked this pull request as ready for review
July 29, 2025 11:38
JoviDeCroock
approved these changes
Jul 29, 2025
| () => signal<T | undefined>(value, options as SignalOptions), | ||
| [] | ||
| ); | ||
| return useState(() => |
mdentremont
reviewed
Feb 2, 2026
| () => signal<T | undefined>(value, options as SignalOptions), | ||
| [] | ||
| ); | ||
| return useState(() => |
There was a problem hiding this comment.
Per a chat with @JoviDeCroock, would using useState prevent the SCU optimizations (which bail early if there are useState usages in a component)?
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The callback to
useMemois assumed to be pure during HMR and will be re-triggered. This in turn broke theuseSignalhooks HMR as they used side-effectful callbacks.