-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
Fiber fixes attempt 2 #542
base: main
Are you sure you want to change the base?
Conversation
@shial4 yes, i did add support for appearance actions. I think I'll include some explicit tests for those as well. |
Yes, I've tested it. We miss the private lifecycle methods yet. _onUpdate, _onMount etc |
Okay, so in checking out what i thought should result in reordering I noticed I misunderstood the effects of There are a few open questions, but imo it would be okay to merge this and leave those as future work. In particular:
One thing I did not really look into yet is if this messed up the dynamic layout stuff in any way. |
@ahti To facilitate tracking and further discussion on these points you've mentioned, shall we create separate tickets or issues for them? This will help us keep a structured record of the tasks and prioritize them accordingly |
I could not come up with a way the bits of code in For the other two, I think creating issues after this PR is merged makes sense. I've also run the other tests, including for layout and those look good as well (I had some failures where the rendered image had a color that was a tiny bit off, maybe an Edge update or sth like that). |
Do you guys think, we should address in this PR private lifecycle methods such as |
|
I'm actually not sure, but we use it in OnCHangeModifier I've added in gestures PR, as it nicely delivers functionality to capture old & new value I can, see it being called inside |
Okay so I've had a play with The current behaviour with the stack reconciler seems to be this: The reconciler recurses into all subviews of views that had a change in state etc. Any SwiftUI otoh doesn't seem to continue reconciliation into views that compare equal to what was there before, and doesn't call For your particular use case, although I'm not really familiar with the details, it feels like there must be some more precise way to keep coordinate spaces up to date, maybe by using a Either way, I think there's potential for discussion here, and I think it would be best to not block this PR on that discussion. |
I think this is ready for review now @carson-katri. |
in this case, I will revisit and change impl for modifier I've added din my PR to not used it. |
good job on the PR @ahti |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Good stuff, thank you for contributing!
sorry to disturb - trying to get a sense for where to start using this project and this fiber work looks very promising; is this a good PR to start using, or is there other work it's waiting on or something like that? thanks. would love to better understand also how to contribute back in terms of latest project direction |
Adresses #523
I'll leave some more detailed comments/open questions on specific parts of the code in the next few days, but in short, I had a look at the React reconciler source and adopted some of their approaches.
This differs from #525 mainly in the following: Instead of having the reconcile pass try to work out what the tree reducer did, the tree reducer result now contains output variables that specify whether a node was inserted or updated with new content, as well as any children from the previous state that were not reused.
In making these changes, I also started introducing structural/explicit view identity, but I'll have to add another test and see if reordering etc works as expected (I suspect it doesn't rn).
I also removed the
replace
mutation because it can be expressed by a removal and insertion, and as far as I could see, the React reconciler doesn't have one either.