diff --git a/2.0.0.md b/2.0.0.md deleted file mode 100644 index 9e9259064..000000000 --- a/2.0.0.md +++ /dev/null @@ -1,105 +0,0 @@ -# Upgrading Parse SDK to version 2.0.0 - -With Parse SDK 2.0.0, gone are the backbone style callbacks and Parse.Promises. - -Instead, the Parse SDK 2.0.0 uses native promises in the browser, node and react native that allows for a more standard API. - -Migrating to native Promises should be straightforward, we'll recap the different changes: - -## `.done()` and `.fail()` continuations - -With native promises, `.done` and `.fail` don't exist and are replaces by `.then` and `.catch` - -```js -// before -const query = new Parse.Query(); -query.find() -.done((results) => { - -}) -.fail((error) => { - -}); - -// after -query.find() -.then((results) => { - -}) -.catch((error) => { - -}); -``` - -## `.always()` is replaced by `.finally()` - -```js -// before -const query = new Parse.Query(); -query.find() -.always((result) => { - -}); - -// after -query.find() -.finally((result) => { - -}); -``` - -## `new Parse.Promise()` - -With native promises, the constructor is different, you will need to update to the native constructor which requires moving the code around. - -```js -// before -const promise = new Parse.Promise(); -doSomethingAsync((error, success) => { - if (error) { promise.reject(error); } - else { promise.resolve(success); } -}); -return promise; - -// after -return new Promise((resolve, reject) => { - doSomethingAsync((error, success) => { - if (error) { reject(error); } - else { resolve(success); } - }); -}); -``` - -## Static methods - -- `Parse.Promise.as` is replaced by `Promise.resolve` -- `Parse.Promise.error` is replaced by `Promise.reject` -- `Parse.Promise.when` is replaced by `Promise.all` - -:warning: `Promise.all` only takes an array or an iterable promises. - -```js -// before -Parse.Promise.when(promise1, promise2, promise3) -.then((result1, result2, result3) => { - -}); - -// after -Promise.all([promise1, promise2, promise3]) -.then(([result1, result2, result3]) => { - -}); -``` - -:warning: Whereas `Parse.Promise.always`, `Promise.finally` callback don't receive any arguments, and don't resolve with a new argument to pass to the next promise in chain. - -```js -// before -Parse.Promise.as(1).always((val) => val + 1).then((result) => console.log(result)) -// will print 2 - -// after -Promise.resolve(1).finally(() => 2).then((result) => console.log(result)) -// will print 1 -``` diff --git a/README.md b/README.md index fb7a38ae9..b806ff10a 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,8 @@ A library that gives you access to the powerful Parse Server backend from your J - [Getting Started](#getting-started) - [Using Parse on Different Platforms](#using-parse-on-different-platforms) - [Compatibility](#compatibility) + - [Parse Server](#parse-server) - [Node.js](#nodejs) -- [Upgrading to Parse SDK 2.0.0](#upgrading-to-parse-sdk-200) - [3rd Party Authentications](#3rd-party-authentications) - [Experimenting](#experimenting) - [Contributing](#contributing) @@ -91,21 +91,23 @@ Types are updated manually after every release. If a definition doesn't exist, p ## Compatibility +### Parse Server + +Parse JS SDK is compatible with the following versions of Parse Server. + +| Parse JS SDK | Parse Server | +|--------------|--------------| +| <= 4.x.x | 6.x.x | +| 5.x.x | 7.x.x | + ### Node.js 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. | Version | Latest Version | End-of-Life | Compatible | |------------|----------------|-------------|------------| -| Node.js 18 | 18.19.0 | April 2025 | ✅ Yes | -| Node.js 20 | 20.10.0 | April 2026 | ✅ Yes | - - -## Upgrading to Parse SDK 2.0.0 - -With Parse SDK 2.0.0, gone are the backbone style callbacks and Parse.Promises. - -We have curated a [migration guide][migration] that should help you migrate your code. +| Node.js 18 | 18.19.0 | April 2025 | ✅ Yes | +| Node.js 20 | 20.10.0 | April 2026 | ✅ Yes | ## 3rd Party Authentications @@ -130,6 +132,5 @@ We really want Parse to be yours, to see it grow and thrive in the open source c [contributing]: https://github.com/parse-community/Parse-SDK-JS/blob/master/CONTRIBUTING.md [custom-auth-module]: https://docs.parseplatform.org/js/guide/#custom-authentication-module [link-with]: https://docs.parseplatform.org/js/guide/#linking-users -[migration]: https://github.com/parse-community/Parse-SDK-JS/blob/master/2.0.0.md [open-collective-link]: https://opencollective.com/parse-server [types-parse]: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/parse