Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

realm

Package Overview
Dependencies
Maintainers
5
Versions
401
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

realm - npm Package Versions

13
41

12.10.0-rc.0

Diff

Changelog

Source

12.10.0-rc.0 (2024-05-31)

Enhancements

  • A counter presentation data type has been introduced. The int data type can now be used as a logical counter for performing numeric updates that need to be synchronized as sequentially consistent events rather than individual reassignments of the number. (#6694)
    • See the API docs for more information about the usage, or get a high-level introduction about counters in the documentation.
class MyObject extends Realm.Object {
  _id!: BSON.ObjectId;
  counter!: Realm.Types.Counter;

  static schema: ObjectSchema = {
    name: "MyObject",
    primaryKey: "_id",
    properties: {
      _id: { type: "objectId", default: () => new BSON.ObjectId() },
      counter: "counter",
      // or: counter: { type: "int", presentation: "counter" },
    },
  };
}

const realm = await Realm.open({ schema: [MyObject] });
const object = realm.write(() => {
  return realm.create(MyObject, { counter: 0 });
});

realm.write(() => {
  object.counter.increment();
  object.counter.value; // 1
  object.counter.decrement(2);
  object.counter.value; // -1
});

Fixed

  • A non-streaming progress notifier would not immediately call its callback after registration. Instead you would have to wait for a download message to be received to get your first update - if you were already caught up when you registered the notifier you could end up waiting a long time for the server to deliver a download that would call/expire your notifier. (#7627, since v12.8.0)

Compatibility

  • React Native >= v0.71.4
  • Realm Studio v15.0.0.
  • File format: generates Realms with format v24 (reads and upgrades file format v10).
realmnpm
published 12.9.0 •

Changelog

Source

12.9.0 (2024-05-23)

Enhancements

  • A mixed value can now hold a Realm.List and Realm.Dictionary with nested collections. Note that Realm.Set is not supported as a mixed value. (#6613)
class CustomObject extends Realm.Object {
  value!: Realm.Types.Mixed;

  static schema: ObjectSchema = {
    name: "CustomObject",
    properties: {
      value: "mixed",
    },
  };
}

const realm = await Realm.open({ schema: [CustomObject] });

// Create an object with a dictionary value as the Mixed
// property, containing primitives and a list.
const realmObject = realm.write(() => {
  return realm.create(CustomObject, {
    value: {
      num: 1,
      string: "hello",
      bool: true,
      list: [
        {
          string: "world",
        },
      ],
    },
  });
});

// Accessing the collection value returns the managed collection.
const dictionary = realmObject.value;
expectDictionary(dictionary);
const list = dictionary.list;
expectList(list);
const leafDictionary = list[0];
expectDictionary(leafDictionary);
console.log(leafDictionary.string); // "world"

// Update the Mixed property to a list.
realm.write(() => {
  realmObject.value = [1, "hello", { newKey: "new value" }];
});

// Useful custom helper functions. (Will be provided in a future release.)
function expectList(value: unknown): asserts value is Realm.List {
  if (!(value instanceof Realm.List)) {
    throw new Error("Expected a 'Realm.List'.");
  }
}
function expectDictionary(value: unknown): asserts value is Realm.Dictionary {
  if (!(value instanceof Realm.Dictionary)) {
    throw new Error("Expected a 'Realm.Dictionary'.");
  }
}

Fixed

  • Inserting the same typed link to the same key in a dictionary more than once would incorrectly create multiple backlinks to the object. This did not appear to cause any crashes later, but would have affecting explicit backlink count queries (eg: ...@links.@count) and possibly notifications (realm/realm-core#7676 since v12.7.1).
  • Having links in a nested collections would leave the file inconsistent if the top object is removed. (realm/realm-core#7657, since v12.7.0)
  • Automatic client reset recovery would crash when recovering AddInteger instructions on a Mixed property if its type was changed to non-integer (realm/realm-core#7683, since v10.18.0).

Compatibility

  • React Native >= v0.71.4
  • Realm Studio v15.0.0.
  • File format: generates Realms with format v24 (reads and upgrades file format v10).

Internal

  • Upgraded Realm Core from v14.6.2 to v14.7.0.
  • Upgraded @trunk/launcher from v1.3.0 to v1.3.1 to support Apple's versioning scheme for macOS.
realmnpm
published 12.8.1 •

Changelog

Source

12.8.1 (2024-05-15)

Fixed

  • Fixed a crash experienced on React Native when accessing Realm.deleteFile, Realm.exists, Realm.schemaVersion, Realm.determinePath, Realm.transformConfig and User#isLoggedIn. (#6662, since v12.8.0)
  • Accessing Realm.App#currentUser from within a notification produced by Realm.App.switchUser (which includes notifications for a newly logged in user) would deadlock. (realm/realm-core#7670, since v12.8.0)
  • Fixed a bug when running an IN query on a string/int/uuid/objectId property that was indexed. (realm/realm-core#7642 since v12.8.0)
  • Fixed a bug when running an IN query on an int property where double/float parameters were ignored. (realm/realm-core#7642 since v12.8.0)

Compatibility

  • React Native >= v0.71.4
  • Realm Studio v15.0.0.
  • File format: generates Realms with format v24 (reads and upgrades file format v10).

Internal

  • Upgraded Realm Core from v14.6.1 to v14.6.2 + commits 5ba02142131efa3d97eda770ce33a85a2a085202 and 5462d47998b86459d328648c8057790a7b92af20.
realmnpm
published 12.8.1-alpha.0 •

realmnpm
published 12.8.0 •

Changelog

Source

12.8.0 (2024-05-01)

Deprecations

  • MetadataMode.NoMetadata is deprecated and will be removed. The new name is MetadataMode.InMemory.

Enhancements

  • Experimental feature: The new instance members App.baseUrl and App.updateBaseUrl() allow for retrieving and updating the base URL currently used for requests sent to Atlas App Services. These APIs are only available after importing "realm/experimental/base-url". (#6518)
  • Improved performance of "chained OR equality" queries for uuid/objectId types and RQL parsed IN queries on string/int/uuid/objectId types. (realm/realm-dotnet#3566, since the introduction of these types)

Fixed

  • Fixed a bug when running an IN query (or a query of the pattern x == 1 OR x == 2 OR x == 3) when evaluating on a string property with an empty string in the search condition. Matches with an empty string would have been evaluated as if searching for a null string instead. (realm/realm-core#7628, since v10.0.0)
  • App.allUsers() included logged out users only if they were logged out while the App instance existed. It now always includes all logged out users. (realm/realm-core#7300)
  • Deleting the active user left the active user unset rather than selecting another logged-in user as the active user like logging out and removing users did. (realm/realm-core#7300)
  • Fixed several issues around encrypted file portability (copying a "bundled" encrypted Realm from one device to another):
    • Fixed Assertion failed: new_size % (1ULL << m_page_shift) == 0 when opening an encrypted Realm less than 64Mb that was generated on a platform with a different page size than the current platform. (#realm/realm-core#7322, since v12.0.0-rc.3)
    • Fixed an exception thrown when opening a small (<4k of data) Realm generated on a device with a page size of 4k if it was bundled and opened on a device with a larger page size. (since v1.0.0)
    • Fixed an issue during a subsequent open of an encrypted Realm for some rare allocation patterns when the top ref was within ~50 bytes of the end of a page. This could manifest as an exception or as an assertion encrypted_file_mapping.hpp:183: Assertion failed: local_ndx < m_page_state.size(). (realm/realm-core#7319)
  • Schema initialization could hit an assertion failure if the sync client applied a downloaded changeset while the Realm file was in the process of being opened. (realm/realm-core#7041, since v10.8.0)
  • Queries using query paths on mixed values returns inconsistent results. (realm/realm-core#7587, since v12.7.0-rc.0)

Known issues

  • Missing initial download progress notification when there is no active downloads. (realm/realm-core#7627)

Compatibility

  • React Native >= v0.71.4
  • Realm Studio v15.0.0.
  • File format: generates Realms with format v24 (reads and upgrades file format v10.

Internal

  • Upgraded Realm Core from v14.5.1 to v14.6.1.
  • The metadata disabled mode (MetadataMode.NoMetadata) has been replaced with an in-memory metadata mode (MetadataMode.InMemory) which performs similarly and doesn't work weirdly differently from the normal mode. The new mode is intended for testing purposes, but should be suitable for production usage if there is a scenario where metadata persistence is not needed. (realm/realm-core#7300)
realmnpm
published 12.7.1 •

Changelog

Source

12.7.1 (2024-04-19)

Fixed

  • Fixed a crash when integrating removal of already removed dictionary key. (realm/realm-core#7488, since v10.0.0)
  • Removed incorrect privacy manifest for iOS. (#6624, since v12.7.0)

Compatibility

  • React Native >= v0.71.4
  • Realm Studio v15.0.0.
  • File format: generates Realms with format v24 (reads and upgrades file format v10 or later).

Internal

  • Upgraded Realm Core from v14.5.1 to v14.5.2. (#6628)
  • Update URLs to documentation.
realmnpm
published 12.7.0 •

Changelog

Source

12.7.0 (2024-04-17)

[!NOTE] This version bumps the Realm file format to version 24. It is not possible to downgrade to earlier versions. Older files will automatically be upgraded to the new file format. Files created by Realm JavaScript prior to v6.0.0, might not be upgradeable. Only Realm Studio 15.0.0 or later will be able to open the new file format.

[!NOTE] This version communicates with Atlas Device Services through a different URL (https://services.cloud.mongodb.com). While we consider this an internal detail of the SDK, you might need to update rules in firewalls or other configuration that you've used to limit connections made by your app.

Enhancements

  • Added iOS Privacy Manifest. (#6547
  • Updated bundled OpenSSL version to 3.2.0. (realm/realm-core#7303)
  • Improved performance of object notifiers with complex schemas by ~20%. (realm/realm-core#7424)
  • Improved performance with very large number of notifiers by ~75%. (realm/realm-core#7424)
  • Improved performance of aggregate operations on Dictionaries of objects, particularly when the dictionaries are empty. (realm/realm-core#7418
  • Property keypath in RQL can be substituted with value given as argument. Use $P<i> in query string. (realm/realm-core#7033)
  • You can now use query substitution for the @type argument. (realm/realm-core#7289)
  • Storage of Decimal128 properties has been optimized so that the individual values will take up 0 bits (if all nulls), 32 bits, 64 bits or 128 bits depending on what is needed. ([realm/realm-core#6111]https://github.com/realm/realm-core/pull/6111))
  • Querying a specific entry in a collection (in particular 'first and 'last') is supported. (realm/realm-core#4269)
  • Index on list of strings property now supported (realm/realm-core#7142)
  • You can set the threshold levels for trace output on individual categories. (realm/realm-core#7004)
  • Improved performance of RQL queries on a non-linked string property using >, >=, <, <= operators and fixed behavior that a null string should be evaluated as less than everything, previously nulls were not matched. (realm/realm-core#3939)
  • Added support for using aggregate operations on Mixed properties in queries. (realm/realm-core#7398)
  • Improved file compaction performance on platforms with page sizes greater than 4k (for example arm64 Apple platforms) for files less than 256 pages in size. (realm/realm-core#7492)
  • Added the ability to set the log level for one or more categories via Realm.setLogLevel. (#6560)
  • Added detection and better instructions when imported from the Expo Go app. (#6523)

Fixed

  • Aligned Dictionaries to Lists and Sets when they get cleared. (#6205, since v10.3.0-rc.1)
  • Fixed equality queries on a Mixed property with an index possibly returning the wrong result if values of different types happened to have the same StringIndex hash. (realm/realm-core#6407, since v10.5.0-beta.1)
  • @count/@size is now supported for Mixed properties. (realm/realm-core#7280, since v10.0.0)
  • Fixed queries like indexed_property == NONE {x} which mistakenly matched on only x instead of not x. This only applies when an indexed property with equality (==, or IN) matches with NONE on a list of one item. If the constant list contained more than one value then it was working correctly. (realm/realm-java#7862, since v10.20.0)
  • Uploading the changesets recovered during an automatic client reset recovery may lead to Bad server version errors and a new client reset. (realm/realm-core#7279, since v12.5.0)
  • Fixed crash in full text index using prefix search with no matches (realm/realm-core#7309, since v12.2.0)
  • Fixed a race condition when backing up Realm files before a client reset which could have lead to overwriting an existing file. (realm/realm-core#7341)
  • Fixed a bug when removing items from a list that could result in invalidated links becoming visible which could cause crashes or exceptions when accessing those list items later on. This affects synced Realms where another client had previously removed a list with over 1000 items in it, and then further local removals from the same list caused the list to have fewer than 1000 items. (#7414, since v10.0.0)
  • Fixed opening a Realm with cached user while offline results in fatal error and session does not retry connection. (#6554 and #6558, since v12.6.0)
  • Fixed sorting order of strings to use standard unicode codepoint order instead of grouping similar English letters together. A noticeable change will be from "aAbBzZ" to "ABZabz". (realm/realm-core#2573)
  • data and string are now strongly typed for comparisons and queries. This change is especially relevant when querying for a string constant on a Mixed property, as now only strings will be returned. If searching for data is desired, then that type must be specified by the constant. In RQL the new way to specify a binary constant is to use mixed = bin('xyz') or mixed = binary('xyz'). (realm/realm-core#6407)
  • Fixed diverging history due to a bug in the replication code when setting default null values (embedded objects included). (realm/realm-core#7536)
  • Null pointer exception may be triggered when logging out and async commits callbacks not executed. (realm/realm-core#7434, since v12.6.0)
  • Fixed a bug which caused crashes when reloading React Native apps. (#6579, since v12.0.0)

Compatibility

  • React Native >= v0.71.4
  • Realm Studio v15.0.0.
  • File format: generates Realms with format v24 (reads and upgrades file format v10 or later).

Internal

  • The base URL used to communicate with the Atlas App Services was changed from "https://realm.mongodb.com" to "https://services.cloud.mongodb.com". (realm/realm-core#7534).
  • Upgraded Realm Core from v13.26.0 to v14.5.1. (#6499, #6541, #6568, #6572, #6599, and #6610)
  • Publish releases with provenance statements.
  • Use CMake v3.29.2 and Node v20.11.1 on Github Actions.
realmnpm
published 12.7.0-rc.1 •

realmnpm
published 12.7.0-rc.0 •

Changelog

Source

12.7.0-rc.0 (2024-03-26)

[!NOTE] This version bumps the Realm file format to version 24. It is not possible to downgrade to earlier versions. Older files will automatically be upgraded to the new file format. Files created by Realm JavaScript prior to v6.0.0, might not be upgradeable. Only Realm Studio 15.0.0 or later will be able to open the new file format.

[!NOTE] This release doesn't include the changes previously released as v12.7.0-alpha.0 and is a pre-release because we plan on updating the setLogLevel API before releasing this as v12.7.0: https://github.com/realm/realm-js/issues/6560 and we just wanted to get this out for Realm Studio v15.0.0.

Enhancements

  • Updated bundled OpenSSL version to 3.2.0. (realm/realm-core#7303)
  • Improved performance of object notifiers with complex schemas by ~20%. (realm/realm-core#7424)
  • Improved performance with very large number of notifiers by ~75%. (realm/realm-core#7424)
  • Improved performance of aggregate operations on Dictionaries of objects, particularly when the dictionaries are empty. (realm/realm-core#7418
  • Property keypath in RQL can be substituted with value given as argument. Use $P<i> in query string. (realm/realm-core#7033)
  • You can now use query substitution for the @type argument. (realm/realm-core#7289)
  • Storage of Decimal128 properties has been optimized so that the individual values will take up 0 bits (if all nulls), 32 bits, 64 bits or 128 bits depending on what is needed. ([realm/realm-core#6111]https://github.com/realm/realm-core/pull/6111))
  • Querying a specific entry in a collection (in particular 'first and 'last') is supported. (realm/realm-core#4269)
  • Index on list of strings property now supported (realm/realm-core#7142)
  • You can set the threshold levels for trace output on individual categories. (realm/realm-core#7004)
  • Improved performance of RQL queries on a non-linked string property using >, >=, <, <= operators and fixed behavior that a null string should be evaluated as less than everything, previously nulls were not matched. (realm/realm-core#3939)
  • Added support for using aggregate operations on Mixed properties in queries. (realm/realm-core#7398)
  • Improved file compaction performance on platforms with page sizes greater than 4k (for example arm64 Apple platforms) for files less than 256 pages in size. (realm/realm-core#7492)
  • Added a static Realm.shutdown() method, which closes all Realms, cancels all pending Realm.open calls, clears internal caches, resets the logger and collects garbage. Call this method to free up the event loop and allow Node.js to perform a graceful exit. (#6571, since v12.0.0)

Fixed

  • Aligned Dictionaries to Lists and Sets when they get cleared. (#6205, since v10.3.0-rc.1)
  • Fixed equality queries on a Mixed property with an index possibly returning the wrong result if values of different types happened to have the same StringIndex hash. (realm/realm-core#6407, since v10.5.0-beta.1)
  • @count/@size is now supported for Mixed properties. (realm/realm-core#7280, since v10.0.0)
  • Fixed queries like indexed_property == NONE {x} which mistakenly matched on only x instead of not x. This only applies when an indexed property with equality (==, or IN) matches with NONE on a list of one item. If the constant list contained more than one value then it was working correctly. (realm/realm-java#7862, since v10.20.0)
  • Uploading the changesets recovered during an automatic client reset recovery may lead to Bad server version errors and a new client reset. (realm/realm-core#7279, since v12.5.0)
  • Fixed crash in full text index using prefix search with no matches (realm/realm-core#7309, since v12.2.0)
  • Fixed a race condition when backing up Realm files before a client reset which could have lead to overwriting an existing file. (realm/realm-core#7341)
  • Fixed a bug when removing items from a list that could result in invalidated links becoming visible which could cause crashes or exceptions when accessing those list items later on. This affects synced Realms where another client had previously removed a list with over 1000 items in it, and then further local removals from the same list caused the list to have fewer than 1000 items. (#7414, since v10.0.0)
  • Fixed opening a Realm with cached user while offline results in fatal error and session does not retry connection. (#6554 and #6558, since v12.6.0)
  • Fixed sorting order of strings to use standard unicode codepoint order instead of grouping similar English letters together. A noticeable change will be from "aAbBzZ" to "ABZabz". (realm/realm-core#2573)
  • data and string are now strongly typed for comparisons and queries. This change is especially relevant when querying for a string constant on a Mixed property, as now only strings will be returned. If searching for data is desired, then that type must be specified by the constant. In RQL the new way to specify a binary constant is to use mixed = bin('xyz') or mixed = binary('xyz'). (realm/realm-core#6407)

Compatibility

  • React Native >= v0.71.4
  • Realm Studio v15.0.0.
  • File format: generates Realms with format v24 (reads and upgrades file format v10 or later).

Internal

realmnpm
published 12.6.2 •

Changelog

Source

12.6.2 (2024-03-04)

Fixed

  • Fixed binding abstraction to allow access of certain properties ($$typeof for now) prior to its injection. (#6522, since v12.6.1)
  • Added a missing dependency on path-browserify. (#6522, since v12.6.1)

Internal

  • Using Realm Core v13.26.0.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc