Reading the repo
Opening the box…
Reading the repo
Opening the box…
How to install on macOS
jQuery JavaScript Library
Saved setup from 3 h ago
Will it work on macOS?
CONTRIBUTING.mdNote: This is the code development repository for jQuery Core only. Before opening an issue or making a pull request, be sure you're in the right place.
We're always looking for help identifying bugs, writing and reducing test cases, and improving documentation. And although new features are rare, anything passing our guidelines will be considered.
More information on how to contribute to this and other jQuery organization projects is at contribute.jquery.org, including a short guide with tips, tricks, and ideas on getting started with open source. Please review our commit & pull request guide and style guides for instructions on how to maintain a fork and submit patches.
When opening a pull request, you'll be asked to sign our Contributor License Agreement. Both the Corporate and Individual agreements can be previewed on GitHub.
If you're looking for some good issues to start with, here are some issues labeled "help wanted" or "patch welcome".
jQuery is so popular that many developers have knowledge of its capabilities and limitations. Most questions about using jQuery can be answered on popular forums such as Stack Overflow. Please start there when you have questions, even if you think you've found a bug.
The jQuery Core team watches jQuery GitHub Discussions. If you have longer posts or questions that can't be answered in places such as Stack Overflow, please feel free to post them there. If you think you've found a bug, please file it in the bug tracker. The Core team can be found in the #jquery/dev Matrix channel on gitter.im.
The jQuery Core team has a weekly meeting to discuss the progress of current work. The meeting is held in the #jquery/meeting Matrix channel on gitter.im at Noon EST on Mondays.
Most bugs reported to our bug tracker are actually bugs in user code, not in jQuery code. Keep in mind that just because your code throws an error inside of jQuery, this does not mean the bug is a jQuery bug.
Ask for help first on a discussion forum like Stack Overflow. You will get much quicker support, and you will help avoid tying up the jQuery team with invalid bug reports.
Make sure you have reproduced the bug with all browser extensions and add-ons disabled, as these can sometimes cause things to break in interesting and unpredictable ways. Try using incognito, stealth or anonymous browsing modes.
Bugs in old versions of jQuery may have already been fixed. In order to avoid reporting known issues, make sure you are always testing against the latest build. We cannot fix bugs in older released files, if a bug has been fixed in a subsequent version of jQuery the site should upgrade.
When experiencing a problem, reduce your code to the bare minimum required to reproduce the issue. This makes it much easier to isolate and fix the offending code. Bugs reported without reduced test cases take on average 9001% longer to fix than bugs that are submitted with them, so you really should try to do this if at all possible.
Go to the jQuery Core issue tracker and make sure the problem hasn't already been reported. If not, create a new issue there and include your test case.
We love when people contribute back to the project by patching the bugs they find. Since jQuery is used by so many people, we are cautious about the patches we accept and want to be sure they don't have a negative impact on the millions of people using jQuery each day. For that reason it can take a while for any suggested patch to work its way through the review and release process. The reward for you is knowing that the problem you fixed will improve things for millions of sites and billions of visits per day.
Create a fork of the jQuery repo on GitHub at https://github.com/jquery/jquery
Clone your jQuery fork to work locally:
$ git clone git@github.com:username/jquery.git
Change directory to the newly created dir jquery/:
$ cd jquery
Add the jQuery main as a remote. I label mine upstream:
$ git remote add upstream git@github.com:jquery/jquery.git
Get in the habit of pulling in the "upstream" main to stay up to date as jQuery receives new commits:
$ git pull upstream main
Install the necessary dependencies:
$ npm install
Build all jQuery files:
$ npm run build:all
Start a test server:
$ npm run test:server
Now open the jQuery test suite in a browser at http://localhost:3000/test/.
Success! You just built and tested jQuery!
During the process of writing your patch, you will run the test suite MANY times. You can speed up the process by narrowing the running test suite down to the module you are testing by either double-clicking the title of the test or appending it to the url. The following examples assume you're working on a local repo, hosted on your localhost server.
Example:
http://localhost:3000/test/?module=css
This will only run the "css" module tests. This will significantly speed up your development and debugging.
ALWAYS RUN THE FULL SUITE BEFORE COMMITTING AND PUSHING A PATCH!
The default port for the test server is 3000. You can change the port by setting the --port option.
$ npm run test:server -- --port 8000
Rather than rebuilding jQuery with npm run build every time you make a change, you can use the included watch task to rebuild distribution files whenever a file is saved.
$ npm start
Alternatively, you can load tests as ECMAScript modules to avoid the need for rebuilding altogether.
Click "Load as modules" after loading the test page.
You can also run the test suite from the command line.
First, prepare the tests:
$ npm run pretest
Make sure jQuery is built (npm run build:all) and run the tests:
$ npm run test:unit
This will run all tests and report the results in the terminal.
View the full help for the test suite for more info on running the tests from the command line:
$ npm run test:unit -- --help
All test modules run by default. Run a single module by specifying the module in a "flag":
$ npm run test:unit -- --flag module=css
Or, run multiple modules with multiple flags (-f is shorthand for --flag):
$ npm run test:unit -- -f module=css -f module=effects
Anything passed to the --flag option is passed as query parameters on the QUnit test page. For instance, run tests with unminified code with the dev flag:
$ npm run test:unit -- -f dev
The jQuery source is organized with ECMAScript modules and then compiled into one file at build time.
jQuery also contains some special modules we call "var modules", which are placed in folders named "var". At build time, these small modules are compiled to simple var statements. This makes it easy for us to share variables across modules. Browse the "src" folder for examples.
Remember that jQuery supports multiple browsers and their versions; any contributed code must work in all of them. You can refer to the browser support page for the current list of supported browsers.
jQuery is a mature, stability-focused project. Changes carry real compatibility risk, and every pull request costs maintainer time to review. To keep that time focused on work that benefits actual users, we require the following:
Contributions must address a real, demonstrated need. Pull requests should correspond to an existing reported issue, a problem you personally encountered in real usage, or a change previously discussed with the maintainers. PRs that fix hypothetical problems, restyle working code, or make speculative "improvements" no user has asked for will be closed without review.
You must be able to engage with review as the author. Whatever tools you use to write code, you are responsible for understanding and defending every line you submit. If you cannot explain why a change was made, answer questions about its approach, or revise it based on feedback, the PR will be closed.
Do not submit auto-generated issues or pull requests. Issues and PRs produced by pointing an automated tool at this repository — rather than originating from genuine use of jQuery — are not welcome, whether you submit one or many. These will be closed without review, and repeat submissions may result in a ban from the project.
Opening an issue describing a problem you actually hit, and discussing it before writing code, is always the best path to a merged contribution.
Then run bash setup.sh. It stops at the first error and is safe to run again. Servers and tests aren't started; it lists them at the end. Read it first.
Needs Git: xcode-select --install
git clone https://github.com/jquery/jquery.git cd jquery
Node.js 20
# needs nvm: brew install nvm (or https://github.com/nvm-sh/nvm) nvm install 20
npm ci
npm run start
npm test
To build all variants of jQuery, run the following command:
npm run build:all
This will create all of the variants that jQuery includes in a release, including jquery.js, jquery.slim.js, jquery.module.js, and jquery.slim.module.js along their associated minified files and sourcemaps.
jquery.module.js and jquery.slim.module.js are ECMAScript modules that export jQuery and $ as named exports are placed in the dist-module/ directory rather than the dist/ directory.
No reports for macOS yet.
GitManual AI Agent reads the 9 key files and writes a step-by-step guide for macOS. Once written, it's saved for everyone.