Skip to content

Commit

Permalink
Fixed MongoDBCollection#watch on React Native (#4155)
Browse files Browse the repository at this point in the history
* Add react-native output to realm-network-transport

* Sending non-standard fetch option on react-native

* Adding a runtime check for expected globals

* Adding documentation

* Adding a note to the changelog

* Upgrade the version or realm-network-transport

* Published realm-network-transport v0.7.1
  • Loading branch information
kraenhansen committed Dec 17, 2021
1 parent b9f9f92 commit 9459ffa
Show file tree
Hide file tree
Showing 19 changed files with 114 additions and 284 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"./header.eslintrc"
],
"env": {
"es2017": true
"es2020": true
},
"parserOptions": {
"ecmaVersion": 2018
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ x.x.x Release notes (yyyy-MM-dd)
* Queries of the form `link.collection.@sum = 0` where `link` is `null` matched when `collection` was a List or Set, but not a Dictionary ([realm/realm-core#5080](https://github.com/realm/realm-core/pull/5080), since v10.5.0)
* Type methods defined in `collection-methods.js` no longer throw `Realm not defined` errors in some environments ([#4029](https://github.com/realm/realm-js/issues/4029), [#3991](https://github.com/realm/realm-js/issues/3991), since v10.5.0)
* Fixed a bug in `Realm.App.emailPasswordAuth.callResetPasswordFunction()` which could lead to the error `Error: Error: resetDetails must be of type 'object', got (user@example.com)`. ([#4143](https://github.com/realm/realm-js/issues/4143), since v10.10.0)
* Fixed `MongoDBCollection#watch` on React Native (https://github.com/realm/realm-js/issues/3494, since v10.0.0). To use this, you must install:
1. Polyfills for `fetch`, `ReadableStream` and `TextDecoder`: https://www.npmjs.com/package/react-native-polyfill-globals
2. Babel plugin enabling async generator syntax: https://npmjs.com/package/@babel/plugin-proposal-async-generator-functions

### Compatibility
* MongoDB Realm Cloud.
Expand Down
5 changes: 5 additions & 0 deletions docs/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,11 @@ class MongoDBCollection {
* By default, yields all change events for this collection. You may specify at most one of
* the `filter` or `ids` options.
*
* Important Note: To use this on React Native, you must install:
*
* 1. Polyfills for `fetch`, `ReadableStream` and `TextDecoder`: {@link https://www.npmjs.com/package/react-native-polyfill-globals}
* 2. Babel plugin enabling async generator syntax: {@link https://npmjs.com/package/@babel/plugin-proposal-async-generator-functions}
*
* @param {object} [options={}]
* @param {object} [options.filter] A filter for which change events you are interested in.
* @param {any[]} [options.ids] A list of ids that you are interested in watching
Expand Down

0 comments on commit 9459ffa

Please sign in to comment.