Realm Xamarin v10.18.0 Release Notes

Release Date: 2022-11-02 // over 1 year ago
  • โœจ Enhancements

    • Introduced Realm.SourceGenerator, a Source Generator that can generate Realm model classes. This is part of our ongoing effort to modernize the Realm library, and will allow to introduce certain language level features easier in the future. In order to use the source generation the model classes need to be declared implementing one of the base interfaces (IRealmObject, IEmbeddedObject or IAsymmetricObject) and be declared partial. For example:

      public partial class Person: IRealmObject
      {
        public int Age { get; set; }
      
        public string Name { get; set; }  
      
        public PhoneNumber Phone { get; set; }
      }
      

    public partial class PhoneNumber: IEmbeddedObject { public string Number { get; set; }

      public string Prefix { get; set; }  
    

    }

      The source generator will then take care of adding the full implementation for the interfaces. 
    
      Most of the time converting the "classic" Realm model classes (classes derived from `RealmObject`, `EmbeddedObject` or `AsymmetricObject`) to use the new source generation means just defining the class as partial and switching out the base class for the corresponding interface implementation.
      The classic Realm model definition will still be supported, but will be phased out in the future.
    
      Please note that the source generator is still in beta, so let us know if you experience any issue while using them. 
      Some additional notes:
      * `OnManaged` and `OnPropertyChanged` are now partial methods.
      * Inheritance is not supported, so the Realm models cannot derive from any other class.
      * Nested classes are not supported.
    
    ### ๐Ÿ›  Fixed
    * ๐Ÿ›  Fixed a NullReferenceException being thrown when subscribing to `PropertyChanged` notifications on a `Session` instance that is then garbage collected prior to unsubscribing. (PR [#3061](https://github.com/realm/realm-dotnet/pull/3061))
    * โœ‚ Removed bitcode support from the iOS binary as it's no longer accepted for App Store submissions. (Issue [#3059](https://github.com/realm/realm-dotnet/issues/3059))
    * ๐Ÿ›  Fixed returning the parent when accessing it on an `IEmbeddedObject`. (Issue [#2742](https://github.com/realm/realm-dotnet/issues/2742))
    * ๐ŸŽ Slightly increased performance and reduced allocations when creating an enumerator for frozen collections (Issue [#2815](https://github.com/realm/realm-dotnet/issues/2815)).
    
    ### Compatibility
    * Realm Studio: 11.0.0 or later.
    
    ### Internal
    * Using Core 12.9.0.
    * โž• Added workflow to automatically assign users to issues and PRs. (PR [#3069](https://github.com/realm/realm-dotnet/pull/3069))
    * โž• Added workflow to validate changelog has been updated. (PR [#3069](https://github.com/realm/realm-dotnet/pull/3069))
    

Previous changes from v10.17.0

  • โœจ Enhancements

    • โฌ†๏ธ Prioritize integration of local changes over remote changes - shorten the time users may have to wait when committing local changes. Stop storing downloaded changesets in history. (Core upgrade)
    • ๐ŸŽ Greatly improve the performance of sorting or distincting a Dictionary's keys or values. The most expensive operation is now performed O(log N) rather than O(N log N) times, and large Dictionaries can see upwards of 99% reduction in time to sort. (Core upgrade)
    • ๐Ÿš€ Seamlessly handle migrating an App Services application deployment model. (Core upgrade)

    ๐Ÿ›  Fixed

    • ๐Ÿ›  Fix a use-after-free when a sync session is closed and the app is destroyed at the same time. (Core upgrade)
    • ๐Ÿ›  Fixed a NullReferenceException occurring in RealmObjectBase's finalizer whenever an exception is thrown before the object gets initialized. (Issue #3045)

    Compatibility

    • Realm Studio: 11.0.0 or later.

    Internal

    • Using Core 12.9.0