We want to make contributing to this project as easy and transparent as possible.
If you're looking to get started, but want to ease yourself into the codebase, look for issues tagged good first task. These are simple yet valuable tasks that should be easy to get started.
Our goal is to keep master
stable, but there may be changes that your application may not be compatible with. We'll do our best to publicize any breaking changes, but try to use our specific releases in any production environment.
- vscode, the popular IDE.
- Jest Extension the Jest extension for vscode to run the tests inline and debug quicky.
- Jasmine Test Explorer Extension, a very practical test exploration plugin which let you run, debug and see the test results inline.
- mongodb-runner Easily install and run MongoDB to test your code against it. (install with
npm install -g mongodb-runner
)
- Fork this project and clone the fork on your local machine:
$ git clone https://github.com/parse-community/Parse-SDK-JS
$ cd Parse-SDK-JS # go into the clone directory
$ npm install # install all the node dependencies
$ code . # launch vscode
The Parse JS SDK is built for three platforms:
- The browser
- nodejs
- react-native
When developing the SDK you can use npm run watch
in order to rebuild your changes upon each saves.
By default, the watch command will rebuild the SDK for the node platform. You can toggle this by setting the environment variable PARSE_BUILD. Valid values are:
- node
- browser
- react-native
The SDK is tested through two lenses. unit tests are run with jest and integrationt 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.
Those tests are located in /src/tests and are responsible for ensuring each class is behaving as expected, without considering the rest of the system. For example, adding a new query helper function would probably require to add relevant tests that ensure the query is properly serialized to a valid Parse REST query object. Unit tests heavily leverage mocking and are an essential part of our testing harness.
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.
Those tests are located in /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).
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.
We actively welcome your pull requests. When we get one, we'll run some Parse-specific integration tests on it first. From here, we'll need to get a core member to sign off on the changes and then merge the pull request. For API changes we may need to fix internal uses, which could cause some delay. We'll do our best to provide updates and feedback throughout the process.
- Fork the repo and create your branch from
master
. - Add unit tests for any new code you add.
- If you've changed APIs, update the documentation.
- Ensure the test suite passes. (run
npm test && npm run integration
) - Make sure your code lints.
We use GitHub issues to track public bugs. We will keep a close eye on this and try to make it clear when we have an internal fix in progress. Before filing a new issue, try to make sure your problem doesn't already exist.
Not all issues are SDK issues. If you're unsure whether your bug is with the SDK or backend, you can test to see if it reproduces with our REST API and Parse API Console. If it does, you can report backend bugs here. If the issue only reproduces with the JS SDK, you can open an issue on this repository.
Details are key. The more information you provide us the easier it'll be for us to debug and the faster you'll receive a fix. Some examples of useful tidbits:
- A description. What did you expect to happen and what actually happened? Why do you think that was wrong?
- A simple unit test that fails. Refer here for examples of existing unit tests and here for integration tests examples. See for how to setup your machine and run unit tests in this guide. You can submit a pull request with your failing unit test so that our CI verifies that the test fails.
- What version does this reproduce on? What version did it last work on?
- Stacktrace or GTFO. In all honesty, full stacktraces with line numbers make a happy developer.
- Anything else you find relevant.
Parse Community has a responsible Vulnerability Disclosure Program for the safe disclosure of security bugs. In those cases, please go through the process outlined on that page and do not file a public issue.
- Most importantly, match the existing code style as much as possible.
- We use Flow and ES6 for this codebase. Use modern syntax whenever possible.
- Keep lines within 80 characters.
- Always end lines with semicolons.
This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to honor this code.
By contributing to the Parse JavaScript SDK, you agree that your contributions will be licensed under its license.