Skip to content

Commit

Permalink
Add support for preferences, @StateObject, @EnvironmentObject, an…
Browse files Browse the repository at this point in the history
…d custom `DynamicProperty` types (#501)

* Pass preferences up the Fiber tree

* Working preferences (except for backgroundPreferenceValue)

* Initial StateObject support

* Fix layout caching bug

* Support StateObject/EnvironmentObject/custom DynamicProperty

* Add doc comments for bindProperties and updateDynamicProperties

* Use immediate scheduling in static HTML and test renderers

* Add preferences test

* Add state tests and improve testing API

* Attempt to fix tests

* Fix preference tests

* Attempt to fix tests when Dispatch is unavailable

* #if out on os(WASI)

* Add check for WASI to test

* Add check for WASI to TestViewProxy

* #if out of import Dispatch when os == WASI

* Remove all Dispatch code

* Remove address from debugDescription

* Move TestViewProxy to TokamakTestRenderer

* Add memory address to Fiber.debugDescription

* Fix copyright year

* Add several missing types to Core.swift

* Add missing LayoutValueKey to Core.swift

* Fix issues with view trait propagation

* Enable App/SceneStorage in DOMFiberRenderer

* Address review comments

* Revise preference implementation
  • Loading branch information
carson-katri committed Jul 5, 2022
1 parent 9d0e2fc commit 676760d
Show file tree
Hide file tree
Showing 24 changed files with 822 additions and 261 deletions.
Expand Up @@ -17,12 +17,13 @@

extension FiberReconciler.Fiber: CustomDebugStringConvertible {
public var debugDescription: String {
let memoryAddress = String(format: "%010p", unsafeBitCast(self, to: Int.self))
if case let .view(view, _) = content,
let text = view as? Text
{
return "Text(\"\(text.storage.rawText)\")"
return "Text(\"\(text.storage.rawText)\") (\(memoryAddress))"
}
return typeInfo?.name ?? "Unknown"
return "\(typeInfo?.name ?? "Unknown") (\(memoryAddress))"
}

private func flush(level: Int = 0) -> String {
Expand Down

0 comments on commit 676760d

Please sign in to comment.