Contributing to jQuery Mobile
Welcome! Thanks for your interest in contributing to jQuery Mobile. You're almost in the right place. More information on how to contribute to this and all other jQuery Foundation projects is over at contribute.jquery.org. You'll definitely want to take a look at the articles on contributing code.
You may also want to take a look at our commit & pull request guide and style guides for instructions on how to maintain your fork and submit your code. Before we can merge any pull request, we'll also need you to sign our contributor license agreement.
You can find us on IRC, specifically in #jqueryui-dev should you have any questions. If you've never contributed to open source before, we've put together a short guide with tips, tricks, and ideas on getting started.
More information about the project, the jQuery Mobile team, our weekly meetings, and how to get more involved can be found on the "About" page on the project website. On this page we provide project specific information regarding reporting bugs, suggesting new features, and contributing code or content. Please take a moment to read this before opening a ticket or submitting a pull request.
If you encounter a bug in the framework you can report it on the issue tracker here on Github. Questions about how to use the framework or problems with your custom code can be posted on the forum. The jQuery Mobile API Documentation, ThemeRoller and Download Builder have their own repo where you can report issues.
Before opening a new issue please check if the same or a similar issue already has been reported. Tip: Besides the search tool of the issue tracker you can filter issues by label.
When submitting an issue include the following:
- Issue description
- Test page (see below)
- Steps to reproduce
- Expected outcome
- Actual outcome
- Platforms/browsers (including version) and devices tested
- jQuery Mobile and jQuery core version used
- Other relevant information, e.g. using Apache Cordova
It is IMPORTANT that you always provide a test page when submitting an issue!
Why? - This ensures that we are looking at exactly the same thing when testing on our devices and that we know about all markup and code that is in play.
What? - Keep the test page as simple as possible. Only include markup/code that is required to reproduce the issue.
- You will notice if the issue has been fixed already
- It enables us to edit your code if necessary
- The test page won't disappear or change while we are looking into the issue
- We can test again after committing a fix for the issue
JS Bin instructions: When you start editing the JS Bin, the url will update and contain a new version number. As long as you keep the JS Bin open in your browser this url won't change. Copy the url in your issue report when you are done editing. If your test case requires multiple "single" jQuery Mobile pages, open the JS Bin on multiple tabs on your browser and each of them will get an unique url. Link to this url without "/edit" at the end on your other page(s).
If you have an idea for a new feature or a suggestion how to improve an existing feature, let us know!
Please note that we will flag the issue as feature request and then close it. We check requests on regular base and when we decide to implement a feature we set a milestone and re-open the ticket.
When submitting a pull request for review there are a few important steps you have to take to ensure that it gets reviewed quickly and increase the chances that it will be merged:
- If you are new to contributing code or content to jQuery projects, read the information at contribute.jquery.org first
- Make sure you have signed the CLA
- Before opening a pull request for a bug fix or new feature, make sure there is a ticket for it (don't include a bug report in a pull request)
- Limit the scope to one issue/feature
- Add and run unit tests
- Follow the style guides
- Follow the commit message guidelines
If you need help or feedback, or want to get more involved in the jQuery Mobile project, don't hesitate to reach out to us. You can find us on IRC in #jqueryui-dev (Freenode).
Tips For Bug Patching
Environment: localhost with PHP, Node.js, and Grunt
jQuery Mobile uses Node.js and Grunt to automate the building and validation of source code.
The Demos depend on PHP running locally, so make sure you have the following installed:
- A web server with PHP support (any will do, such as XAMPP or MAMP)
- Node.js (includes NPM, necessary for the next step)
- Grunt (install with:
npm install -g grunt-cli)
Build a Local Copy of jQuery Mobile
Create a fork of the jQuery Mobile repo on GitHub at http://github.com/jquery/jquery-mobile.
Change directory to your web root directory, whatever that might be:
$ cd /path/to/your/www/root/
Clone your jQuery Mobile fork to work locally.
Note: be sure to replace
[USERNAME] with your GitHub username.
$ git clone firstname.lastname@example.org:[USERNAME]/jquery-mobile.git
Change to the newly created directory.
$ cd jquery-mobile
Add the official jQuery repository as a remote. We recommend naming it "upstream".
$ git remote add upstream git://github.com/jquery/jquery-mobile.git
Get in the habit of pulling in the "upstream" master to stay up to date as jQuery Mobile receives new commits.
$ git pull upstream master
Install the dependencies.
You can run all the test suites by running the following command:
$ grunt test
You can choose to run only a subset of the tests by adding the
--suites option like:
$ grunt test --suites=button,checkboxradio
will only run the tests under
You can also specify which versions of jQuery you want to test jQuery Mobile with by using the
$ grunt test --jqueries=1.11.1,git
Often times when working on a feature or bug fix branch it's useful to pull in the latest from the parent branch. If you're doing this before submitting a pull request it's best to use git's rebase to apply your commits onto the latest from the parent branch. For example, working on
new-feature branch where
upstream is the remote at
git checkout new-feature git pull --rebase upstream master ## ... here you may have to resolve some conflicts ... ##
You can now push to your own fork and submit the pull request. Keep in mind that it's only a good idea to do this if you haven't already submitted a pull request unless you want to create a new one because your origin remote (your fork) will report a discrepancy. Again, please refer to the chapter in Pro Git on rebasing if you're new to it.
Thank you for contributing to the jQuery Mobile project!