Repository navigation
fix(native): cut circular variable resolution instead of blowing the stack - #422
Open
YevheniiKotyrlo wants to merge 1 commit into
Open
YevheniiKotyrlo wants to merge 1 commit into
YevheniiKotyrlo wants to merge 1 commit into
Conversation
Contributor
Author
No device frameThis PR adds tests only. |
…er's guard nativewind#451 cuts a custom-property cycle at runtime and in the compile-time inliner, and tests cycles declared on one element. A variable reaches a descendant unresolved, so a cycle can also close on the element that reads it: a variable that is itself, one reached again through a fallback, two that name each other, and one reached from two branches of one value. Each drops the declaration that reads it, as browsers do, while an unrelated variable still resolves. The other cases pin what must not read as a cycle: a variable read twice in one declaration, and a long inherited chain. The compiler cases pin that the inliner leaves a cycle for the runtime and still folds a chain.
YevheniiKotyrlo
force-pushed
the
fix/variable-resolution-cycle
branch
from
October 11, 2026 12:35
3ab7d96 to
f5913ae
Compare
This branch has not been deployed
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
#451 cuts a custom-property cycle at runtime and in the compile-time inliner, which is what this PR fixed when I opened it. The code change is gone. What stays is coverage
maindoes not have, because its cycle tests declare every cycle on one element:src/__tests__/native/variable-cycles.test.tsx:useUnstableNativeVariable.src/__tests__/compiler/variable-cycles.test.ts: the inliner leaves a cycle for the runtime and still folds a chain.Tests
All 24 pass on
main. Removing the inliner's guard, the resolver's guard, the pop of a resolved name, or the marking of a cycle each turns them red (4, 10, 2 and 1 cases).Verification
On Windows with Node 26:
yarn lintcleanyarn typecheckcleanyarn test --coverage: every failure also fails onmainon this machine (the four babel cases)yarn buildcleanyarn example expo export --platform webexportedBase
Re-written on
main(a5002c5) as tests only. Two expectations changed to what browsers compute:*declaration outranks an inherited value. That case is about precedence rather than cycles, so it moved to test(native): cover custom-property precedence #443.