Add ViewRenderer and ViewCache API support#848
Conversation
🤖 Augment PR SummarySummary: This PR expands OpenSwiftUI’s DisplayList rendering pipeline with initial support for SwiftUI 6.5.4’s Changes:
Technical Notes: Async rendering paths rely on QuartzCore private SPI ( 🤖 Was this summary useful? React with 👍 or 👎 |
| // CoreGraphicsShims.swift | ||
| // OpenSwiftUICore | ||
|
|
||
| #if !canImport(CoreGraphics) |
There was a problem hiding this comment.
Sources/OpenSwiftUICore/Util/CoreGraphicsShims.swift:5 This shim defines CAPresentationModifier* types, but it’s conditionally compiled with !canImport(CoreGraphics) rather than !canImport(QuartzCore), so platforms that have CoreGraphics shims but no QuartzCore could still fail to build due to missing CAPresentationModifier symbols.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| return true | ||
| case (.content, .content): | ||
| return true | ||
| case (.effect, .effect): |
There was a problem hiding this comment.
Sources/OpenSwiftUICore/Render/DisplayList/DisplayList.swift:493 matchesTopLevelStructure(of:) treats any .effect pair as structurally identical, which can let ViewUpdater.updateAsync proceed even if the effect kind changed (potentially applying async updates against an incompatible structure).
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| // Flush modified presentation modifier groups | ||
| for groupID in modifiedGroups { | ||
| let group = unsafeBitCast(groupID, to: CAPresentationModifierGroup.self) | ||
| group.flushWithTransaction() |
There was a problem hiding this comment.
Sources/OpenSwiftUICore/Render/DisplayList/DisplayListViewCache.swift:193 commitAsyncValues may run off the main thread (it calls CATransaction.activateBackground(true)), but it flushes modifier groups via flushWithTransaction(), which your SPI header documents as main-thread-only; this could lead to CA assertions/crashes in async rendering.
Severity: high
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #848 +/- ##
==========================================
- Coverage 26.85% 26.55% -0.31%
==========================================
Files 671 671
Lines 43470 44009 +539
==========================================
+ Hits 11675 11686 +11
- Misses 31795 32323 +528 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
CAPresentationModifier and CAPresentationModifierGroup are QuartzCore types, not CoreGraphics — fix the compile guard from !canImport(CoreGraphics) to !canImport(QuartzCore) and rename the file accordingly.
No description provided.