Releases: realm/realm-js
2.16.0-rc.2
Enhancements
-
The authentication API has been completely revamped. (#2002)
- The following methods have been deprecated and will be removed at a next major version:
Realm.Sync.User.login
Realm.Sync.User.register
Realm.Sync.User.authenticate
Realm.Sync.User.registerWithProvider
Realm.Sync.User.adminUser
- A new
Realm.Sync.User.login
method has been added that accepts the server url and a credentials object. - A new class -
Realm.Sync.Credentials
has been added that contains factory methods to create credentials with all supported providers. - Here are some examples on how to transform your old code to use the new API:
Old New const user = await Realm.Sync.User.login(serverUrl, 'username', 'password');
const credentials = Realm.Sync.Credentials.usernamePassword('username', 'password');
const user = await Realm.Sync.User.login(serverUrl, credentials);
const jwtToken = 'acc3ssT0ken...';
const user = await Realm.Sync.User.registerWithProvider(serverUrl, 'jwt', jwtToken);
const jwtToken = 'acc3ssT0ken...';
const credentials = Realm.Sync.Credentials.jwt(jwtToken);
const user = await Realm.Sync.User.login(serverUrl, credentials);
const customToken = 'acc3ssT0ken...';
const userInfo = { someValue: true };
const user = await Realm.Sync.User.registerWithProvider(serverUrl, 'custom/fooauth', customToken, userInfo);
const customToken = 'acc3ssT0ken...';
const userInfo = { someValue: true };
const credentials = Realm.Sync.Credentials.custom('custom/fooauth', customToken, userInfo);
const user = await Realm.Sync.User.login(serverUrl, credentials);
- The following methods have been deprecated and will be removed at a next major version:
-
Exposed
Realm.Sync.User.serialize()
to create a persistable representation of a user instance, as well asRealm.Sync.User.deserialize()
to later inflate aUser
instance that can be used to connect to Realm Object Server and open synchronized Realms. (#1276) -
Added
Realm.Sync.Session.pause()
andRealm.Sync.Session.resume()
to allow controlling when to sync data. (#2014) -
Added support for
LIMIT
in queries to restrict the size of the results set. This is in particular useful for query-based synced Realms. An example of the syntax isage >= 20 LIMIT(2)
. (#2008)
Bug fixes
- Fixed the type definition for
User.authenticate()
. (#2000, since v2.2.0) - Added
Realm.Sync.Subscription.removeAllListeners()
to theSubscription
proxy class used when debugging a React Native app. (#474, since v2.3.2) - Fixed a memory corruption in
writeCopyTo()
when using encryption. This could be experienced as:Error: Unable to open a realm at path ...
. Thanks to @mandrigin! (#1748, since v2.3.4) - Fixed the type definitions for
Session.addConnectionNotification()
andSession.removeConnectionNotification()
. Thanks to @gabro! (#2003, since v2.15.0) - Removed a false negative warning when using
User.createConfiguration()
. (#1989, since v2.15.3) - Fixed a bug where
Realm.write()
crashed with segmentation fault when trying to insert a record without providing values for the properties that are optional in the schema. (#479, since v2.15.3)
Compatibility
- Realm Object Server: 3.0.0 or later
- File format: ver 7. (upgrades from previous formats automatically)
V1.11.0
Breaking changes
- None
Enhancements
- Added methods
Realm.beginTransaction()
,Realm.commitTransaction()
,Realm.cancelTransaction()
to manually control write transactions. - Added property
Realm.isInTransaction
which indicates if write transaction is in progress. - Added
shouldCompactOnLaunch
to configuration (#507). - Added
Realm.compact()
for manually compacting Realm files. - Added various methods for permission management (#1204).
Bug fixes
- None
v1.10.1
Bug fixes
Realm.openAsync
will no longer open the realm if a sync error has occured. Previously this resulted in the callback being invoked twice - once with an error and a second time - with the synchronously opened Realm.- Database adapters will no longer process the sync history of realm files that are not requested by the adapter configuration. Previously this would lead to crashes for realm files that contained schemas that don't define primary keys.
v1.10.0
Enhancements
- Added
Realm.prototype.empty
which is a property that indicates whether or not the realm has any objects in it.
Bug fixes
- Fix crash on Node.js when a listener callback throws an error.
The error will now be forwarded to Node's fatal error handling facilities. This means better error reporting,
the ability to debug such errors in a Node.js debugger, and proper invocation of theuncaughtError
event on theprocess
object.
v1.9.0
Enhancements
- Add support for iOS React Native 0.46. Thanks @ovr!
- Add support for Linking Objects (AKA Backlinks).
- Add support for retrieving user account information.
- Add optional
server
parameter toRealm.Sync.User.adminUser
Specifying the server address the same way as inRealm.Sync.User.login
allows the admin token user to use the permission realm APIs.
Bug fixes
- Fix regression where setting a Results or List object to a
list
property would throw.
v1.8.3
Breaking changes
- None
Enhancements
- None
Bug fixes
- Fix admin users not appearing in
Realm.Sync.User.all
, which broke getting an access token for them.
v1.8.2
Enhancements
- Added
indexOf()
method onRealm.Results
andRealm.List
that returns the index of the object in the collection.
Bug fixes
- Fix opening synced realms with a logged-in admin user.
v1.8.1
Enhancements
- Accessing
Realm.Sync
when sync is not enabled will no longer throw, but returnundefined
. - Better error messages when creating objects.
- Added bundled TypeScript declarations of the Realm API.
- Added
objectSchema()
method onRealm.Object
that returns the schema for the object.
Bug fixes
- Fix
Realm.Sync.User.prototype.isAdmin
returningfalse
for logged-in admin users.
v1.3.1
Add Realm open async API support.
0.15.5-rmp-beta.1
This is a preview of Realm React Native with sync enabled. It's a beta release, do not use in production!