WatermelonDB v0.21 Release Notes

Release Date: 2021-03-24 // over 1 year ago

    • โš  [LokiJS] useWebWorker and useIncrementalIndexedDB options are now required (previously, skipping them would only trigger a warning)

    ๐Ÿ†• New features

    • โšก๏ธ [Model] Model.update method now returns updated record
    • ๐ŸŒฒ [adapters] onSetUpError: Error => void option is added to both SQLiteAdapter and LokiJSAdapter. Supply this option to catch initialization errors and offer the user to reload or log out
    • [LokiJS] new extraLokiOptions and extraIncrementalIDBOptions options
    • ๐Ÿ‘ [Android] Autolinking is now supported.
      • If You upgrade to <= v0.21.0 AND are on a version of React Native which supports Autolinking, you will need to remove the config manually linking WatermelonDB.
      • You can resolve this issue by REMOVING the lines of config from your project which are added in the Manual Install ONLY section of the Android Install docs.

    ๐ŸŽ Performance

    • ๐ŸŽ [LokiJS] Improved performance of launching the app

    ๐Ÿ”„ Changes

    • ๐Ÿ—„ [LokiJS] useWebWorker: true and useIncrementalIndexedDB: false options are now deprecated. If you rely on these features, please file an issue!
    • ๐Ÿ”€ [Sync] Optional log passed to sync now has more helpful diagnostic information
    • ๐Ÿ‘€ [Sync] Open-sourced a simple SyncLogger you can optionally use. See docs for more info.
    • ๐Ÿ”€ [SQLiteAdapter] synchronous:true option is now deprecated and will be replaced with experimentalUseJSI: true in the future. Please test if your app compiles and works well with experimentalUseJSI: true, and if not - file an issue!
    • 0๏ธโƒฃ [LokiJS] Changed default autosave interval from 250 to 500ms
    • [Typescript] Add experimentalNestedJoin definition and unsafeSqlExpr clause

    ๐Ÿ›  Fixes

    • ๐Ÿ›  [LokiJS] Fixed a case where IndexedDB could get corrupted over time
    • [Resilience] Added extra diagnostics for when you encounter the Record ID aa#bb was sent over the bridge, but it's not cached error and a recovery path (LokiJSAdapter-only). Please file an issue if you encounter this issue!
    • ๐Ÿ›  [Typescript] Fixed type on OnFunction to accept and in join
    • ๐Ÿ›  [Typescript] Fixed type database#batch(records)'s argument records to accept mixed types


    • โž• Added an experimental mode where a broken database state is detected, further mutations prevented, and the user notified