-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update GraphHost inheritable methods * Update graphInvalidation implementation * Update GraphHost implementation * Add currentHost * Update OpenGraph depedency * Update GraphHost * Fix isUpdateing setter compile issue * Add flushTransactions and continueTransaction * Update missing GraphHost interface * Fix Linux platform build issue
- Loading branch information
Showing
15 changed files
with
451 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/zsh | ||
|
||
# A `realpath` alternative using the default C implementation. | ||
filepath() { | ||
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" | ||
} | ||
|
||
OPENSWIFTUI_ROOT="$(dirname $(dirname $(filepath $0)))" | ||
|
||
cd $OPENSWIFTUI_ROOT | ||
|
||
export OPENSWIFTUI_SWIFT_TESTING=0 | ||
export OPENGRAPH_SWIFT_TESTING=0 | ||
swift build |
14 changes: 14 additions & 0 deletions
14
Sources/OpenSwiftUI/Core/Attribute/InvalidatableAttribute.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// InvalidatableAttribute.swift | ||
// OpenSwiftUI | ||
// | ||
// Audited for RELEASE_2021 | ||
// Status: WIP | ||
|
||
internal import OpenGraphShims | ||
|
||
// TODO: PlatformViewChild in _A513612C07DFA438E70B9FA90719B40D | ||
|
||
protocol InvalidatableAttribute: _AttributeBody { | ||
static func willInvalidate(attribute: OGAttribute) | ||
} |
13 changes: 13 additions & 0 deletions
13
Sources/OpenSwiftUI/Core/Attribute/RemovableAttribute.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// RemovableAttribute.swift | ||
// OpenSwiftUI | ||
// | ||
// Audited for RELEASE_2021 | ||
// Status: WIP | ||
|
||
internal import OpenGraphShims | ||
|
||
protocol RemovableAttribute: _AttributeBody { | ||
static func willRemove(attribute: OGAttribute) | ||
static func didReinsert(attribute: OGAttribute) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
internal import OpenGraphShims | ||
|
||
extension OGGraph { | ||
|
||
} |
38 changes: 38 additions & 0 deletions
38
Sources/OpenSwiftUI/Core/Graph/Extensions/OGSubgraph.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
internal import OpenGraphShims | ||
|
||
extension OGSubgraph { | ||
func willRemove() { | ||
#if canImport(Darwin) | ||
OGSubgraph.apply(self, flags: .removable) { attribute in | ||
let type = attribute._bodyType | ||
if let removableType = type as? RemovableAttribute.Type { | ||
removableType.willRemove(attribute: attribute) | ||
} | ||
} | ||
#endif | ||
} | ||
|
||
func didReinsert() { | ||
#if canImport(Darwin) | ||
OGSubgraph.apply(self, flags: .removable) { attribute in | ||
let type = attribute._bodyType | ||
if let removableType = type as? RemovableAttribute.Type { | ||
removableType.didReinsert(attribute: attribute) | ||
} | ||
} | ||
#endif | ||
} | ||
|
||
func willInvalidate(isInserted: Bool) { | ||
#if canImport(Darwin) | ||
OGSubgraph.apply(self, flags: isInserted ? [.removable, .invalidatable] : [.invalidatable]) { attribute in | ||
let type = attribute._bodyType | ||
if let invalidatableType = type as? InvalidatableAttribute.Type { | ||
invalidatableType.willInvalidate(attribute: attribute) | ||
} else if isInserted, let removableType = type as? RemovableAttribute.Type { | ||
removableType.willRemove(attribute: attribute) | ||
} | ||
} | ||
#endif | ||
} | ||
} |
Oops, something went wrong.