[Feature] Add Xcode Preview support for OpenSwiftUI#829
Merged
Conversation
🤖 Augment PR SummarySummary: Fixes Xcode Preview rendering for OpenSwiftUI by avoiding a Preview-thunk wait that never unblocks due to SwiftUI’s two-level namespace binding. Changes:
🤖 Was this summary useful? React with 👍 or 👎 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #829 +/- ##
===========================================
+ Coverage 13.83% 27.17% +13.33%
===========================================
Files 630 667 +37
Lines 38173 42960 +4787
===========================================
+ Hits 5283 11675 +6392
+ Misses 32890 31285 -1605 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
PreviewsInjection.framework calls SwiftUI.__previewThunksHaveFinishedLoading() via a library-specific GOT binding (two-level namespace) after loading preview dylibs. OpenSwiftUI's version is never called since the binding targets SwiftUI specifically. Disable the blocking gate and implement the full unblocking logic for when OpenSwiftUI adds its own preview thunk system in the future.
edc5aa3 to
503c3b8
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
waitingForPreviewThunksblockingPreviewsInjection.frameworkcalls__previewThunksHaveFinishedLoading()via a two-level namespace binding targeting SwiftUI, so OpenSwiftUI's version is never invoked — causing graph instantiation to block indefinitely__previewThunksHaveFinishedLoading()to properly unblock graph hostsPreviewShims.swifthelper to bridge OpenSwiftUI views into#Previewvia hosting controllers