-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
Add support for preferences, @StateObject
, @EnvironmentObject
, and custom DynamicProperty
types
#501
Conversation
|
@@ -22,7 +22,7 @@ extension FiberReconciler.Fiber: CustomDebugStringConvertible { | |||
{ | |||
return "Text(\"\(text.storage.rawText)\")" | |||
} | |||
return typeInfo?.name ?? "Unknown" | |||
return "\(typeInfo?.name ?? "Unknown") \(ObjectIdentifier(self).debugDescription.split(separator: "(")[1].split(separator: ")")[0])" |
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.
Can we guarantee that ObjectIdentifier(self).debugDescription.split(separator: "(")
will always return at least two elements? Maybe we need to guard for that?
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.
I just removed this from the description, since I was just using it to debug something. If you think I should keep the memory address though, using unsafeBitCast
may be a better method?
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.
Not unless you found seeing memory addresses particularly useful during development 🙂
Just had a super quick look, will review the rest of it by the end of this week. |
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.
Overall seems legit, just some nits with requests for doc comments.
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.
Seems legit, thanks!
The following are now supported in the Fiber reconciler:
ReconcilePass
always start at the root of the view hierarchy (not just when dynamic layout is enabled), but it still only looks for changes once it reaches the first changed fiber.@StateObject
/@ObservedObject
@EnvironmentObject
@AppStorage
/@SceneStorage
DynamicProperty
typesA new internal API for testing the
FiberReconciler
usingTestFiberRenderer
was also added when creating tests for the new dynamic properties: