Skip to content

Releases: realm/realm-js

2.16.0-rc.2

14 Sep 11:37
Compare
Choose a tag to compare
2.16.0-rc.2 Pre-release
Pre-release

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);
  • Exposed Realm.Sync.User.serialize() to create a persistable representation of a user instance, as well as Realm.Sync.User.deserialize() to later inflate a User instance that can be used to connect to Realm Object Server and open synchronized Realms. (#1276)

  • Added Realm.Sync.Session.pause() and Realm.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 is age >= 20 LIMIT(2). (#2008)

Bug fixes

  • Fixed the type definition for User.authenticate(). (#2000, since v2.2.0)
  • Added Realm.Sync.Subscription.removeAllListeners() to the Subscription 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() and Session.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

31 Aug 11:24
Compare
Choose a tag to compare

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

02 Aug 13:09
Compare
Choose a tag to compare

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

12 Jul 16:15
Compare
Choose a tag to compare

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 the uncaughtError event on the process object.

v1.9.0

10 Jul 21:57
Compare
Choose a tag to compare

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 to Realm.Sync.User.adminUser
    Specifying the server address the same way as in Realm.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

27 Jun 19:26
Compare
Choose a tag to compare

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

26 Jun 13:24
Compare
Choose a tag to compare

Enhancements

  • Added indexOf() method on Realm.Results and Realm.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

20 Jun 17:55
Compare
Choose a tag to compare

Enhancements

  • Accessing Realm.Sync when sync is not enabled will no longer throw, but return undefined.
  • Better error messages when creating objects.
  • Added bundled TypeScript declarations of the Realm API.
  • Added objectSchema() method on Realm.Object that returns the schema for the object.

Bug fixes

  • Fix Realm.Sync.User.prototype.isAdmin returning false for logged-in admin users.

v1.3.1

18 May 11:53
Compare
Choose a tag to compare

Add Realm open async API support.

0.15.5-rmp-beta.1

20 Jan 15:22
Compare
Choose a tag to compare
0.15.5-rmp-beta.1 Pre-release
Pre-release

This is a preview of Realm React Native with sync enabled. It's a beta release, do not use in production!