Parse JavaScript SDK

repository·alpha·Indexed 23 days ago

https://github.com/parse-community/parse-sdk-js

The JavaScript/TypeScript SDK for interacting with Parse Server, providing a high-level API for managing data, users, and files in a Parse-based backend. It includes support for LiveQuery subscriptions, aggregate queries, Cloud Function invocation, and binary file uploads via Buffer or Stream.

Tokens
12.6K
Snippets
13
Records
150
Agent score
78%

What's inside parse-sdk-js

  1. Handle Parse.Query.subscribe() errors with Promises

    alpha

    Starting from version 4.0.0-beta.1, calling Parse.Query.subscribe() returns a rejected promise if an error is thrown in Cloud Code Triggers such as beforeConnect or beforeSubscribe.

    In previous versions, this method returned a resolved promise even if the subscription failed, requiring developers to use an error.on listener to catch errors. You should now use standard Promise .catch() or try/catch blocks to handle subscription errors.

  2. Handle Parse.Query.subscribe errors as rejected promises

    alpha

    BREAKING CHANGE (v4.0.0)

    In version 4.0.0, calling Parse.Query.subscribe() now returns a rejected promise if an error occurs in Cloud Code Triggers (beforeConnect or beforeSubscribe).

    Previous Behavior: In versions prior to 4.0.0, the promise would resolve even if the subscription failed, requiring developers to use an error.on listener to catch errors.

    New Behavior: You should now use .catch() or a try/catch block when calling .subscribe() to handle subscription failures.

  3. Handle Parse.Query.subscribe() errors in Cloud Code

    alpha

    In version 4.0.0-alpha.2, the behavior of Parse.Query.subscribe() was changed to improve error handling. If an error is thrown in Cloud Code Triggers such as beforeConnect or beforeSubscribe, the subscribe() method will now return a rejected promise.

    In versions prior to 4.0.0-alpha.2, the method returned a resolved promise even if the subscription failed, requiring developers to manually attach an error.on listener to catch these failures.

  4. Use native Promises instead of Parse.Promise

    alpha
    Starting from version 2.0.0, Parse.Promise has been replaced by native JavaScript Promises. Additionally, Backbone-style callbacks have been removed. If you are upgrading from a version prior to 2.0.0, you must update your code to use standard .then() and .catch() syntax or async/await instead of passing callbacks to Parse methods.
  5. Handle validation errors in Parse.Object methods

    alpha
    Starting with version 6.0.0-alpha.1, the error option has been removed from several Parse.Object methods, including .set(), .setACL(), .unset(), and Parse.Role.setName. These methods now throw an error immediately upon validation failure instead of passing the error to a handler. You should wrap these calls in a try/catch block.
  6. Enable Idempotency for client requests

    alpha

    In version 2.16.0, experimental idempotency enforcement was added to deduplicate requests where network issues might cause the server to receive the same request multiple times. This requires Parse Server 4.3.0+.

    Caution: This is an experimental feature and may not be appropriate for production.

    You can enable it using one of the following methods: