Skip to content

Vein 1.3.0 Release

Latest

Choose a tag to compare

@MiaKoring MiaKoring released this 18 Nov 11:59
Immutable release. Only release title and notes can be modified.
4f03577

New Features

Derivable ULIDs

You can now derive a new ULID from an existing ULID using ulid.deriveNew().
On the same ULID deriveNew() will always return the same ULID. The new ULID’s timestamp is almost the same as the parent ULID’s, so the new one will sort near the parent. The purpose of this is being able to predictably migrate to a new schema version where re-using the old ulids isn’t enough.

For example if you want to split up a model User so ContactInformation is a relationship instead of being part of User, you can use this to derive a ULID for the ContactInformation instance from the User’s ULID.

This will especially become important when syncing in the future.

Stale Reference Cleanup

ManagedObjectContext/checkRelationshipIntegrity(_:) recieved a new parameter to opt in to cleaning up stale relationship references while checking the integrity. Stale references can be created by having a relationship without inverse (Vein’s relationships are designed to be bidirectional) and deleting the child without removing it from the parent for example (or bugs from the past).

SwiftDataCompat trait

The new SwiftDataCompat trait changes the environment paths used by VeinSwiftUI so they don’t collide with SwiftData.

Added some more typed SQLite errors

Some potentially common errors like SQLITE_BUSY were added to ManagedObjectContextError

Bugfixes

Changes to a child model didn’t trigger the change notification on the parent for VeinSCUI. This has been fixed. The issue likely was that the default implementation didn’t provide a stable Publisher instance. @Model now generates it as part of the expansion.

Breaking changes

Reinsertion of a deleted model now throws an error. Once a model has been removed it’s impossible to guarantee integrity. It shouldn’t have been possible to re insert them in the first place. I apologize for the inconvenience.

Other Code changes

ManagedObjectContext/batchDelete(_:) is now deprecated and will be removed in 2.0. I recommend switching to a loop with ManagedObjectContext/delete(_:).

Other Changes

The concurrency description and recommendations were updated. Please make sure to read the new section. Most important change: Vein models are thread-safe for reads and value field writes. Concurrent writes to relationships are not yet recommended.

Of course new tests covering the new features as well as expanding the coverage of existing code were added. There were no new discoveries of bugs.

Security

There are no security related changes and no known vulnerabilities.

New backup admin

To ensure there is someone with the necessary permissions to maintain this repository, or name a new maintainer, in case the current maintainer is unavailable, @stackotter from the @moreSwift org (making SwiftCrossUI and Swift Bundler) was added as a backup admin. He is not involved in day-to-day maintenance of this package, please don’t contact him with Vein related issues.

What's Changed

Full Changelog: 1.2.0...1.3.0