Skip to content

Commit

Permalink
[0.2.1+alpha]
Browse files Browse the repository at this point in the history
  • Loading branch information
blagoev committed Mar 20, 2022
1 parent a38a346 commit 5d53660
Show file tree
Hide file tree
Showing 10 changed files with 141 additions and 12 deletions.
108 changes: 103 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,127 @@
x.x.x Release notes (yyyy-MM-dd)
0.2.1+alpha Release notes (2022-03-20)
==============================================================

**This project is in the Alpha stage. All API's might change without warning and no guarantees are given about stability. Do not use it in production.**

### Enhancements
* Support change notifications on query results. ([#208](https://github.com/realm/realm-dart/pull/208))

Every `RealmResults<T>` object now has a `changes` method returning a `Stream<RealmResultsChanges<T>>` which can be listened to.

```dart
final subscription = realm.all<Dog>().changes.listen((changes) {
changes.inserted // indexes of inserted ojbects
changes.modified // indexes of modified objects
changes.deleted // indexes of deleted objects
changes.newModified // indexes of modified objects after deletions and insertions are accounted for.
changes.moved // indexes of moved objects
}});
subscription.cancel(); // cancel the subscription
```
* Support change notifications on list collections. ([#261](https://github.com/realm/realm-dart/pull/261))
Every `RealmList<T extends RealmObject>` object now has a `changes` method returning a `Stream<RealmListChanges<T>>` which can be listened to.
```dart
final team = Team('team', players: [Person("player")]);
realm.write(() => realm.add(team));
var firstCall = true;
final subscription = team.players.changes.listen((changes) {
changes.inserted // indexes of inserted ojbects
changes.modified // indexes of modified objects
changes.deleted // indexes of deleted objects
changes.newModified // indexes of modified objects after deletions and insertions are accounted for.
changes.moved // indexes of moved objects
});
subscription.cancel(); // cancel the subscription
```
* Support change notifications on realm objects. ([#262](https://github.com/realm/realm-dart/pull/262))
Every managed `RealmObject` now has a changes method which allows to listen for object property changes.
```dart
var dog = realm.all<Dog>().first;
final subscription = dog.changes.listen((changes) {
changes.isDeleted // if the object has been deleted
changes.object // the RealmObject being listened to.
changes.properties // the changed properties
});
subscription.cancel(); // cancel the subscription
```
* Added support for checking if realm lists and realm objects are valid. ([#183](https://github.com/realm/realm-dart/pull/183))
* Support query on lists of realm objects. ([#239](https://github.com/realm/realm-dart/pull/239))
Every RealmList<T extends RealmObject> now has a query method.
```dart
final team = Team('Dream Team', players: [Person("Michael Jordan")]);
realm.write(() => realm.add(team)); // Object needs to be managed.
final result = team.players.query(r'name BEGINSWITH $0', ['M']);
```
* Added support for opening realm in read-only mode. ([#260](https://github.com/realm/realm-dart/pull/260))
* Added support for opening in-memory realms. ([#280](https://github.com/realm/realm-dart/pull/280))
* Primary key fields no longer required to be `final` in data model classes ([#240](https://github.com/realm/realm-dart/pull/240))
Previously primary key fields needed to be `final`.
```dart
@RealmModel()
class _Car {
@PrimaryKey()
late final String make; // previously
}
```
Now primary key fields no longer need to be `final`
```dart
@RealmModel()
class _Car {
@PrimaryKey()
late String make; // now
}
```
* List fields no longer required to be `final` in data model classes. ([#253](https://github.com/realm/realm-dart/pull/253))
Previously list fields needed to be `final`.
```dart
@RealmModel()
class _Car {
late final List<Person> owner; // previously
}
```
Now list fields no longer need to be `final`
```dart
@RealmModel()
class _Car {
late List<Person> owner; // now
}
```
* Support custom FIFO special files. ([#284](https://github.com/realm/realm-dart/pull/284))
* Support flutter for Linux desktop. ([#279](https://github.com/realm/realm-dart/pull/279/))
### Fixed
* Snapshot the results collection when iterating collections of realm objects. ([#258](https://github.com/realm/realm-dart/pull/258))
### Compatibility
* Dart ^2.15 on Windows, MacOS and Linux
* Flutter ^2.10 on Android, iOS, Linux, MacOS and Windows
### Fixed
* Snapshot the results collection when iterating if the items are realm objects. ([#258](https://github.com/realm/realm-dart/pull/258))


0.2.0+alpha Release notes (2022-01-31)
==============================================================
Expand Down
13 changes: 13 additions & 0 deletions common/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
0.2.1+alpha Release notes (2022-03-20)
=============================================================

**This project is in the Alpha stage. All API's might change without warning and no guarantees are given about stability. Do not use it in production.**

This package hosts the common code shared between realm, realm_dart and realm_generator packages

### Enhancements
* Added RealmStateError type. ([#208](https://github.com/realm/realm-dart/pull/208))

### Compatibility
* Flutter ^2.8 and Dart ^2.15

0.2.0+alpha Release notes (2022-01-31)
=============================================================

Expand Down
2 changes: 1 addition & 1 deletion common/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: >-
Hosts the common code shared between realm, realm_dart and realm_generator packages.
This package is part of the official Realm Flutter and Realm Dart SDKs.
version: 0.2.0+alpha
version: 0.2.1+alpha

homepage: https://www.realm.io
repository: https://github.com/realm/realm-dart
Expand Down
2 changes: 1 addition & 1 deletion flutter/realm_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
x.x.x Release notes (yyyy-MM-dd)
0.2.1+alpha Release notes (2022-03-20)
==============================================================

**This project is in the Alpha stage. All API's might change without warning and no guarantees are given about stability. Do not use it in production.**
Expand Down
2 changes: 1 addition & 1 deletion flutter/realm_flutter/ios/realm.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ project_dir = File.expand_path("../../../../", realmPackageDir)
# //TODO read the version from pubspec.yaml
Pod::Spec.new do |s|
s.name = 'realm'
s.version = '0.2.0+alpha'
s.version = '0.2.1+alpha'
s.summary = 'The official Realm SDK for Flutter'
s.description = <<-DESC
Realm is a mobile database - an alternative to SQLite and key-value stores.
Expand Down
2 changes: 1 addition & 1 deletion flutter/realm_flutter/macos/realm.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ realmPackageDir = File.expand_path(__dir__)

Pod::Spec.new do |s|
s.name = 'realm'
s.version = '0.2.0+alpha'
s.version = '0.2.1+alpha'
s.summary = 'The official Realm SDK for Flutter'
s.description = <<-DESC
Realm is a mobile database - an alternative to SQLite and key-value stores.
Expand Down
2 changes: 1 addition & 1 deletion flutter/realm_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: realm
description: The official Realm SDK for Flutter. Realm is a mobile database - an alternative to SQLite and key-value stores.
version: 0.2.0+alpha
version: 0.2.1+alpha

homepage: https://www.realm.io
repository: https://github.com/realm/realm-dart
Expand Down
18 changes: 18 additions & 0 deletions generator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
0.2.1+alpha Release notes (2022-03-20)
=============================================================

**This project is in the Alpha stage. All API's might change without warning and no guarantees are given about stability. Do not use it in production.**

### Enhancements
* Support for object notifications. Generated code for `RealmObject.changes` method. [#262](https://github.com/realm/realm-dart/pull/262)
* Generated code now returns `RealmList` for `List<T>` model property types. [#270](https://github.com/realm/realm-dart/pull/270)
* Removes `final` requirement for primary keys. [#253](https://github.com/realm/realm-dart/pull/253)
* Removed `final` requirement for list properties. [#253](https://github.com/realm/realm-dart/pull/253)
* Generated code throws exception if primary key is being set. [#253](https://github.com/realm/realm-dart/pull/253)

### Internal
* `RealmObject`s are now also `RealmEntity`. A class for sharing common logic. This class should not be used directly.

### Compatibility
* Flutter ^2.8 and Dart ^2.15

0.2.0+alpha Release notes (2022-01-31)
=============================================================

Expand Down
2 changes: 1 addition & 1 deletion generator/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: >-
Generates RealmObject classes from Realm data model classes.
This package is part of the official Realm Flutter and Realm Dart SDKs.
version: 0.2.0+alpha
version: 0.2.1+alpha

homepage: https://www.realm.io
repository: https://github.com/realm/realm-dart
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: realm_dart
description: The official Realm SDK for Dart. Realm is a mobile database - an alternative to SQLite and key-value stores.
version: 0.2.0+alpha
version: 0.2.1+alpha

homepage: https://www.realm.io
repository: https://github.com/realm/realm-dart
Expand Down

0 comments on commit 5d53660

Please sign in to comment.