Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic preview updating paused #42

Closed
denizdogan opened this issue Mar 21, 2022 · 4 comments
Closed

Automatic preview updating paused #42

denizdogan opened this issue Mar 21, 2022 · 4 comments
Assignees

Comments

@denizdogan
Copy link

Unless you run the Shark script with "For install builds only", the automatic preview of SwiftUI in Xcode keeps popping up "Automatic preview updating paused". I'm guessing this is because it detects changes to the relevant source code.

@mickeyl
Copy link
Collaborator

mickeyl commented Mar 21, 2022

Indeed. Shark breaks SwiftUI previews unless you've checked the "For install builds only" checkbox.

This relates to #25.

Off the top of my head, there are two approaches:

1.) Let Xcode handle this by adding the necessary dependencies (Storyboard files, Asset catalogues, and Localizable.strings) to the Input files and adding the output file – perhaps even add a command line Switch where Shark emits this list.

2.) Let Shark handle this by saving the timestamps and/or hashes of its (computed) input files and not generating any new output if nothing has changed.

My gut feeling is that 2.) might be the better way. What do you think?

@denizdogan
Copy link
Author

@mickeyl I would agree that 2) seems like a more suitable solution! I would probably go for hashes myself, unless that proves too computationally expensive.

@mickeyl mickeyl self-assigned this Mar 21, 2022
@mickeyl
Copy link
Collaborator

mickeyl commented Mar 22, 2022

@denizdogan This is the most simple solution I could come up with. Instead of caching anything or computing hashes, let's just compare the existing output with the new output. Since we're typically not dealing with megabyte-long files, I assume this to be a workable solution.

Please confirm whether this fixes it for you.

@denizdogan
Copy link
Author

@mickeyl The issue seems to have been resolved! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants