-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
feat: Asynchronous initialization of Parse Server #8232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 112 commits
Commits
Show all changes
115 commits
Select commit
Hold shift + click to select a range
abe43a0
feat: Parse Server async initialization
dblythy 0505f83
Update DefinedSchemas.js
dblythy b7e9d74
add state
dblythy 3134010
Update index.spec.js
dblythy aefbeef
Update index.spec.js
dblythy 81413a4
remove silent
dblythy b5965a5
fix tests
dblythy 52d5c89
Update helper.js
dblythy 12f7889
Update ParseServer.js
dblythy 4284b8d
Update ParseServer.js
dblythy ac4ee2b
Update ParseServer.js
dblythy 315bbf1
Update middlewares.js
dblythy 2d27b7b
add state
dblythy 1df0e7e
Merge branch 'alpha' into server-start
mtrezza d7eefa9
Merge branch 'alpha' into server-start
mtrezza 4ba3d68
refactor
dblythy 64f6eae
Update helper.js
dblythy c592345
Update helper.js
dblythy de2a4fd
Merge branch 'alpha' into server-start
dblythy 25d1180
tests
dblythy 72c7b56
prettier
dblythy 73b0eb9
tests
dblythy fc2473b
tests
dblythy 1e72a89
Update ParseServer.spec.js
dblythy 69466b4
Update ParseServer.spec.js
dblythy b27f0ad
Update helper.js
dblythy 48cb44f
failing server
dblythy f6331fc
refactor
dblythy 59a4741
Merge branch 'alpha' into server-start
dblythy 8dc3615
fix lint
dblythy 89828ed
Update CLI.spec.js
dblythy 7800b41
Update index.spec.js
dblythy 84c0440
Update CLI.spec.js
dblythy c1cd6e0
Update CLI.spec.js
dblythy 73391f1
tests
dblythy e033ff7
test
dblythy f2759e0
Update CLI.spec.js
dblythy 72093ed
Update ParseServer.js
dblythy 513ca5a
tests
dblythy f53dd45
Merge branch 'alpha' into server-start
dblythy cd4fa9b
Update CLI.spec.js
dblythy 7f6c8df
Merge branch 'server-start' of https://github.com/dblythy/parse-serve…
dblythy 6845970
test
dblythy e1cca15
test
dblythy 0724733
test wip
dblythy 95b96d8
fix
dblythy 4d654a8
wip
dblythy dc56ccb
Update CLI.spec.js
dblythy 3fe14f4
Update MongoStorageAdapter.js
dblythy c582da6
Update CLI.spec.js
dblythy 9d1a67f
Update DatabaseController.js
dblythy 2ac1a13
test
dblythy 3b74aa4
wip
dblythy 66798bf
Update CLI.spec.js
dblythy 73e8f30
wip
dblythy 536bc6f
Update CLI.spec.js
dblythy 75e534d
Update CLI.spec.js
dblythy 6341429
Update ParseServer.js
dblythy 86cb20a
Update CLI.spec.js
dblythy acf77f9
Update CLI.spec.js
dblythy 70ea8da
Update MongoStorageAdapter.js
dblythy 2bad679
Update MongoStorageAdapter.js
dblythy 4573cb1
Update MongoStorageAdapter.js
dblythy 0535b25
Update MongoStorageAdapter.js
dblythy a4816a2
Update CLI.spec.js
dblythy 4b76898
Update CLI.spec.js
dblythy c4967af
revert to spawn
dblythy 7f20278
Update CLI.spec.js
dblythy 53a8c4a
Update CLI.spec.js
dblythy e952c41
wip
dblythy 9161f78
Update MongoStorageAdapter.js
dblythy 85cee10
Update CLI.spec.js
dblythy 148363a
revert
dblythy e665838
test
dblythy 465a8ba
fix tests
dblythy 273a532
Update index.js
dblythy a6ba538
Update CLI.spec.js
dblythy 1a41153
Update CLI.spec.js
dblythy b307dad
Update index.spec.js
dblythy 816b5e7
readme
dblythy fb5a835
add databaseURI
dblythy d5b4e8b
Merge branch 'alpha' into server-start
dblythy c002500
Update src/ParseServer.js
dblythy 126e6a9
changes
dblythy 0f83fdd
wip
dblythy 7966601
lint
dblythy 6546087
Update README.md
dblythy 147966b
Update README.md
dblythy 1ec6b51
push
dblythy 8c5d223
Update README.md
dblythy 26c87f9
Update README.md
dblythy 5623ff4
Update README.md
dblythy 4d30eda
add readme docs
mtrezza 9641217
Update ParseServer.js
dblythy 8bc8290
Update ParseServer.js
dblythy 90cc616
Update ParseServer.js
dblythy f9adde8
test
dblythy 0471e60
wip
dblythy c5bcc2b
wip
dblythy 840e667
change
dblythy f8019db
wip
dblythy 7d7a77a
module file
dblythy 10ee837
Update ParseServer.js
dblythy b94de0e
Merge branch 'alpha' into server-start
mtrezza a3f481f
add migration guide
mtrezza 1645b07
improve migration guide
mtrezza 24d493e
fix migration guide typo
mtrezza fcde184
migration typo fix
mtrezza ef739db
Update 6.0.0.md
dblythy 6de7d89
Update 6.0.0.md
mtrezza 66286b2
add import statement to migration
mtrezza 69e4b90
add retry
dblythy 2740590
Merge branch 'alpha' into server-start
mtrezza 91c4ccd
Merge branch 'alpha' into server-start
mtrezza f9b2eee
Merge branch 'alpha' into server-start
mtrezza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Parse Server 6 Migration Guide <!-- omit in toc --> | ||
|
||
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). | ||
|
||
--- | ||
|
||
- [Import Statement](#import-statement) | ||
- [Asynchronous Initialization](#asynchronous-initialization) | ||
|
||
--- | ||
|
||
## Import Statement | ||
|
||
The import and initialization syntax has been simplified with more intuitive naming and structure. | ||
|
||
*Parse Server 5:* | ||
```js | ||
// Returns a Parse Server instance | ||
const ParseServer = require('parse-server'); | ||
|
||
// Returns a Parse Server express middleware | ||
const { ParseServer } = require('parse-server'); | ||
``` | ||
|
||
*Parse Server 6:* | ||
```js | ||
// Both return a Parse Server instance | ||
const ParseServer = require('parse-server'); | ||
const { ParseServer } = require('parse-server'); | ||
``` | ||
|
||
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. | ||
|
||
## Asynchronous Initialization | ||
|
||
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. | ||
|
||
*Parse Server 5:* | ||
```js | ||
// 1. Import Parse Server | ||
const { ParseServer } = require('parse-server'); | ||
|
||
// 2. Create a Parse Server instance as express middleware | ||
const server = new ParseServer(config); | ||
|
||
// 3. Mount express middleware | ||
app.use("/parse", server); | ||
``` | ||
|
||
*Parse Server 6:* | ||
```js | ||
// 1. Import Parse Server | ||
const ParseServer = require('parse-server'); | ||
|
||
// 2. Create a Parse Server instance | ||
const server = new ParseServer(config); | ||
|
||
// 3. Start up Parse Server asynchronously | ||
await server.start(); | ||
|
||
// 4. Mount express middleware | ||
app.use("/parse", server.app); | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.