Changelog History
Page 6
-
v0.12.1 Changes
April 01, 2019๐ โ ๏ธ Hotfix
[iOS] Fix runtime crash when built with Xcode 10.2 (Swift 5 runtime).
โ ๏ธ Note: You need to upgrade to React Native 0.59.3 for this to work. If you can't upgrade React Native yet, either stick to Xcode 10.1 or manually apply this patch: https://github.com/Nozbe/WatermelonDB/pull/302/commits/aa4e08ad0fa55f434da2a94407c51fc5ff18e506
๐ Changes
- ๐ [Sync] Adds basic sync logging capability to Sync. Pass an empty object to
synchronize()
to populate it with diagnostic information:js const log = {} await synchronize({ database, log, ...}) console.log(log.startedAt)
See Sync documentation for more details.
-
v0.12.0 Changes
March 18, 2019โ Added
- [Hooks] new
useDatabase
hook for consuming the Database Context:js import { useDatabase } from '@nozbe/watermelondb/hooks'; const Component = () => { const database = useDatabase(); }
- [TypeScript] added
.d.ts
files. Please note: TypeScript definitions are currently incomplete and should be used as a guide only. PRs for improvements would be greatly appreciated!
๐ Performance
- ๐ Improved UI performance by consolidating multiple observation emissions into a single per-collection batch emission when doing batch changes
- [Hooks] new
-
v0.11.0 Changes
March 12, 2019๐ฅ Breaking
- โ ๏ธ Potentially BREAKING fix: a
@date
field now returns a Jan 1, 1970 date instead ofnull
if the field's raw value is0
. This is considered a bug fix, since it's unexpected to receive anull
from a getter of a field whose column schema doesn't sayisOptional: true
. However, if you relied on this behavior, this might be a breaking change. - โ ๏ธ BREAKING:
Database.unsafeResetDatabase()
now requires that you run it inside an Action
๐ Bug fixes
- ๐ [Sync] Fixed an issue where synchronization would continue running despite
unsafeResetDatabase
being called - [Android] fix compile error for kotlin 1.3+
Other changes
- Actions are now aborted when
unsafeResetDatabase()
is called, making reseting database a little bit safer - โก๏ธ Updated demo dependencies
- ๐ LokiJS is now a dependency of WatermelonDB (although it's only required for use on the web)
- ๐ [Android] removed unused test class
- โก๏ธ [Android] updated ktlint to
0.30.0
- โ ๏ธ Potentially BREAKING fix: a
-
v0.10.1 Changes
February 12, 2019๐ Changes
- [Android] Changed
compile
toimplementation
in Library Gradle file- โ ๏ธ might break build if you are using Android Gradle Plugin <3.X
- โก๏ธ Updated
peerDependency
react-native
to0.57.0
- ๐ [Sync] Added
hasUnsyncedChanges()
helper method - ๐ [Sync] Improved documentation for backends that can't distinguish between
created
andupdated
records - ๐ [Sync] Improved diagnostics / protection against edge cases
- [iOS] Add missing
header search path
to support ejected expo project. - [Android] Fix crash on android < 5.0
- [iOS]
SQLiteAdapter
'sdbName
path now allows you to pass an absolute path to a file, instead of a name - ๐ [Web] Add adaptive layout for demo example with smooth scrolling for iOS
- [Android] Changed
-
v0.10.0 Changes
January 18, 2019๐ฅ Breaking
- ๐ฅ BREAKING: Table column
last_modified
is no longer automatically added to all database tables. If you don't use this column (e.g. in your custom sync code), you don't have to do anything. If you do, manually add this column to all table definitions in your Schema:{ name: 'last_modified', type: 'number', isOptional: true }
Don't bump schema version or write a migration for this.
๐ New
- Actions API.
This was actually released in 0.8.0 but is now documented in [CRUD.md](./docs/CRUD.md) and [Actions.md](./docs/Actions.md). With Actions enabled, all create/update/delete/batch calls must be wrapped in an Action.
To use Actions, call
await database.action(async () => { /* perform writes here */ }
, and in Model instance methods, you can just decorate the whole method with@action
.This is necessary for Watermelon Sync, and also to enable greater safety and consistency.
To enable actions, add
actionsEnabled: true
tonew Database({ ... })
. In a future release this will be enabled by default, and later, made mandatory.See documentation for more details.
- ๐ Watermelon Sync Adapter (Experimental)
Added
synchronize()
function that allows you to easily add full synchronization capabilities to your Watermelon app. You only need to provide two fetch calls to your remote server that conforms to Watermelon synchronization protocol, and all the client-side processing (applying remote changes, resolving conflicts, finding local changes, and marking them as synced) is done by Watermelon.See documentation for more details.
- ๐ Support caching for non-global IDs at Native level
- ๐ฅ BREAKING: Table column
-
v0.9.0 Changes
November 23, 2018๐ New
- โ Added
Q.like
- you can now make queries similar to SQLLIKE
- โ Added
-
v0.8.0 Changes
November 16, 2018๐ New
- โ Added
DatabaseProvider
andwithDatabase
Higher-Order Component to reduce prop drilling - โ Added experimental Actions API. This will be documented in a future release.
๐ Fixes
- ๐ Fixes crash on older Android React Native targets without
jsc-android
installed
- โ Added
-
v0.7.0 Changes
October 31, 2018๐ Deprecations
- ๐ [Schema] Column type 'bool' is deprecated โ change to 'boolean'
๐ New
- โ Added support for Schema Migrations. See documentation for more details.
- โ Added fundaments for integration of Danger with Jest
๐ Changes
- ๐ Fixed "dependency cycle" warning
- ๐ [SQLite] Fixed rare cases where database could be left in an unusable state (added missing transaction)
- ๐ [Flow] Fixes
oneOf()
typing and some other variance errors - [React Native] App should launch a little faster, because schema is only compiled on demand now
- ๐ Fixed typos in README.md
- โก๏ธ Updated Flow to 0.85
-
v0.6.2 Changes
October 04, 2018๐ Deprecations
- โก๏ธ The
@nozbe/watermelondb/babel/cjs
/@nozbe/watermelondb/babel/esm
Babel plugin that ships with Watermelon is deprecated and no longer necessary. Delete it from your Babel config as it will be removed in a future update
๐จ Refactoring
- โ Removed dependency on
async
(Web Worker should be ~30KB smaller) - ๐จ Refactored
Collection
andsimpleObserver
for getting changes in an array and also adds CollectionChangeTypes for differentiation between different changes - โก๏ธ Updated dependencies
- ๐ท Simplified build system by using relative imports
- ๐ Simplified build package by outputting CJS-only files
- โก๏ธ The
-
v0.6.1 Changes
September 20, 2018โ Added
- โ Added iOS and Android integration tests and lint checks to TravisCI
๐ Changed
- ๐ Changed Flow setup for apps using Watermelon - see docs/Advanced/Flow.md
- ๐ Improved documentation, and demo code
- โก๏ธ Updated dependencies
๐ Fixed
- โ Add quotes to all names in sql queries to allow keywords as table or column names
- ๐ Fixed running model tests in apps with Watermelon in the loop
- ๐ Fixed Flow when using Watermelon in apps