Skip to content

Commit bc5eaf3

Browse files
committed
Merge remote-tracking branch 'upstream/alpha' into alpha
2 parents 759a690 + c1db66c commit bc5eaf3

28 files changed

+947
-505
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ updates:
1515
# Define dependencies to update
1616
allow:
1717
- dependency-name: "parse-server"
18+
# Allow both direct and indirect updates for all packages
19+
- dependency-type: "all"

.github/workflows/ci.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,31 @@ jobs:
1717
with:
1818
version: 1
1919
build:
20-
runs-on: ubuntu-18.04
20+
runs-on: ubuntu-latest
2121
timeout-minutes: 30
22-
env:
23-
MONGODB_VERSION: 3.6.9
22+
strategy:
23+
matrix:
24+
include:
25+
- name: Node 14
26+
NODE_VERSION: 14.21.1
27+
- name: Node 16
28+
NODE_VERSION: 16.18.1
29+
- name: Node 18
30+
NODE_VERSION: 18.12.1
31+
- name: Node 19
32+
NODE_VERSION: 19.3.0
33+
fail-fast: false
2434
steps:
2535
- name: Fix usage of insecure GitHub protocol
2636
run: sudo git config --system url."https://github".insteadOf "git://github"
37+
- name: Fix git protocol for Node 14
38+
if: ${{ startsWith(matrix.NODE_VERSION, '14.') }}
39+
run: sudo git config --system url."https://github".insteadOf "ssh://git@github"
2740
- uses: actions/checkout@v2
2841
- name: Use Node.js
2942
uses: actions/setup-node@v1
3043
with:
31-
node-version: 14
44+
node-version: ${{ matrix.NODE_VERSION }}
3245
- name: Cache Node.js modules
3346
uses: actions/cache@v2
3447
with:

.github/workflows/release-automated.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
persist-credentials: false
1818
- uses: actions/setup-node@v2
1919
with:
20-
node-version: 14
20+
node-version: 16
2121
registry-url: https://registry.npmjs.org/
2222
- name: Cache Node.js modules
2323
uses: actions/cache@v2
@@ -48,7 +48,7 @@ jobs:
4848
- name: Use Node.js
4949
uses: actions/setup-node@v1
5050
with:
51-
node-version: 14
51+
node-version: 16
5252
- name: Cache Node.js modules
5353
uses: actions/cache@v2
5454
with:

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![Snyk Badge](https://snyk.io/test/github/parse-community/Parse-SDK-JS/badge.svg)](https://snyk.io/test/github/parse-community/Parse-SDK-JS)
99
[![Coverage](http://codecov.io/github/parse-community/Parse-SDK-JS/coverage.svg?branch=alpha)](http://codecov.io/github/parse-community/Parse-SDK-JS?branch=alpha)
1010

11-
[![Node Version](https://img.shields.io/badge/nodejs-14-green.svg?logo=node.js&style=flat)](https://nodejs.org/)
11+
[![Node Version](https://img.shields.io/badge/nodejs-14,_16,_18-green.svg?logo=node.js&style=flat)](https://nodejs.org/)
1212
[![auto-release](https://img.shields.io/badge/%F0%9F%9A%80-auto--release-9e34eb.svg)](https://github.com/parse-community/parse-dashboard/releases)
1313

1414
[![npm latest version](https://img.shields.io/npm/v/parse/latest.svg)](https://www.npmjs.com/package/parse)
@@ -72,7 +72,7 @@ For React Native applications, include `'parse/react-native.js'`:
7272
const Parse = require('parse/react-native.js');
7373

7474
// On React Native >= 0.50 and Parse >= 1.11.0, set the Async
75-
const AsyncStorage = require('react-native').AsyncStorage;
75+
const AsyncStorage = require('@react-native-async-storage/async-storage');
7676
Parse.setAsyncStorage(AsyncStorage);
7777
```
7878

@@ -99,6 +99,9 @@ Parse JS SDK is continuously tested with the most recent releases of Node.js to
9999
| Version | Latest Version | End-of-Life | Compatible |
100100
|------------|----------------|-------------|------------|
101101
| Node.js 14 | 14.19.1 | April 2023 | ✅ Yes |
102+
| Node.js 16 | 16.19.0 | September 2023 | ✅ Yes |
103+
| Node.js 18 | 18.12.1 | April 2025 | ✅ Yes |
104+
| Node.js 19 | 19.3.0 | June 2023 | ✅ Yes |
102105

103106

104107
## Upgrading to Parse SDK 2.0.0

changelogs/CHANGELOG_alpha.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
# [4.0.0-alpha.7](https://github.com/parse-community/Parse-SDK-JS/compare/4.0.0-alpha.6...4.0.0-alpha.7) (2023-01-30)
2+
3+
4+
### Bug Fixes
5+
6+
* Request execution time keeps increasing over time when using `Parse.Object.extend` ([#1682](https://github.com/parse-community/Parse-SDK-JS/issues/1682)) ([f555c43](https://github.com/parse-community/Parse-SDK-JS/commit/f555c43841c95c2ae759342ea28cd69f7fd232a4))
7+
8+
# [4.0.0-alpha.6](https://github.com/parse-community/Parse-SDK-JS/compare/4.0.0-alpha.5...4.0.0-alpha.6) (2023-01-27)
9+
10+
11+
### Bug Fixes
12+
13+
* Local datastore query with `containedIn` not working when field is an array ([#1666](https://github.com/parse-community/Parse-SDK-JS/issues/1666)) ([2391bff](https://github.com/parse-community/Parse-SDK-JS/commit/2391bff36bd8b3f5357f069916375b979cde15b2))
14+
15+
# [4.0.0-alpha.5](https://github.com/parse-community/Parse-SDK-JS/compare/4.0.0-alpha.4...4.0.0-alpha.5) (2023-01-06)
16+
17+
18+
### Features
19+
20+
* Add node 19 support ([8ed0fab](https://github.com/parse-community/Parse-SDK-JS/commit/8ed0faba400642571ff90b9645a6e4fcef16c475))
21+
* Add Node 19 support ([#1643](https://github.com/parse-community/Parse-SDK-JS/issues/1643)) ([dfb5196](https://github.com/parse-community/Parse-SDK-JS/commit/dfb5196ea135e2e7bfbfa9df443162a144ec9ee4))
22+
23+
# [4.0.0-alpha.4](https://github.com/parse-community/Parse-SDK-JS/compare/4.0.0-alpha.3...4.0.0-alpha.4) (2022-12-21)
24+
25+
26+
### Features
27+
28+
* Add Node 16 and 18 support ([#1598](https://github.com/parse-community/Parse-SDK-JS/issues/1598)) ([2c79a31](https://github.com/parse-community/Parse-SDK-JS/commit/2c79a31201d569b645eea475290c9ed0266227fc))
29+
130
# [4.0.0-alpha.3](https://github.com/parse-community/Parse-SDK-JS/compare/4.0.0-alpha.2...4.0.0-alpha.3) (2022-11-18)
231

332

changelogs/CHANGELOG_beta.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
# [4.0.0-beta.1](https://github.com/parse-community/Parse-SDK-JS/compare/3.5.1...4.0.0-beta.1) (2023-01-23)
2+
3+
4+
### Bug Fixes
5+
6+
* `Parse.Query.subscribe()` does not return a rejected promise on error in Cloud Code Triggers `beforeConnect` or `beforeSubscribe` ([#1490](https://github.com/parse-community/Parse-SDK-JS/issues/1490)) ([96d7174](https://github.com/parse-community/Parse-SDK-JS/commit/96d71744e4a12088f98ad33a5f7a0c06c90a0a4c))
7+
* Remove support for Node <14 ([#1603](https://github.com/parse-community/Parse-SDK-JS/issues/1603)) ([bc04b4b](https://github.com/parse-community/Parse-SDK-JS/commit/bc04b4bc0c27d2f517b388dd2dfc17d463faf207))
8+
9+
### Features
10+
11+
* Add Node 16 and 18 support ([#1598](https://github.com/parse-community/Parse-SDK-JS/issues/1598)) ([2c79a31](https://github.com/parse-community/Parse-SDK-JS/commit/2c79a31201d569b645eea475290c9ed0266227fc))
12+
* Add node 19 support ([8ed0fab](https://github.com/parse-community/Parse-SDK-JS/commit/8ed0faba400642571ff90b9645a6e4fcef16c475))
13+
* Add Node 19 support ([#1643](https://github.com/parse-community/Parse-SDK-JS/issues/1643)) ([dfb5196](https://github.com/parse-community/Parse-SDK-JS/commit/dfb5196ea135e2e7bfbfa9df443162a144ec9ee4))
14+
15+
### Performance Improvements
16+
17+
* Avoid CORS preflight request by removing upload listener when not used ([#1610](https://github.com/parse-community/Parse-SDK-JS/issues/1610)) ([6125419](https://github.com/parse-community/Parse-SDK-JS/commit/6125419e749866ffa814a4a3e696382206d5da09))
18+
19+
20+
### BREAKING CHANGES
21+
22+
* Calling `Parse.Query.subscribe()` will now return a rejected promise if an error is thrown in Cloud Code Triggers `beforeConnect` or `beforeSubscribe`; in previous releases a resolved promise was returned, even if subscribing failed and it was necessary to create an `error.on` listener to handle these errors (#1490) ([96d7174](96d7174))
23+
* This release removes support for Node versions <14 ([bc04b4b](bc04b4b))
24+
25+
## [3.5.1-beta.2](https://github.com/parse-community/Parse-SDK-JS/compare/3.5.1-beta.1...3.5.1-beta.2) (2022-11-26)
26+
27+
28+
### Bug Fixes
29+
30+
* SDK builds incorrectly since release 3.5.0 causing various bugs ([#1600](https://github.com/parse-community/Parse-SDK-JS/issues/1600)) ([f15154f](https://github.com/parse-community/Parse-SDK-JS/commit/f15154f903478f997bf127be198097a58c602594))
31+
132
## [3.5.1-beta.1](https://github.com/parse-community/Parse-SDK-JS/compare/3.5.0...3.5.1-beta.1) (2022-11-03)
233

334

changelogs/CHANGELOG_release.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## [3.5.1](https://github.com/parse-community/Parse-SDK-JS/compare/3.5.0...3.5.1) (2022-11-26)
2+
3+
4+
### Bug Fixes
5+
6+
* File upload fails when uploading base64 data ([#1578](https://github.com/parse-community/Parse-SDK-JS/issues/1578)) ([03ee3ff](https://github.com/parse-community/Parse-SDK-JS/commit/03ee3ffd3e4798f9dd958ddc24b9f774cb875507))
7+
* React Native build does not maintain arrow functions and causes error with AsyncStorage ([#1587](https://github.com/parse-community/Parse-SDK-JS/issues/1587)) ([8aeaa4f](https://github.com/parse-community/Parse-SDK-JS/commit/8aeaa4f51e01f5763c497b5e86dca73835e2144b))
8+
* SDK builds incorrectly since release 3.5.0 causing various bugs ([#1600](https://github.com/parse-community/Parse-SDK-JS/issues/1600)) ([f15154f](https://github.com/parse-community/Parse-SDK-JS/commit/f15154f903478f997bf127be198097a58c602594))
9+
110
# [3.5.0](https://github.com/parse-community/Parse-SDK-JS/compare/3.4.4...3.5.0) (2022-11-01)
211

312

integration/test/IdempotencyTest.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

33
const Parse = require('../../node');
4+
const sleep = require('./sleep');
45

56
const Item = Parse.Object.extend('IdempotencyItem');
67
const RESTController = Parse.CoreManager.getRESTController();
@@ -47,6 +48,13 @@ describe('Idempotency', () => {
4748
'Duplicate request'
4849
);
4950

51+
const checkJobStatus = async () => {
52+
const result = await Parse.Cloud.getJobStatus(jobStatusId);
53+
return result && result.get('status') === 'succeeded';
54+
};
55+
while (!(await checkJobStatus())) {
56+
await sleep(100);
57+
}
5058
const jobStatus = await Parse.Cloud.getJobStatus(jobStatusId);
5159
expect(jobStatus.get('status')).toBe('succeeded');
5260
expect(jobStatus.get('params').startedBy).toBe('Monty Python');

integration/test/ParseCloudTest.js

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ const assert = require('assert');
44
const Parse = require('../../node');
55
const sleep = require('./sleep');
66

7+
const waitForJobStatus = async (jobStatusId, status) => {
8+
const checkJobStatus = async () => {
9+
const result = await Parse.Cloud.getJobStatus(jobStatusId);
10+
return result && result.get('status') === status;
11+
};
12+
while (!(await checkJobStatus())) {
13+
await sleep(100);
14+
}
15+
};
16+
717
describe('Parse Cloud', () => {
818
it('run function', done => {
919
const params = { key1: 'value2', key2: 'value1' };
@@ -83,32 +93,23 @@ describe('Parse Cloud', () => {
8393
});
8494
});
8595

86-
it('run job', done => {
96+
it('run job', async () => {
8797
const params = { startedBy: 'Monty Python' };
88-
Parse.Cloud.startJob('CloudJob1', params)
89-
.then(jobStatusId => {
90-
return Parse.Cloud.getJobStatus(jobStatusId);
91-
})
92-
.then(jobStatus => {
93-
assert.equal(jobStatus.get('status'), 'succeeded');
94-
assert.equal(jobStatus.get('params').startedBy, 'Monty Python');
95-
done();
96-
});
98+
const jobStatusId = await Parse.Cloud.startJob('CloudJob1', params);
99+
await waitForJobStatus(jobStatusId, 'succeeded');
100+
101+
const jobStatus = await Parse.Cloud.getJobStatus(jobStatusId);
102+
assert.equal(jobStatus.get('status'), 'succeeded');
103+
assert.equal(jobStatus.get('params').startedBy, 'Monty Python');
97104
});
98105

99106
it('run long job', async () => {
100107
const jobStatusId = await Parse.Cloud.startJob('CloudJob2');
101108

102109
let jobStatus = await Parse.Cloud.getJobStatus(jobStatusId);
103110
assert.equal(jobStatus.get('status'), 'running');
111+
await waitForJobStatus(jobStatusId, 'succeeded');
104112

105-
const checkJobStatus = async () => {
106-
const result = await Parse.Cloud.getJobStatus(jobStatusId);
107-
return result && result.get('status') === 'succeeded';
108-
};
109-
while (!(await checkJobStatus())) {
110-
await sleep(100);
111-
}
112113
jobStatus = await Parse.Cloud.getJobStatus(jobStatusId);
113114
assert.equal(jobStatus.get('status'), 'succeeded');
114115
});
@@ -123,16 +124,13 @@ describe('Parse Cloud', () => {
123124
});
124125
});
125126

126-
it('run failing job', done => {
127-
Parse.Cloud.startJob('CloudJobFailing')
128-
.then(jobStatusId => {
129-
return Parse.Cloud.getJobStatus(jobStatusId);
130-
})
131-
.then(jobStatus => {
132-
assert.equal(jobStatus.get('status'), 'failed');
133-
assert.equal(jobStatus.get('message'), 'cloud job failed');
134-
done();
135-
});
127+
it('run failing job', async () => {
128+
const jobStatusId = await Parse.Cloud.startJob('CloudJobFailing');
129+
await waitForJobStatus(jobStatusId, 'failed');
130+
131+
const jobStatus = await Parse.Cloud.getJobStatus(jobStatusId);
132+
assert.equal(jobStatus.get('status'), 'failed');
133+
assert.equal(jobStatus.get('message'), 'cloud job failed');
136134
});
137135

138136
it('get jobs data', done => {

integration/test/ParseDistTest.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
const puppeteer = require('puppeteer');
2+
let browser = null;
23
let page = null;
34
for (const fileName of ['parse.js', 'parse.min.js']) {
4-
beforeAll(async () => {
5-
const browser = await puppeteer.launch();
6-
page = await browser.newPage();
7-
await page.goto(`http://localhost:1337/${fileName}`);
8-
});
95
describe(`Parse Dist Test ${fileName}`, () => {
6+
beforeEach(async () => {
7+
browser = await puppeteer.launch();
8+
page = await browser.newPage();
9+
await page.goto(`http://localhost:1337/${fileName}`);
10+
});
11+
12+
afterEach(async () => {
13+
await page.close();
14+
await browser.close();
15+
});
16+
1017
it('can save an object', async () => {
1118
const response = await page.evaluate(async () => {
1219
const object = await new Parse.Object('TestObject').save();
@@ -17,6 +24,7 @@ for (const fileName of ['parse.js', 'parse.min.js']) {
1724
expect(obj).toBeDefined();
1825
expect(obj.id).toEqual(response);
1926
});
27+
2028
it('can query an object', async () => {
2129
const obj = await new Parse.Object('TestObject').save();
2230
const response = await page.evaluate(async () => {

0 commit comments

Comments
 (0)