Skip to content

Add check for last seen vnode in index.js#590

Merged
JoviDeCroock merged 3 commits intomainfrom
JoviDeCroock-patch-1
Oct 3, 2025
Merged

Add check for last seen vnode in index.js#590
JoviDeCroock merged 3 commits intomainfrom
JoviDeCroock-patch-1

Conversation

@JoviDeCroock
Copy link
Copy Markdown
Member

@JoviDeCroock JoviDeCroock commented Oct 3, 2025

Resolves #589

TODO: add a test

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Oct 3, 2025

🦋 Changeset detected

Latest commit: c01b20d

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

This PR includes changesets to release 1 package
Name Type
@prefresh/core 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

Add a check for the last seen vnode in index.js to improve vnode management.
@JoviDeCroock JoviDeCroock merged commit 1a81dd0 into main Oct 3, 2025
1 check passed
@JoviDeCroock JoviDeCroock deleted the JoviDeCroock-patch-1 branch October 3, 2025 12:56
@github-actions github-actions Bot mentioned this pull request Oct 3, 2025
@NiedziolkaMichal
Copy link
Copy Markdown

It fixes the problem with infinite loop, but fragment content might not be rendered correctly:

Screen.Recording.2025-10-03.at.15.31.43.mov

@JoviDeCroock
Copy link
Copy Markdown
Member Author

JoviDeCroock commented Oct 3, 2025

@NiedziolkaMichal That one component going away isn't really a prefresh bug, nor a general one. It's an issue when no parent-elements are present for ever-changing component identities. i.e. if you have any normal DOM node in your tree. i.e. wrap Layout with <main> that issue won't happen. It's a relic of using a really minimal example 😅 we should look for a fix for that at some point, I'll look at the Preact side when I have some time to figure that out.

EDIT: nvm, this is actually fixed in latest Preact, I just tried it locally.

Recording.2025-10-03.155445.mp4

@NiedziolkaMichal
Copy link
Copy Markdown

That's great to hear, thanks a lot for a quick fix

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.

Infinite loop while refreshing fragment content

2 participants