Skip to content

Commit cbab2b0

Browse files
authored
build: Release (#1664)
2 parents 0d8df83 + 81607f6 commit cbab2b0

24 files changed

+543
-261
lines changed

.github/pull_request_template.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
### Issue Description
1212
<!-- Add a brief description of the issue this PR solves. -->
1313

14-
Related issue: #`FILL_THIS_OUT`
14+
Closes: FILL_THIS_OUT
1515

1616
### Approach
1717
<!-- Add a description of the approach in this PR. -->
@@ -23,5 +23,4 @@ Related issue: #`FILL_THIS_OUT`
2323
-->
2424

2525
- [ ] Add tests
26-
- [ ] Add entry to changelog
27-
- [ ] Add changes to documentation (guides, repository pages, in-code descriptions)
26+
- [ ] Add changes to documentation (guides, repository pages, in-code descriptions)

.github/workflows/ci.yml

Lines changed: 20 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:
@@ -45,3 +58,6 @@ jobs:
4558
env:
4659
CI: true
4760
- run: bash <(curl -s https://codecov.io/bash)
61+
concurrency:
62+
group: ${{ github.workflow }}-${{ github.ref }}
63+
cancel-in-progress: true

.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: 19 additions & 4 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-12,_14,_15-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)
@@ -29,6 +29,7 @@ A library that gives you access to the powerful Parse Server backend from your J
2929

3030
- [Getting Started](#getting-started)
3131
- [Using Parse on Different Platforms](#using-parse-on-different-platforms)
32+
- [Compatibility](#compatibility)
3233
- [Upgrading to Parse SDK 2.0.0](#upgrading-to-parse-sdk-200)
3334
- [3rd Party Authentications](#3rd-party-authentications)
3435
- [Want to ride the bleeding edge?](#want-to-ride-the-bleeding-edge)
@@ -71,7 +72,7 @@ For React Native applications, include `'parse/react-native.js'`:
7172
const Parse = require('parse/react-native.js');
7273

7374
// On React Native >= 0.50 and Parse >= 1.11.0, set the Async
74-
const AsyncStorage = require('react-native').AsyncStorage;
75+
const AsyncStorage = require('@react-native-async-storage/async-storage');
7576
Parse.setAsyncStorage(AsyncStorage);
7677
```
7778

@@ -89,6 +90,20 @@ $ npm install @types/parse
8990

9091
Types are updated manually after every release. If a definition doesn't exist, please submit a pull request to [@types/parse][types-parse]
9192

93+
## Compatibility
94+
95+
### Node.js
96+
97+
Parse JS SDK is continuously tested with the most recent releases of Node.js to ensure compatibility. We follow the [Node.js Long Term Support plan](https://github.com/nodejs/Release) and only test against versions that are officially supported and have not reached their end-of-life date.
98+
99+
| Version | Latest Version | End-of-Life | Compatible |
100+
|------------|----------------|-------------|------------|
101+
| 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 |
105+
106+
92107
## Upgrading to Parse SDK 2.0.0
93108

94109
With Parse SDK 2.0.0, gone are the backbone style callbacks and Parse.Promises.
@@ -113,12 +128,12 @@ And don't forget, if you plan to deploy it remotely, you should run `npm install
113128

114129
We really want Parse to be yours, to see it grow and thrive in the open source community. Please see the [Contributing to Parse Javascript SDK guide][contributing].
115130

116-
131+
117132
[3rd-party-auth]: http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication
118133
[contributing]: https://github.com/parse-community/Parse-SDK-JS/blob/master/CONTRIBUTING.md
119134
[custom-auth-module]: https://docs.parseplatform.org/js/guide/#custom-authentication-module
120135
[link-with]: https://docs.parseplatform.org/js/guide/#linking-users
121136
[migration]: https://github.com/parse-community/Parse-SDK-JS/blob/master/2.0.0.md
122137
[open-collective-link]: https://opencollective.com/parse-server
123-
[types-parse]: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/parse
138+
[types-parse]: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/parse
124139
[license-link]: LICENSE

babel-jest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const babelJest = require('babel-jest');
33
module.exports = babelJest.createTransformer({
44
presets: [["@babel/preset-env", {
55
"targets": {
6-
"node": "8"
6+
"node": "14"
77
},
88
useBuiltIns: 'entry',
99
corejs: 3,

changelogs/CHANGELOG_alpha.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,49 @@
1+
# [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)
2+
3+
4+
### Features
5+
6+
* Add node 19 support ([8ed0fab](https://github.com/parse-community/Parse-SDK-JS/commit/8ed0faba400642571ff90b9645a6e4fcef16c475))
7+
* 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))
8+
9+
# [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)
10+
11+
12+
### Features
13+
14+
* 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))
15+
16+
# [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)
17+
18+
19+
### Performance Improvements
20+
21+
* 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))
22+
23+
# [4.0.0-alpha.2](https://github.com/parse-community/Parse-SDK-JS/compare/4.0.0-alpha.1...4.0.0-alpha.2) (2022-11-15)
24+
25+
26+
### Bug Fixes
27+
28+
* `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))
29+
30+
31+
### BREAKING CHANGES
32+
33+
* 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))
34+
35+
# [4.0.0-alpha.1](https://github.com/parse-community/Parse-SDK-JS/compare/3.5.1-alpha.2...4.0.0-alpha.1) (2022-11-10)
36+
37+
38+
### Bug Fixes
39+
40+
* 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))
41+
42+
43+
### BREAKING CHANGES
44+
45+
* This release removes support for Node versions <14 ([bc04b4b](bc04b4b))
46+
147
## [3.5.1-alpha.2](https://github.com/parse-community/Parse-SDK-JS/compare/3.5.1-alpha.1...3.5.1-alpha.2) (2022-11-07)
248

349

changelogs/CHANGELOG_beta.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
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+
125
## [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)
226

327

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const PRESETS = {
2727
"targets": "> 0.25%, not dead"
2828
}], '@babel/react'],
2929
'node': [["@babel/preset-env", {
30-
"targets": { "node": "8" }
30+
"targets": { "node": "14" }
3131
}]],
3232
'react-native': ['module:metro-react-native-babel-preset'],
3333
};

integration/test/ParseLiveQueryTest.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,4 +256,56 @@ describe('Parse LiveQuery', () => {
256256
object.set({ foo: 'bar' });
257257
await object.save();
258258
});
259+
260+
it('live query can handle beforeConnect and beforeSubscribe errors', async () => {
261+
await reconfigureServer({
262+
cloud({ Cloud }) {
263+
Cloud.beforeSubscribe('TestError', () => {
264+
throw 'not allowed to subscribe';
265+
});
266+
},
267+
});
268+
const client = new Parse.LiveQueryClient({
269+
applicationId: 'integration',
270+
serverURL: 'ws://localhost:1337',
271+
javascriptKey: null,
272+
masterKey: null,
273+
sessionToken: null,
274+
installationId: null,
275+
});
276+
client.open();
277+
const query = new Parse.Query('TestError');
278+
const subscription = client.subscribe(query);
279+
await expectAsync(subscription.subscribePromise).toBeRejectedWith(
280+
new Parse.Error(141, 'not allowed to subscribe')
281+
);
282+
client.close();
283+
});
284+
285+
it('connectPromise does throw', async () => {
286+
await reconfigureServer({
287+
cloud({ Cloud }) {
288+
Cloud.beforeConnect(params => {
289+
if (params.sessionToken === 'testToken') {
290+
throw 'not allowed to connect';
291+
}
292+
});
293+
},
294+
});
295+
const client = new Parse.LiveQueryClient({
296+
applicationId: 'integration',
297+
serverURL: 'ws://localhost:1337',
298+
javascriptKey: null,
299+
masterKey: null,
300+
sessionToken: 'testToken',
301+
installationId: null,
302+
});
303+
client.open();
304+
const query = new Parse.Query('TestError');
305+
const subscription = client.subscribe(query);
306+
await expectAsync(subscription.subscribePromise).toBeRejectedWith(
307+
new Parse.Error(141, 'not allowed to connect')
308+
);
309+
client.close();
310+
});
259311
});

integration/test/ParseObjectTest.js

Lines changed: 25 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,49 +1644,36 @@ describe('Parse Object', () => {
16441644
});
16451645
});
16461646

1647-
it('merges user attributes on fetchAll', done => {
1647+
it('merges user attributes on fetchAll', async () => {
16481648
Parse.User.enableUnsafeCurrentUser();
1649-
let sameUser;
1649+
const acl = new Parse.ACL();
1650+
acl.setPublicReadAccess(true);
16501651
let user = new Parse.User();
16511652
user.set('username', 'asdf');
16521653
user.set('password', 'zxcv');
16531654
user.set('foo', 'bar');
1654-
user
1655-
.signUp()
1656-
.then(() => {
1657-
Parse.User.logOut();
1658-
const query = new Parse.Query(Parse.User);
1659-
return query.get(user.id);
1660-
})
1661-
.then(userAgain => {
1662-
user = userAgain;
1663-
sameUser = new Parse.User();
1664-
sameUser.set('username', 'asdf');
1665-
sameUser.set('password', 'zxcv');
1666-
return sameUser.logIn();
1667-
})
1668-
.then(() => {
1669-
assert(!user.getSessionToken());
1670-
assert(sameUser.getSessionToken());
1671-
sameUser.set('baz', 'qux');
1672-
return sameUser.save();
1673-
})
1674-
.then(() => {
1675-
return Parse.Object.fetchAll([user]);
1676-
})
1677-
.then(() => {
1678-
assert.equal(user.createdAt.getTime(), sameUser.createdAt.getTime());
1679-
assert.equal(user.updatedAt.getTime(), sameUser.updatedAt.getTime());
1680-
return Parse.User.logOut().then(
1681-
() => {
1682-
done();
1683-
},
1684-
() => {
1685-
done();
1686-
}
1687-
);
1688-
})
1689-
.catch(done.fail);
1655+
user.setACL(acl);
1656+
await user.signUp();
1657+
1658+
Parse.User.logOut();
1659+
const query = new Parse.Query(Parse.User);
1660+
user = await query.get(user.id);
1661+
1662+
const sameUser = new Parse.User();
1663+
sameUser.set('username', 'asdf');
1664+
sameUser.set('password', 'zxcv');
1665+
sameUser.setACL(acl);
1666+
await sameUser.logIn();
1667+
1668+
assert(!user.getSessionToken());
1669+
assert(sameUser.getSessionToken());
1670+
sameUser.set('baz', 'qux');
1671+
await sameUser.save();
1672+
1673+
await Parse.Object.fetchAll([user]);
1674+
assert.equal(user.createdAt.getTime(), sameUser.createdAt.getTime());
1675+
assert.equal(user.updatedAt.getTime(), sameUser.updatedAt.getTime());
1676+
await Parse.User.logOut();
16901677
});
16911678

16921679
it('can fetchAllIfNeededWithInclude', async () => {

0 commit comments

Comments
 (0)