fix: prevent infinite reactive loop when computed reads @locals inside for (#140)#141
Merged
fix: prevent infinite reactive loop when computed reads @locals inside for (#140)#141
Conversation
|
Release preview: merging this PR will publish v0.43.1 (patch bump from v0.43.0) |
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||
Consecutive {set} macros can't see each other's store mutations during
a Preact render pass. Design uses a MutationBufferContext to share
mutation state within a passage's render lifecycle.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6-task plan covering context definition, executeMutation buffer support, defineMacro wiring, and Passage/PassageDialog providers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…#140) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ix (#140) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…op (#140) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e for (#140) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…orIteration (#140) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4920b72 to
aa36a82
Compare
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.
Summary
{computed}referencing@loop variable inside{for}causes infinite reactive loop #140:{computed _x = @item.status}inside{for @item of array}no longer causes an infinite reactive loopForIterationprops and memoizeownKeys/localStatewithuseMemoto stabilize object references across unrelated re-rendersprevRefself-comparison guard so each{computed}only writes to the store when its own output changes, preventing oscillation from conflicting writesTest Plan
{computed _derived = @item.status}inside{for}renders without hanging (regression test)npx tsc --noEmitpasses clean🤖 Generated with Claude Code