-
Notifications
You must be signed in to change notification settings - Fork 73
Fix RemindersList preview so lists will appear and other preview matters #321
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
base: main
Are you sure you want to change the base?
Conversation
… previews so lists will appear. And do not seed sample data to preserve the SeedSampleData UI.
#Conflicts: # Examples/Reminders/Schema.swift # Examples/RemindersTests/Internal.swift
|
I saw in your last couple of episodes that you seem to prefer making an explicit call to seed the data from preview rather than letting |
|
Hi @jcmourey, yeah actually that would be great. Thanks! |
|
Running into a really odd problem. Preview code gets called repeatedly unnecessarily, but that's probably a Xcode problem and is normally not an issue. When the data is seeded from within HOWEVER, when the data is seeded from the preview set, the database strangely doesn't get reset leading to conflicts on inserting tags (the only table without a VERSION 1 However, the problem goes away if I do this instead: VERSION 2 Additionally, this problem only occurs inside I've been investigating, but I don't understand why VERSION 2 would behave differently from VERSION 1. Does this look familiar to you? |
|
I worked around the problem using lazy evaluation of dependencies in preview. It's also faster because the database doesn't keep getting recreated 5-10 times for each preview. Doesn't explain away the issue in my previous comment which is somewhat disturbing but at least it works. |
…h preview as appropriate. Moved to lazy initializers in previews as needed to avoid unnecessary multiple re-creations of the database that sometimes lead to seeding conflicts.
|
Just ran some performance benchmark on the
Total time = 690ms
Total time = 320ms Development platform: MacStudio M4 Max 128GB RAM, macOS Tahoe, Xcode 26.2 |
…he type name since it's not an actual migration). Only create the table if it wasn't already created
And do not seed sample data to preserve the SeedSampleData UI.