diff --git a/.github/ISSUE_TEMPLATE/---report-an-issue.md b/.github/ISSUE_TEMPLATE/---report-an-issue.md index 2c08465e5..21612957b 100644 --- a/.github/ISSUE_TEMPLATE/---report-an-issue.md +++ b/.github/ISSUE_TEMPLATE/---report-an-issue.md @@ -32,6 +32,10 @@ You may also search through existing issues before opening a new one: https://gi +### Test Case + +To accurately reproduce your issue. Add your test cases [here](https://github.com/parse-community/Parse-SDK-JS/tree/master/integration/test) and read the [Contributing Guide](https://github.com/parse-community/Parse-SDK-JS/blob/master/CONTRIBUTING.md) to run the tests. + ### Environment Setup - **Server** diff --git a/Assets/logo large.png b/Assets/img/logo_large.png similarity index 100% rename from Assets/logo large.png rename to Assets/img/logo_large.png diff --git a/CHANGELOG.md b/CHANGELOG.md index d2b70aeaa..ab9ee60b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,102 @@ # Parse-SDK-JS ### master -[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.6.0...master) +[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.11.0...master) + +## 2.11.0 +[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.10.0...2.11.0) + +**New Features** +- Support encrypting current user ([#1036](https://github.com/parse-community/Parse-SDK-JS/pull/1036)) +- File Upload Progress on Wechat ([#1029](https://github.com/parse-community/Parse-SDK-JS/pull/1029)) + +**Improvements** +- Support query.cancel() on Node ([#1030](https://github.com/parse-community/Parse-SDK-JS/pull/1030)) + +**Fixes** +- File Upload Progress on browser ([#1029](https://github.com/parse-community/Parse-SDK-JS/pull/1029)) +- User signup with installationId ([#1031](https://github.com/parse-community/Parse-SDK-JS/pull/1031)) + +## 2.10.0 +[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.9.1...2.10.0) + +**New Features** +- Add query.fromNetwork() ([#1002](https://github.com/parse-community/Parse-SDK-JS/pull/1002)) +- Add query.cancel() (browser only) ([#1003](https://github.com/parse-community/Parse-SDK-JS/pull/1003)) +- Support custom request headers ([#1019](https://github.com/parse-community/Parse-SDK-JS/pull/1019)) + +**Fixes** +- To subclass Parse.User: `Parse.Object.registerSubclass('_User', CustomUser);` + +**Security** +Address Security Advisory of possible leak of sensitive user info. ([#d110617](https://github.com/parse-community/Parse-SDK-JS/commit/d1106174571b699f972929dd7cbb8e45b5283cbb)), big thanks to [Colin Ulin](https://github.com/pocketcolin) for identifying the problem, following the vulnerability disclosure guidelines + +## 2.9.1 +[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.9.0...2.9.1) + +**Fixes** +- Storing user to disk ([#992](https://github.com/parse-community/Parse-SDK-JS/issues/992)) ([#999](https://github.com/parse-community/Parse-SDK-JS/pull/999)) + +## 2.9.0 +[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.8.0...2.9.0) + +**Deprecation** +`_linkWith` and `_logInWith` are deprecated. Replace with `linkWith` and `logInWith` respectively. ([#963](https://github.com/parse-community/Parse-SDK-JS/pull/963)) + +**New Features** +- Set Class Level Permission via Parse.Schema ([#960](https://github.com/parse-community/Parse-SDK-JS/pull/960)) +- Set required fields and default values via Parse.Schema ([#961](https://github.com/parse-community/Parse-SDK-JS/pull/961)) +- Add installationId to LiveQuery ([#977](https://github.com/parse-community/Parse-SDK-JS/pull/977)) +- Add response object to LiveQuery ([#979](https://github.com/parse-community/Parse-SDK-JS/pull/979)) +- Support query.map, query.filter, query.reduce ([#987](https://github.com/parse-community/Parse-SDK-JS/pull/987)) + +**Fixes** +- Can unlink without provider in cloud code ([#971](https://github.com/parse-community/Parse-SDK-JS/pull/971)) +- Properly store User Subclass in Storage ([#978](https://github.com/parse-community/Parse-SDK-JS/pull/978)) + +**Improvements** +- User subclass support for logInWith, hydrate, me, current ([#968](https://github.com/parse-community/Parse-SDK-JS/pull/968)) +- Remove unused options from Parse.Schema ([#959](https://github.com/parse-community/Parse-SDK-JS/pull/959)) +- Documentation for linking users and custom auth ([#963](https://github.com/parse-community/Parse-SDK-JS/pull/963)) +- Generate installationId as uuid v4 ([#972](https://github.com/parse-community/Parse-SDK-JS/pull/972)) +- Reuse StorageController for LDS ([#984](https://github.com/parse-community/Parse-SDK-JS/pull/984)) + +## 2.8.0 +[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.7.1...2.8.0) + +**New Features** +- Parse.File save cancel ([#948](https://github.com/parse-community/Parse-SDK-JS/pull/948)) +- Parse.File getData cancel ([#951](https://github.com/parse-community/Parse-SDK-JS/pull/951)) + +**Fixes** +- React Native Emitter module ([#946](https://github.com/parse-community/Parse-SDK-JS/pull/946)) +- Parse.Schema deleteIndex, deleteField returns Parse.Schema ([#949](https://github.com/parse-community/Parse-SDK-JS/pull/949)) + +**Improvements** +- Compiling on Windows ([#947](https://github.com/parse-community/Parse-SDK-JS/pull/947)) +- Generate _localId as UUID ([#956](https://github.com/parse-community/Parse-SDK-JS/pull/956)) + +## 2.7.1 +[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.7.0...2.7.1) + +**New Features** +- Support for `ParseConfig.save` with `masterKeyOnlyFlags` option ([#910](https://github.com/parse-community/Parse-SDK-JS/pull/910)) (Requires Parse-Server 3.8.0+) +- Support for `ParseConfig.get` with `useMasterKey` option ([#907](https://github.com/parse-community/Parse-SDK-JS/pull/907)) + +## 2.7.0 +[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.6.0...2.7.0) + +**New Features** +- Support for `ParseObject.fetchAllIfNeededWithInclude` ([#900](https://github.com/parse-community/Parse-SDK-JS/pull/900)) +- Support for `ParseObject.exists` ([#898](https://github.com/parse-community/Parse-SDK-JS/pull/898)) +- Support for `ParseObject.save` with `cascadeSave` option ([#881](https://github.com/parse-community/Parse-SDK-JS/pull/881)) + +**Fixes** +- `ParseUser.become` should return subclass ([#897](https://github.com/parse-community/Parse-SDK-JS/pull/897)) +- Ensure LiveQuery subscribes before returning subscription ([#878](https://github.com/parse-community/Parse-SDK-JS/pull/878)) + +**Improvements** +- Remove deprecated `@babel/polyfill` ([#877](https://github.com/parse-community/Parse-SDK-JS/pull/877)) ## 2.6.0 [Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.5.1...2.6.0) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b72229b7b..69b338713 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,7 +34,7 @@ The Parse JS SDK is built for three platforms: - nodejs - react-native -When developing the SDK you can use `npm run watch` in order to rebuild your changes upon each saves. +When developing the SDK you can use `npm run watch` in order to rebuild your changes upon each save. By default, the watch command will rebuild the SDK for the browser platform. The following commands will rebuild changes for a specific platform. @@ -44,7 +44,7 @@ By default, the watch command will rebuild the SDK for the browser platform. The ### Testing the code -The SDK is tested through two lenses. unit tests are run with jest and integrationt tests with jasmine. +The SDK is tested through two lenses. unit tests are run with jest and integration tests with jasmine. Two different frameworks are used as the integration tests leverage a stateful server, with the data saved into the database, and Jest is running many tests in parallel, which makes it incompatible with our integration tests. @@ -54,12 +54,11 @@ Those tests are located in [/src/__tests__](/src/__tests__) and are responsible To run unit tests, run `npm test`. If you have the vscode Jest plugin extension (as recommended), you can run your tests by clicking the *Debug* lens that appears near by the test. - #### Integration tests Those tests are located in [/integration/test](/integration/test) and are responsible for ensuring a proper communication with parse-server. With the integration tests, we ensure all communications between the SDK and the server are behaving accordingly. -To run the integtation tests, you will need a valid mongodb running on your local machine. You can get easily mongodb running with `mongodb-runner` (see [Recommended setup](#recommended-setup)). +To run the integration tests, you will need a valid mongodb running on your local machine. You can get easily mongodb running with `mongodb-runner` (see [Recommended setup](#recommended-setup)). Use `npm run integration` in order to run the integration tests. If you have the vscode Jasmine extension installed (as recommended), you can run your tests by clicking the *Run* or the *Debug* lens that appears near by the test. diff --git a/README.md b/README.md index df260973a..f9f9f31ec 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@
-
-
+
Response Object - Contains data from the client that made the request + *
Open Event - When you call query.subscribe(), we send a subscribe request to * the LiveQuery server, when we get the confirmation from the LiveQuery server, @@ -26,7 +32,7 @@ import { resolvingPromise } from './promiseUtils'; * you'll also get this event. * *
- * subscription.on('open', () => {
+ * subscription.on('open', (response) => {
*
* });
*
@@ -34,7 +40,7 @@ import { resolvingPromise } from './promiseUtils';
* you'll get this event. The object is the ParseObject which is created.
*
*
- * subscription.on('create', (object) => {
+ * subscription.on('create', (object, response) => {
*
* });
*
@@ -46,7 +52,7 @@ import { resolvingPromise } from './promiseUtils';
* Parse-Server 3.1.3+ Required for original object parameter
*
*
- * subscription.on('update', (object, original) => {
+ * subscription.on('update', (object, original, response) => {
*
* });
*
@@ -57,7 +63,7 @@ import { resolvingPromise } from './promiseUtils';
* Parse-Server 3.1.3+ Required for original object parameter
*
*
- * subscription.on('enter', (object, original) => {
+ * subscription.on('enter', (object, original, response) => {
*
* });
*
@@ -67,7 +73,7 @@ import { resolvingPromise } from './promiseUtils';
* which leaves the ParseQuery. Its content is the latest value of the ParseObject.
*
*
- * subscription.on('leave', (object) => {
+ * subscription.on('leave', (object, response) => {
*
* });
*
@@ -76,7 +82,7 @@ import { resolvingPromise } from './promiseUtils';
* get this event. The object is the ParseObject which is deleted.
*
*
- * subscription.on('delete', (object) => {
+ * subscription.on('delete', (object, response) => {
*
* });
*
diff --git a/src/LocalDatastore.js b/src/LocalDatastore.js
index 7b1c4a8f9..6e6423708 100644
--- a/src/LocalDatastore.js
+++ b/src/LocalDatastore.js
@@ -406,11 +406,7 @@ module.exports = LocalDatastore;
if (process.env.PARSE_BUILD === 'react-native') {
CoreManager.setLocalDatastoreController(require('./LocalDatastoreController.react-native'));
-} else if (process.env.PARSE_BUILD === 'browser') {
- CoreManager.setLocalDatastoreController(require('./LocalDatastoreController.browser'));
-} else if (process.env.PARSE_BUILD === 'weapp') {
- CoreManager.setLocalDatastoreController(require('./LocalDatastoreController.weapp'));
} else {
- CoreManager.setLocalDatastoreController(require('./LocalDatastoreController.default'));
+ CoreManager.setLocalDatastoreController(require('./LocalDatastoreController'));
}
CoreManager.setLocalDatastore(LocalDatastore);
diff --git a/src/LocalDatastoreController.default.js b/src/LocalDatastoreController.default.js
deleted file mode 100644
index 524472169..000000000
--- a/src/LocalDatastoreController.default.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Copyright (c) 2015-present, Parse, LLC.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- * @flow
- */
-import { isLocalDatastoreKey } from './LocalDatastoreUtils';
-
-const memMap = {};
-const LocalDatastoreController = {
- fromPinWithName(name: string): Array