Skip to content

Commit ed15b95

Browse files
authored
Merge branch 'alpha' into forgotPassword
2 parents 1815923 + d19acf1 commit ed15b95

30 files changed

+25065
-4845
lines changed

.babelrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
"presets": [
77
["@babel/preset-env", {
88
"targets": {
9-
"node": "14"
10-
}
9+
"node": "14",
10+
},
11+
"exclude": ["proposal-dynamic-import"]
1112
}]
1213
],
1314
"sourceMaps": "inline"

.eslintrc.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
"node": true,
66
"es6": true
77
},
8-
"parser": "babel-eslint",
8+
"parser": "@babel/eslint-parser",
99
"plugins": [
1010
"flowtype"
1111
],
1212
"parserOptions": {
1313
"ecmaVersion": 6,
14-
"sourceType": "module"
14+
"sourceType": "module",
15+
"requireConfigFile": false
1516
},
1617
"rules": {
1718
"indent": ["error", 2, { "SwitchCase": 1 }],

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137
- name: Check NPM lock file version
138138
uses: mansona/npm-lockfile-version@v1
139139
with:
140-
version: 1
140+
version: 2
141141
check-mongo:
142142
strategy:
143143
matrix:

6.0.0.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Parse Server 6 Migration Guide <!-- omit in toc -->
2+
3+
This document only highlights specific changes that require a longer explanation. For a full list of changes in Parse Server 6 please refer to the [changelog](https://github.com/parse-community/parse-server/blob/alpha/CHANGELOG.md).
4+
5+
---
6+
7+
- [Import Statement](#import-statement)
8+
- [Asynchronous Initialization](#asynchronous-initialization)
9+
10+
---
11+
12+
## Import Statement
13+
14+
The import and initialization syntax has been simplified with more intuitive naming and structure.
15+
16+
*Parse Server 5:*
17+
```js
18+
// Returns a Parse Server instance
19+
const ParseServer = require('parse-server');
20+
21+
// Returns a Parse Server express middleware
22+
const { ParseServer } = require('parse-server');
23+
```
24+
25+
*Parse Server 6:*
26+
```js
27+
// Both return a Parse Server instance
28+
const ParseServer = require('parse-server');
29+
const { ParseServer } = require('parse-server');
30+
```
31+
32+
To get the express middleware in Parse Server 6, configure the Parse Server instance, start Parse Server and use its `app` property. See [Asynchronous Initialization](#asynchronous-initialization) for more details.
33+
34+
## Asynchronous Initialization
35+
36+
Previously, it was possible to mount Parse Server before it was fully started up and ready to receive requests. This could result in undefined behavior, such as Parse Objects could be saved before Cloud Code was registered. To prevent this, Parse Server 6 requires to be started asynchronously before being mounted.
37+
38+
*Parse Server 5:*
39+
```js
40+
// 1. Import Parse Server
41+
const { ParseServer } = require('parse-server');
42+
43+
// 2. Create a Parse Server instance as express middleware
44+
const server = new ParseServer(config);
45+
46+
// 3. Mount express middleware
47+
app.use("/parse", server);
48+
```
49+
50+
*Parse Server 6:*
51+
```js
52+
// 1. Import Parse Server
53+
const ParseServer = require('parse-server');
54+
55+
// 2. Create a Parse Server instance
56+
const server = new ParseServer(config);
57+
58+
// 3. Start up Parse Server asynchronously
59+
await server.start();
60+
61+
// 4. Mount express middleware
62+
app.use("/parse", server.app);
63+
```

README.md

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ A big *thank you* 🙏 to our [sponsors](#sponsors) and [backers](#backers) who
4040

4141
---
4242

43-
- [Flavors & Branches](#flavors--branches)
43+
- [Flavors \& Branches](#flavors--branches)
4444
- [Long Term Support](#long-term-support)
4545
- [Getting Started](#getting-started)
4646
- [Running Parse Server](#running-parse-server)
@@ -55,6 +55,8 @@ A big *thank you* 🙏 to our [sponsors](#sponsors) and [backers](#backers) who
5555
- [Running Parse Server elsewhere](#running-parse-server-elsewhere)
5656
- [Sample Application](#sample-application)
5757
- [Parse Server + Express](#parse-server--express)
58+
- [Parse Server Health](#parse-server-health)
59+
- [Status Values](#status-values)
5860
- [Configuration](#configuration)
5961
- [Basic Options](#basic-options)
6062
- [Client Key Options](#client-key-options)
@@ -136,13 +138,13 @@ Parse Server is continuously tested with the most recent releases of Node.js to
136138

137139
Parse Server is continuously tested with the most recent releases of MongoDB to ensure compatibility. We follow the [MongoDB support schedule](https://www.mongodb.com/support-policy) and [MongoDB lifecycle schedule](https://www.mongodb.com/support-policy/lifecycles) and only test against versions that are officially supported and have not reached their end-of-life date. We consider the end-of-life date of a MongoDB "rapid release" to be the same as its major version release.
138140

139-
| Version | Latest Version | End-of-Life | Compatible |
140-
|-------------|----------------|---------------|--------------|
141-
| MongoDB 4.0 | 4.0.28 | April 2022 | ✅ Yes |
142-
| MongoDB 4.2 | 4.2.19 | April 2023 | ✅ Yes |
143-
| MongoDB 4.4 | 4.4.13 | February 2024 | ✅ Yes |
144-
| MongoDB 5 | 5.3.2 | October 2024 | ✅ Yes |
145-
| MongoDB 6 | 6.0.2 | July 2025 | ✅ Yes |
141+
| Version | Latest Version | End-of-Life | Compatible |
142+
|-------------|----------------|---------------|------------|
143+
| MongoDB 4.0 | 4.0.28 | April 2022 | ✅ Yes |
144+
| MongoDB 4.2 | 4.2.19 | April 2023 | ✅ Yes |
145+
| MongoDB 4.4 | 4.4.13 | February 2024 | ✅ Yes |
146+
| MongoDB 5 | 5.3.2 | October 2024 | ✅ Yes |
147+
| MongoDB 6 | 6.0.2 | July 2025 | ✅ Yes |
146148

147149
#### PostgreSQL
148150

@@ -282,11 +284,11 @@ We have provided a basic [Node.js application](https://github.com/parse-communit
282284
You can also create an instance of Parse Server, and mount it on a new or existing Express website:
283285

284286
```js
285-
var express = require('express');
286-
var ParseServer = require('parse-server').ParseServer;
287-
var app = express();
287+
const express = require('express');
288+
const ParseServer = require('parse-server').ParseServer;
289+
const app = express();
288290

289-
var api = new ParseServer({
291+
const server = new ParseServer({
290292
databaseURI: 'mongodb://localhost:27017/dev', // Connection string for your MongoDB database
291293
cloud: './cloud/main.js', // Path to your Cloud Code
292294
appId: 'myAppId',
@@ -295,8 +297,11 @@ var api = new ParseServer({
295297
serverURL: 'http://localhost:1337/parse' // Don't forget to change to https if needed
296298
});
297299

300+
// Start server
301+
await server.start();
302+
298303
// Serve the Parse API on the /parse URL prefix
299-
app.use('/parse', api);
304+
app.use('/parse', server.app);
300305

301306
app.listen(1337, function() {
302307
console.log('parse-server-example running on port 1337.');
@@ -305,6 +310,27 @@ app.listen(1337, function() {
305310

306311
For a full list of available options, run `parse-server --help` or take a look at [Parse Server Configurations](http://parseplatform.org/parse-server/api/master/ParseServerOptions.html).
307312

313+
## Parse Server Health
314+
315+
Check the Parse Server health by sending a request to the `/parse/health` endpoint.
316+
317+
The response looks like this:
318+
319+
```json
320+
{
321+
"status": "ok"
322+
}
323+
```
324+
325+
### Status Values
326+
327+
| Value | Description |
328+
|---------------|-----------------------------------------------------------------------------|
329+
| `initialized` | The server has been created but the `start` method has not been called yet. |
330+
| `starting` | The server is starting up. |
331+
| `ok` | The server started and is running. |
332+
| `error` | There was a startup error, see the logs for details. |
333+
308334
# Configuration
309335

310336
Parse Server can be configured using the following options. You may pass these as parameters when running a standalone `parse-server`, or by loading a configuration file in JSON format using `parse-server path/to/configuration.json`. If you're using Parse Server on Express, you may also pass these to the `ParseServer` object as options.
@@ -461,7 +487,7 @@ The following paths are already used by Parse Server's built-in features and are
461487
It’s possible to change the default pages of the app and redirect the user to another path or domain.
462488

463489
```js
464-
var server = ParseServer({
490+
const server = ParseServer({
465491
...otherOptions,
466492
467493
customPages: {
@@ -851,7 +877,7 @@ Then, create an `index.js` file with the following content:
851877
852878
```js
853879
const express = require('express');
854-
const { default: ParseServer, ParseGraphQLServer } = require('parse-server');
880+
const { ParseServer, ParseGraphQLServer } = require('parse-server');
855881

856882
const app = express();
857883

@@ -875,6 +901,7 @@ app.use('/parse', parseServer.app); // (Optional) Mounts the REST API
875901
parseGraphQLServer.applyGraphQL(app); // Mounts the GraphQL API
876902
parseGraphQLServer.applyPlayground(app); // (Optional) Mounts the GraphQL Playground - do NOT use in Production
877903

904+
await parseServer.start();
878905
app.listen(1337, function() {
879906
console.log('REST API running on http://localhost:1337/parse');
880907
console.log('GraphQL API running on http://localhost:1337/graphql');

changelogs/CHANGELOG_alpha.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
1+
# [6.0.0-alpha.17](https://github.com/parse-community/parse-server/compare/6.0.0-alpha.16...6.0.0-alpha.17) (2022-12-22)
2+
3+
4+
### Features
5+
6+
* Upgrade Node Package Manager lock file `package-lock.json` to version 2 ([#8285](https://github.com/parse-community/parse-server/issues/8285)) ([ee72467](https://github.com/parse-community/parse-server/commit/ee7246733d63e4bda20401f7b00262ff03299f20))
7+
8+
9+
### BREAKING CHANGES
10+
11+
* The Node Package Manager lock file `package-lock.json` is upgraded to version 2; while it is backwards with version 1 for the npm installer, consider this if you run any non-npm analysis tools that use the lock file (#8285) ([ee72467](ee72467))
12+
13+
# [6.0.0-alpha.16](https://github.com/parse-community/parse-server/compare/6.0.0-alpha.15...6.0.0-alpha.16) (2022-12-21)
14+
15+
16+
### Features
17+
18+
* Asynchronous initialization of Parse Server ([#8232](https://github.com/parse-community/parse-server/issues/8232)) ([99fcf45](https://github.com/parse-community/parse-server/commit/99fcf45e55c368de2345b0c4d780e70e0adf0e15))
19+
20+
21+
### BREAKING CHANGES
22+
23+
* This release introduces the asynchronous initialization of Parse Server to prevent mounting Parse Server before being ready to receive request; it changes how Parse Server is imported, initialized and started; it also removes the callback `serverStartComplete`; see the [Parse Server 6 migration guide](https://github.com/parse-community/parse-server/blob/alpha/6.0.0.md) for more details (#8232) ([99fcf45](99fcf45))
24+
25+
# [6.0.0-alpha.15](https://github.com/parse-community/parse-server/compare/6.0.0-alpha.14...6.0.0-alpha.15) (2022-12-20)
26+
27+
28+
### Bug Fixes
29+
30+
* Nested objects are encoded incorrectly for MongoDB ([#8209](https://github.com/parse-community/parse-server/issues/8209)) ([1412666](https://github.com/parse-community/parse-server/commit/1412666f75829612de6fb9d7ccae35761c9b75cb))
31+
32+
33+
### BREAKING CHANGES
34+
35+
* Nested objects are now properly stored in the database using JSON serialization; previously, due to a bug only top-level objects were serialized, but nested objects were saved as raw JSON; for example, a nested `Date` object was saved as a JSON object like `{ "__type": "Date", "iso": "2020-01-01T00:00:00.000Z" }` instead of its serialized representation `2020-01-01T00:00:00.000Z` (#8209) ([1412666](1412666))
36+
137
# [6.0.0-alpha.14](https://github.com/parse-community/parse-server/compare/6.0.0-alpha.13...6.0.0-alpha.14) (2022-12-16)
238

339

0 commit comments

Comments
 (0)