Skip to content

Commit 9afe878

Browse files
committed
Update OpenGraph dependency
1 parent 0ae679f commit 9afe878

File tree

9 files changed

+17
-17
lines changed

9 files changed

+17
-17
lines changed

Package.resolved

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"location" : "https://github.com/OpenSwiftUIProject/DarwinPrivateFrameworks.git",
88
"state" : {
99
"branch" : "main",
10-
"revision" : "5627dacbbde44c8d3ea7b34f5d91b44839178e15"
10+
"revision" : "5a0e8d14d6fbe728951ece9ded2c6f2a6708f5a6"
1111
}
1212
},
1313
{
@@ -25,7 +25,7 @@
2525
"location" : "https://github.com/OpenSwiftUIProject/OpenGraph",
2626
"state" : {
2727
"branch" : "main",
28-
"revision" : "c1be687dddce061a6895cf6f7b6c22f79ca5aec4"
28+
"revision" : "4aeda45233cb3d8623d819e98aeca4b86a8a3a7d"
2929
}
3030
},
3131
{

Sources/OpenSwiftUICore/Data/DynamicProperty/DynamicProperty.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -166,18 +166,18 @@ package struct DynamicPropertyCache {
166166
return fields
167167
}
168168
let fields: Fields
169-
let typeID = OGTypeID(type)
169+
let typeID = Metadata(type)
170170
switch typeID.kind {
171171
case .enum, .optional:
172172
var taggedFields: [TaggedFields] = []
173173
_ = typeID.forEachField(options: [._2, ._4]) { name, offset, fieldType in
174174
var fields: [Field] = []
175-
let tupleType = OGTupleType(fieldType)
175+
let tupleType = TupleType(fieldType)
176176
for index in tupleType.indices {
177177
guard let dynamicPropertyType = tupleType.type(at: index) as? DynamicProperty.Type else {
178178
break
179179
}
180-
let offset = tupleType.offset(at: index)
180+
let offset = tupleType.elementOffset(at: index)
181181
let field = Field(type: dynamicPropertyType, offset: offset, name: name)
182182
fields.append(field)
183183
}

Sources/OpenSwiftUICore/Modifier/ViewModifier/CustomViewModifier.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ extension ViewModifier {
5454
inputs: inout _GraphInputs,
5555
fields: DynamicPropertyCache.Fields
5656
) -> (_GraphValue<Body>, _DynamicPropertyBuffer?) {
57-
let kind = OGTypeID(Self.self).kind
57+
let kind = Metadata(Self.self).kind
5858
switch kind {
5959
case .struct, .enum, .optional, .tuple:
6060
let accessor = ModifierBodyAccessor<Self>()

Sources/OpenSwiftUICore/Runtime/ProtocolDescriptor.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ protocol TupleDescriptor: ProtocolDescriptor {
2121
}
2222

2323
extension TupleDescriptor {
24-
static func tupleDescription(_ type: OGTupleType) -> TupleTypeDescription<Self> {
24+
static func tupleDescription(_ type: TupleType) -> TupleTypeDescription<Self> {
2525
let id = ObjectIdentifier(type.type)
2626
if let cache = typeCache[id] {
2727
return cache
@@ -38,7 +38,7 @@ extension TupleDescriptor {
3838
struct TupleTypeDescription<PD: ProtocolDescriptor> {
3939
let contentTypes: [(Int, TypeConformance<PD>)]
4040

41-
init(_ tupleType: OGTupleType) {
41+
init(_ tupleType: TupleType) {
4242
contentTypes = tupleType.indices.compactMap { index in
4343
let type = tupleType.type(at: index)
4444
guard let comformance = TypeConformance<PD>(type) else {

Sources/OpenSwiftUICore/Util/Tracing.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ enum Tracing {
2828

2929
static func libraryName(defining type: Any.Type) -> String {
3030
let unknown = "ModuleUnknown"
31-
guard let nominalDescriptor = OGTypeID(type).nominalDescriptor else {
31+
guard let nominalDescriptor = Metadata(type).nominalDescriptor else {
3232
return unknown
3333
}
3434
if let cachedName = moduleLookupCache.value[nominalDescriptor] {
@@ -51,7 +51,7 @@ enum Tracing {
5151
}
5252

5353
static func nominalTypeName(_ type: Any.Type) -> String {
54-
OGTypeID(type).description
54+
Metadata(type).description
5555
}
5656
}
5757

@@ -62,7 +62,7 @@ package func traceBody<Body>(_ v: any Any.Type, body: () -> Body) -> Body {
6262
guard kdebug_is_enabled(UInt32(OSSignpostType.event.rawValue) & 0xF8 | 0x1411_0014) else {
6363
return body()
6464
}
65-
// TODO: OGTypeID(type).description, Tracing.libraryName(defining: v)
65+
// TODO: Metadata(type).description, Tracing.libraryName(defining: v)
6666
return body()
6767
#else
6868
body()

Sources/OpenSwiftUICore/View/CustomView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ extension View {
4646
inputs: inout _GraphInputs,
4747
fields: DynamicPropertyCache.Fields
4848
) -> (_GraphValue<Body>, _DynamicPropertyBuffer?) {
49-
let kind = OGTypeID(Self.self).kind
49+
let kind = Metadata(Self.self).kind
5050
switch kind {
5151
case .struct, .enum, .optional, .tuple:
5252
let accessor = ViewBodyAccessor<Self>()

Sources/OpenSwiftUICore/View/Debug/ChangedBodyProperty.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ package func changedBodyProperties<Body>(of type: Body.Type) -> [String] {
7272

7373
package func printChangedBodyProperties<Body>(of type: Body.Type) {
7474
let properties = changedBodyProperties(of: type)
75-
var result = OGTypeID(type).description
75+
var result = Metadata(type).description
7676
if properties.isEmpty {
7777
result.append(": unchanged.")
7878
} else {
@@ -106,7 +106,7 @@ extension OSLog {
106106

107107
package func logChangedBodyProperties<Body>(of type: Body.Type) {
108108
let properties = changedBodyProperties(of: type)
109-
let result = OGTypeID(type).description
109+
let result = Metadata(type).description
110110
if properties.isEmpty {
111111
#if OPENSWIFTUI_SWIFT_LOG
112112
Logger.changeBodyPropertiesLogger.info("\(result): unchanged.")

Sources/OpenSwiftUICore/View/Debug/ViewDebug.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ extension _ViewDebug.Data {
395395
init(type anyType: Any.Type) {
396396
self.name = nil
397397
self.type = String(reflecting: anyType)
398-
self.readableType = OGTypeID(anyType).description
398+
self.readableType = Metadata(anyType).description
399399
self.flags = [
400400
conformsToProtocol(anyType, _OpenSwiftUI_viewProtocolDescriptor()) ? .view : [],
401401
conformsToProtocol(anyType, _OpenSwiftUI_viewModifierProtocolDescriptor()) ? .viewModifier : [],
@@ -408,7 +408,7 @@ extension _ViewDebug.Data {
408408
self.name = label
409409
let anyType = Swift.type(of: value)
410410
self.type = String(reflecting: anyType)
411-
self.readableType = OGTypeID(anyType).description
411+
self.readableType = Metadata(anyType).description
412412
self.flags = [
413413
conformsToProtocol(anyType, _OpenSwiftUI_viewProtocolDescriptor()) ? .view : [],
414414
conformsToProtocol(anyType, _OpenSwiftUI_viewModifierProtocolDescriptor()) ? .viewModifier : [],

Tests/OpenSwiftUICoreTests/Data/DynamicProperty/DynamicPropertyCacheTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class DynamicPropertyCacheTests: XCTestCase {
2121
print(d)
2222

2323

24-
let t = OGTypeID(DynamicPropertyCache.Fields?.self)
24+
let t = Metadata(DynamicPropertyCache.Fields?.self)
2525
let result = t.forEachField(options: ._4) { name, index, type in
2626
let s = String(cString: name)
2727
print("\(s) \(index) \(type)")

0 commit comments

Comments
 (0)