Skip to content

Modernize demo apps#72

Merged
mbrandonw merged 21 commits into
mainfrom
modernize
Jun 5, 2025
Merged

Modernize demo apps#72
mbrandonw merged 21 commits into
mainfrom
modernize

Conversation

@mbrandonw
Copy link
Copy Markdown
Member

@mbrandonw mbrandonw commented Jun 1, 2025

We have a lot of big things coming to this library soon, so I wanted to take some time to modernize some of the demos a bit. Some of the things we have done:

  • Upgraded IDs of tables to be UUIDs instead of auto incrementing integers. The former plays better with synchronizing across devices where it is quite important to have globally unique IDs.
  • Moved logic of complex features (reminders lists, reminders detail and search) to their own @Observable model. This helped a great deal with animation glitches, testing and the views were becoming a nightmare to work with.
  • Wrote some tests for the gnarly logic in a few features.
  • Don't run any code in the entry point of the app when running in a preview context. Xcode is not capable of making a database connection to a file on disk during previews.
  • Test databases are now persisted to disk in the temporary directory instead of run in-memory. This creates a more realistic environment for tests to run in a production environment.
  • Changed database seeding so that it happens automatically in previews and provided an option in-app for seeding from the simulator. Tests also have their own seeding function so that seeds in previews/simulators are not conflated with previews.
  • Controlled the database date functions so that we can better test queries.

@mbrandonw mbrandonw requested a review from stephencelis June 1, 2025 02:30
Comment thread Examples/Reminders/Schema.swift Outdated
Comment thread Examples/Reminders/SearchReminders.swift Outdated
Comment thread Examples/SyncUps/Schema.swift
Comment thread Examples/SyncUps/SyncUpDetail.swift Outdated
Comment thread Examples/SyncUps/SyncUpDetail.swift Outdated
mbrandonw and others added 7 commits June 2, 2025 14:46
Co-authored-by: Stephen Celis <stephen@stephencelis.com>
Co-authored-by: Stephen Celis <stephen@stephencelis.com>
@mbrandonw mbrandonw merged commit 06cd9e3 into main Jun 5, 2025
6 checks passed
@mbrandonw mbrandonw deleted the modernize branch June 5, 2025 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants