loading...
Cover image for What’s new in the Era of Parse Server v3
SashiDo.io

What’s new in the Era of Parse Server v3

veselinastaneva profile image Vesi Staneva Originally published at blog.sashido.io ・2 min read

Our team is happy to announce that once and for all you have the opportunity to replace the little bit rusty Parse Server v.2.3.3. It is time to a leap ahead into the up-to-date versions! And we're not simply giving you one new version, but whole 3 of them to choose from - v2.8.4, v.3.0.0, and the latest v.3.1.3.

Let’s see some of the fresh advantages they are bringing :)

Cleaner Cloud Code

The improved lightweight Cloud Code syntax is a major advantage that comes with Parse Server v3. Handlers have a new interface based on promises, which achieves a more clear and readable code with the es6 async/await constructs. No need to rely on heavy then/catch blocks and respectively response.success / response.error are to be removed from Cloud Code. Follow our tutorial on how to upgrade your SashiDo app from Parse Server v2 to v3 and you will flawlessly switch to the new syntax.

Parse Server SDK 2.0

Another significant innovation present from v3 is that Cloud Code runs with Parse-SDK 2.0. Many bug fixes are implemented to the 2.0 SDK. Furthermore, containedBy and includeAll query methods are added, together with the option to fetch objects with includes.

Full-text Queries

Up to date, Parse Server has been enriched to add automatic indexing on $text indexes. That makes the search capabilities on text fields much more efficient and allows you to perform Full-Text Search without any hassle or need of workaround solutions.

Request original IP

One more well-known challenge has been resolved in the most recent Parse versions, as presently the request original IP is added to cloud code hooks, which facilitates developers that need to access the user IP easily and utilize it to fetch geolocation for example.

Live Query CLPs

This is definitely an amendment that stands out and it is available in the new Parse versions that SashiDo supports. Its core idea is that CLPs are now passed alongside the object when notifying the LiveQuery server so they are handled without having to access the Database.

Share data object between beforeSave and afterSave

With version 3.0.0 another cool improvement is added to the deck - the ability to pass a context object between beforeSave and afterSave on the same object. Here is how to easily add data between the Triggers:


Parse.Cloud.beforeSave('Review', async request => {
  request.context = {
    comment: 'Great'
  };
});

Parse.Cloud.afterSave('Review', async request => {
  console.info(request.context.comment); //Great
});

Luckily, all these are integrated into the new Parse Versions that SashiDo supports and are now available to you! There are many more changes, which you may check-out in the parse-community GitHub.

Happy Coding with Parse Server v3! :)

Posted on by:

veselinastaneva profile

Vesi Staneva

@veselinastaneva

Firm believer that behind every ⛔ sign, there is a door. Expert in getting 💩 done. Love getting in touch with like-minded people and talking "change"!

SashiDo.io

Build global serverless applications faster with scalable Rest and GraphQL API, object and file storage, built-in CDN, user management, push notifications, system emails, cloud functions and jobs, real-time messages and more out of the box.

Discussion

markdown guide