Skip to content

Commit d15def9

Browse files
authored
Merge branch 'master' into master
2 parents db45ff6 + 6708261 commit d15def9

14 files changed

+573
-550
lines changed

CHANGELOG.md

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,44 @@
11
# Parse-SDK-JS
22

3+
## 2.2.1
4+
5+
- Addresses issue with babel runtime regenerator ([#740](https://github.com/parse-community/Parse-SDK-JS/pull/740))
6+
37
## 2.2.0
48

5-
- Support for Local Datastore ([#612](https://github.com/parse-community/parse-server/pull/612))
6-
- LiveQuery override data on update ([#718](https://github.com/parse-community/parse-server/pull/718)) (Requires Parse-Server 3.1.3+)
7-
- Support setting user from JSON (hydrate) ([#730](https://github.com/parse-community/parse-server/pull/730))
8-
- Improve dot notation for updating nested objects ([#729](https://github.com/parse-community/parse-server/pull/729))
9-
- LiveQuery handle unset operation ([#714](https://github.com/parse-community/parse-server/pull/714)) (Requires Parse-Server 3.1.3+)
10-
- Add original object to LiveQuery events ([#712](https://github.com/parse-community/parse-server/pull/712)) (Requires Parse-Server 3.1.3+)
11-
- Add support for providing file upload progress. ([#373](https://github.com/parse-community/parse-server/pull/373)) (Browser Only)
12-
- Support clone with relation ([#382](https://github.com/parse-community/parse-server/pull/382))
13-
- Add batchSize to saveAll / destroyAll ([#701](https://github.com/parse-community/parse-server/pull/701))
14-
- Add save Method for Parse.Config ([#684](https://github.com/parse-community/parse-server/pull/684))
15-
- Allow specific keys to be reverted in unsaved objects ([#565](https://github.com/parse-community/parse-server/pull/565))
16-
- Handle undefined in Cloud Code ([#682](https://github.com/parse-community/parse-server/pull/682))
17-
- Validate if geopoint values is number ([#671](https://github.com/parse-community/parse-server/pull/671))
18-
- LiveQuery Support for Subclasses ([#662](https://github.com/parse-community/parse-server/pull/662))
9+
- Support for Local Datastore ([#612](https://github.com/parse-community/Parse-SDK-JS/pull/612))
10+
- LiveQuery override data on update ([#718](https://github.com/parse-community/Parse-SDK-JS/pull/718)) (Requires Parse-Server 3.1.3+)
11+
- Support setting user from JSON (hydrate) ([#730](https://github.com/parse-community/Parse-SDK-JS/pull/730))
12+
- Improve dot notation for updating nested objects ([#729](https://github.com/parse-community/Parse-SDK-JS/pull/729))
13+
- LiveQuery handle unset operation ([#714](https://github.com/parse-community/Parse-SDK-JS/pull/714)) (Requires Parse-Server 3.1.3+)
14+
- Add original object to LiveQuery events ([#712](https://github.com/parse-community/Parse-SDK-JS/pull/712)) (Requires Parse-Server 3.1.3+)
15+
- Add support for providing file upload progress. ([#373](https://github.com/parse-community/Parse-SDK-JS/pull/373)) (Browser Only)
16+
- Support clone with relation ([#382](https://github.com/parse-community/Parse-SDK-JS/pull/382))
17+
- Add batchSize to saveAll / destroyAll ([#701](https://github.com/parse-community/Parse-SDK-JS/pull/701))
18+
- Add save Method for Parse.Config ([#684](https://github.com/parse-community/Parse-SDK-JS/pull/684))
19+
- Allow specific keys to be reverted in unsaved objects ([#565](https://github.com/parse-community/Parse-SDK-JS/pull/565))
20+
- Handle undefined in Cloud Code ([#682](https://github.com/parse-community/Parse-SDK-JS/pull/682))
21+
- Validate if geopoint values is number ([#671](https://github.com/parse-community/Parse-SDK-JS/pull/671))
22+
- LiveQuery Support for Subclasses ([#662](https://github.com/parse-community/Parse-SDK-JS/pull/662))
1923

2024
## 2.1.0
2125

22-
- Parse.Error now inherits from Error ([#658](https://github.com/parse-community/parse-server/pull/658))
26+
- Parse.Error now inherits from Error ([#658](https://github.com/parse-community/Parse-SDK-JS/pull/658))
2327

2428
## 2.0.2
2529

26-
- Fixes issue affecting unsubscribing from liveQueries ([#640](https://github.com/parse-community/parse-server/pull/640))
27-
- Adds support for aggregate stages with identical names ([#637](https://github.com/parse-community/parse-server/pull/637))
28-
- Adds ability to fetch an object with includes ([#631](https://github.com/parse-community/parse-server/pull/631))
29-
- Adds support for $nor operator in queries ([#634](https://github.com/parse-community/parse-server/pull/634))
30-
- Adds support for containedBy operator in queries ([#633](https://github.com/parse-community/parse-server/pull/633))
31-
- Adds support for includeAll ([#632](https://github.com/parse-community/parse-server/pull/632))
30+
- Fixes issue affecting unsubscribing from liveQueries ([#640](https://github.com/parse-community/Parse-SDK-JS/pull/640))
31+
- Adds support for aggregate stages with identical names ([#637](https://github.com/parse-community/Parse-SDK-JS/pull/637))
32+
- Adds ability to fetch an object with includes ([#631](https://github.com/parse-community/Parse-SDK-JS/pull/631))
33+
- Adds support for $nor operator in queries ([#634](https://github.com/parse-community/Parse-SDK-JS/pull/634))
34+
- Adds support for containedBy operator in queries ([#633](https://github.com/parse-community/Parse-SDK-JS/pull/633))
35+
- Adds support for includeAll ([#632](https://github.com/parse-community/Parse-SDK-JS/pull/632))
3236

3337
## 2.0.1
3438

35-
- Ensure we only read the job status id header if present. ([#623](https://github.com/parse-community/parse-server/pull/623))
39+
- Ensure we only read the job status id header if present. ([#623](https://github.com/parse-community/Parse-SDK-JS/pull/623))
3640

3741
## 2.0.0
3842

39-
- Parse.Promise has been replaced by native Promises ([#620](https://github.com/parse-community/parse-server/pull/620))
40-
- Backbone style callbacks are removed ([#620](https://github.com/parse-community/parse-server/pull/620))
43+
- Parse.Promise has been replaced by native Promises ([#620](https://github.com/parse-community/Parse-SDK-JS/pull/620))
44+
- Backbone style callbacks are removed ([#620](https://github.com/parse-community/Parse-SDK-JS/pull/620))

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@ The JavaScript ecosystem is wide and incorporates a large number of platforms an
2525
To use the npm modules for a browser based application, include it as you normally would:
2626

2727
```js
28-
var Parse = require('parse');
28+
const Parse = require('parse');
2929
```
3030

3131
For server-side applications or Node.js command line tools, include `'parse/node'`:
3232

3333
```js
3434
// In a node.js environment
35-
var Parse = require('parse/node');
35+
const Parse = require('parse/node');
3636
```
3737

3838
For React Native applications, include `'parse/react-native'`:
3939
```js
4040
// In a React Native application
41-
var Parse = require('parse/react-native');
41+
const Parse = require('parse/react-native');
4242

4343
// On React Native >= 0.50 and Parse >= 1.11.0, set the Async
44-
var AsyncStorage = require('react-native').AsyncStorage;
44+
const AsyncStorage = require('react-native').AsyncStorage;
4545
Parse.setAsyncStorage(AsyncStorage);
4646
```
4747

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var VERSION = require('./package.json').version;
1515
var transformRuntime = ["@babel/plugin-transform-runtime", {
1616
"corejs": false,
1717
"helpers": true,
18-
"regenerator": false,
18+
"regenerator": true,
1919
"useESModules": false
2020
}];
2121

integration/test/ParseLocalDatastoreTest.js

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,29 @@ function runTest(controller) {
802802
assert.equal(localDatastore[`Item_${fetchedItems[0].id}`].foo, 'changed');
803803
assert.equal(localDatastore[`Item_${fetchedItems[1].id}`].foo, 'changed');
804804
});
805+
806+
it(`${controller.name} can update Local Datastore from network`, async () => {
807+
const parent = new TestObject();
808+
const child = new Item();
809+
const grandchild = new Item();
810+
child.set('grandchild', grandchild);
811+
parent.set('field', 'test');
812+
parent.set('child', child);
813+
await Parse.Object.saveAll([parent, child, grandchild]);
814+
await parent.pin();
815+
816+
// Updates child with { foo: 'changed' }
817+
const params = { id: child.id };
818+
await Parse.Cloud.run('TestFetchFromLocalDatastore', params);
819+
820+
Parse.LocalDatastore.isSyncing = false;
821+
822+
await Parse.LocalDatastore.updateFromServer();
823+
824+
const updatedLDS = await Parse.LocalDatastore._getAllContents();
825+
const childJSON = updatedLDS[`${child.className}_${child.id}`];
826+
assert.equal(childJSON.foo, 'changed');
827+
});
805828
});
806829

807830
describe(`Parse Query Pinning (${controller.name})`, () => {
@@ -2344,7 +2367,7 @@ function runTest(controller) {
23442367
});
23452368
});
23462369

2347-
it('supports withinPolygon', async () => {
2370+
it(`${controller.name} supports withinPolygon`, async () => {
23482371
const sacramento = new TestObject();
23492372
sacramento.set('location', new Parse.GeoPoint(38.52, -121.50));
23502373
sacramento.set('name', 'Sacramento');
@@ -2373,7 +2396,7 @@ function runTest(controller) {
23732396
assert.equal(results.length, 1);
23742397
});
23752398

2376-
it('supports polygonContains', async () => {
2399+
it(`${controller.name} supports polygonContains`, async () => {
23772400
const p1 = [[0,0], [0,1], [1,1], [1,0]];
23782401
const p2 = [[0,0], [0,2], [2,2], [2,0]];
23792402
const p3 = [[10,10], [10,15], [15,15], [15,10], [10,10]];

0 commit comments

Comments
 (0)