-
-
Notifications
You must be signed in to change notification settings - Fork 112
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 @ObservedObject implementation #171
Conversation
This is a first attempt, still not hooked in the reconciler and requires a custom toolchain.
Generated by 🚫 Danger Swift against 3a41603 |
Sources/TokamakDOM/Shapes/Path.swift
Outdated
@@ -50,7 +50,7 @@ extension Path: ViewDeferredToRenderer { | |||
"rx": "\(roundedRect.cornerSize.width)", | |||
"ry": "\(roundedRect.style == .continuous ? roundedRect.cornerSize.width : roundedRect.cornerSize.height)", |
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.
- 🚫 Line should be 100 characters or less: currently 115 characters (
line_length
)
Generated by 🚫 Danger Swift against b9da18a |
Sources/TokamakDOM/Shapes/Path.swift
Outdated
@@ -50,7 +50,7 @@ extension Path: ViewDeferredToRenderer { | |||
"rx": "\(roundedRect.cornerSize.width)", | |||
"ry": "\(roundedRect.style == .continuous ? roundedRect.cornerSize.width : roundedRect.cornerSize.height)", |
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.
- 🚫 Line should be 100 characters or less: currently 115 characters (
line_length
)
What is left in OpenCombine for this to be working? |
In my current investigation, I'm not entirely convinced it's a problem in OpenCombine (at least not in its high-level code), this is either a problem in SwiftWasm runtime, or the way that COpenCombineHelpers processes runtime metadata when looking for the |
TWIMC, I'm currently looking at the type metadata docs, seems like both Runtime library and COpenCombineHelpers have problems particulalrly with classes metadata, even when classes aren't generic. These issues are reproducible only with SwiftWasm, I'm not sure if this is because of some 64-bit platform assumptions in their code, or due to some issue we have in SwiftWasm. Since the rest of the things in SwiftWasm work pretty well, at least to my knowledge, I think it's more about the runtime introspection code in those libraries, but it's not that easy to debug... |
That could be it, but I thought that both of those libraries work well on Linux, which doesn't have Objective-C interop 🤔 |
Given that swiftlang/swift#32374 was merged only recently, they might have changed metadata layout on non-Apple platforms recently as they don't need to maintain ABI stability on those platforms. This would explain why the Runtime test suite was passing back in March/April for me with old SwiftWasm snapshots... |
…bject # Conflicts: # Sources/TokamakDOM/Shapes/Path.swift
This no longer needs any custom or new toolchains, the original one works fine 🙂 |
@carson-katri @j-f1 after this one's merged I think I'm going to tag Tokamak 0.2.0 as is, so then |
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.
LGTM
Conflicts resolved now. |
This pulls a fork of OpenCombine that can be compiled with the same SwiftWasm snapshot we use in
main
.The only caveat is that this doesn't work for
ObservableObject
s that are subclasses of other classes with@Published
properties. This issue needs to be fixed in the Runtime library fork. Since this is a rare case, and fixing it wouldn't change this@ObservedObject
implementation, I think it's ready for review as is.