-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrading from 0.7.6 to 0.7.7 breaks Nested/Cumulative Layouts. #144
Comments
So I noticed, it only breaks for Nested Layouts, that's when it shows the Very consistent with the a project bootstrapped with Bati as well. |
@rtritto @Blankeos Up for digging into this? It would be nice if the community can (eventually) take over |
Hmmm weird. Don't mind the fix for now. I did fix the recursion, but... I noticed there's another weird behavior: Current Bug after the first fix:layout-state-bug.mp4Desired Behavior (but only in 0.7.6)0.7.6.behavior.mp4More findings...I tried with 3 layouts. It seems it resets rendering for everything when the number of layouts change. Which tells me |
I discovered something really stupid with Javascript (or maybe Solid)I noticed simply changing array indexing from Not sure what's so fundamentally different between them because I genuinely thought they were the same!! Just that So the fix on the second bug from #144 (comment). Is actually: // Assuming you `.toReversed()` in the reconcile.
let item = wrappers.at(props.index) // ❌ bad
let item = wrappers[props.index] // ✅ good?
// It also doesn't work if it wasn't reversed in the reconcile. (The state does not persist, and the component rerenders)
let item = wrappers.at(-(i + 1)); // ❌ bad.
let item = wrappers[layouts.length - 1 - index] // ❌ bad. I bumped into this on a whim while fixing this bug. I tried accessing backwards using // Attempt 1:
let item = wrappers[wrappers.length - 1 - i];
// Attempt 2:
const index = wrappers.length - 1 - i;
let item = undefined;
if (index !== -1) item = wrappers[index]; Takeaways:
Now works as expected: expected.behavior.now.mp4 |
Interesting findings. It would probably be a good idea to check if such issues are already known by the Solid team, and open some issues if that is not the case. |
After upgrading from
0.7.6
to0.7.7
, layouts seem to be breaking.I tried...
✅
[email protected]
and[email protected]
. It works. (using[email protected]
)❌
[email protected]
and[email protected]
. It doesn't work. (using[email protected]
)❌
[email protected]
and[email protected]
. It doesn't work. (using[email protected]
)I also thought maybe it was just Vite, but no. Because:
❌
[email protected]
and[email protected]
. It doesn't work. (using[email protected]
)✅
[email protected]
and[email protected]
. It works. (using[email protected]
)So I kinda conclude It's because of [email protected].
Still investigating what the cause is... So opening this issue for that.
I'm trying to compare the changes from 0.7.6 to 0.7.7: 94bda74...16c9c82 (I just used the
release: 0.7.6
andrelease: 0.7.7
commits).Reproduction
I will add here when I can, but you can maybe use my boilerplate: https://github.com/blankeos/solid-hop (It's pretty barebones). And then reproduce the package versions I mentioned above.
The text was updated successfully, but these errors were encountered: