mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Docs: add version support section to README
- also switch header format to be more consistent with our other markdown files Closes gh-5565
This commit is contained in:
parent
d74fc265de
commit
cbc2bc1fd3
99
README.md
99
README.md
@ -1,12 +1,27 @@
|
|||||||
[jQuery](https://jquery.com/) — New Wave JavaScript
|
# [jQuery](https://jquery.com/) — New Wave JavaScript
|
||||||
==================================================
|
|
||||||
|
|
||||||
Meetings are currently held on the [matrix.org platform](https://matrix.to/#/#jquery_meeting:gitter.im).
|
Meetings are currently held on the [matrix.org platform](https://matrix.to/#/#jquery_meeting:gitter.im).
|
||||||
|
|
||||||
Meeting minutes can be found at [meetings.jquery.org](https://meetings.jquery.org/category/core/).
|
Meeting minutes can be found at [meetings.jquery.org](https://meetings.jquery.org/category/core/).
|
||||||
|
|
||||||
Contribution Guides
|
The latest version of jQuery is available at [https://jquery.com/download/](https://jquery.com/download/).
|
||||||
--------------------------------------
|
|
||||||
|
## Version support
|
||||||
|
|
||||||
|
| Version | Branch | Status |
|
||||||
|
| ------- | ---------- | -------- |
|
||||||
|
| 4.x | main | Beta |
|
||||||
|
| 3.x | 3.x-stable | Active |
|
||||||
|
| 2.x | 2.x-stable | Inactive |
|
||||||
|
| 1.x | 1.x-stable | Inactive |
|
||||||
|
|
||||||
|
Once 4.0.0 final is released, the 3.x branch will continue to receive updates for a limited time. The 2.x and 1.x branches are no longer supported.
|
||||||
|
|
||||||
|
Commercial support for inactive versions is available from [HeroDevs](https://herodevs.com/nes).
|
||||||
|
|
||||||
|
Learn more about our [version support](https://jquery.com/support/).
|
||||||
|
|
||||||
|
## Contribution Guides
|
||||||
|
|
||||||
In the spirit of open source software development, jQuery always encourages community code contribution. To help you get started and before you jump into writing code, be sure to read these important contribution guidelines thoroughly:
|
In the spirit of open source software development, jQuery always encourages community code contribution. To help you get started and before you jump into writing code, be sure to read these important contribution guidelines thoroughly:
|
||||||
|
|
||||||
@ -20,16 +35,12 @@ GitHub issues/PRs are usually referenced via `gh-NUMBER`, where `NUMBER` is the
|
|||||||
|
|
||||||
jQuery has used a different bug tracker - based on Trac - in the past, available under [bugs.jquery.com](https://bugs.jquery.com/). It is being kept in read only mode so that referring to past discussions is possible. When jQuery source references one of those issues, it uses the pattern `trac-NUMBER`, where `NUMBER` is the numerical ID of the issue. You can find such an issue under `https://bugs.jquery.com/ticket/NUMBER`.
|
jQuery has used a different bug tracker - based on Trac - in the past, available under [bugs.jquery.com](https://bugs.jquery.com/). It is being kept in read only mode so that referring to past discussions is possible. When jQuery source references one of those issues, it uses the pattern `trac-NUMBER`, where `NUMBER` is the numerical ID of the issue. You can find such an issue under `https://bugs.jquery.com/ticket/NUMBER`.
|
||||||
|
|
||||||
|
## Environments in which to use jQuery
|
||||||
Environments in which to use jQuery
|
|
||||||
--------------------------------------
|
|
||||||
|
|
||||||
- [Browser support](https://jquery.com/browser-support/)
|
- [Browser support](https://jquery.com/browser-support/)
|
||||||
- jQuery also supports Node, browser extensions, and other non-browser environments.
|
- jQuery also supports Node, browser extensions, and other non-browser environments.
|
||||||
|
|
||||||
|
## What you need to build your own jQuery
|
||||||
What you need to build your own jQuery
|
|
||||||
--------------------------------------
|
|
||||||
|
|
||||||
To build jQuery, you need to have the latest Node.js/npm and git 1.7 or later. Earlier versions might work, but are not supported.
|
To build jQuery, you need to have the latest Node.js/npm and git 1.7 or later. Earlier versions might work, but are not supported.
|
||||||
|
|
||||||
@ -41,9 +52,7 @@ and `brew install node` to install Node.js.
|
|||||||
Linux/BSD users should use their appropriate package managers to install git and Node.js, or build from source
|
Linux/BSD users should use their appropriate package managers to install git and Node.js, or build from source
|
||||||
if you swing that way. Easy-peasy.
|
if you swing that way. Easy-peasy.
|
||||||
|
|
||||||
|
## How to build your own jQuery
|
||||||
How to build your own jQuery
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
First, [clone the jQuery git repo](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository).
|
First, [clone the jQuery git repo](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository).
|
||||||
|
|
||||||
@ -193,8 +202,7 @@ npm run build -- --filename=jquery.slim.module.js --slim --esm
|
|||||||
|
|
||||||
*Non-official custom builds are not regularly tested. Use them at your own risk.*
|
*Non-official custom builds are not regularly tested. Use them at your own risk.*
|
||||||
|
|
||||||
Running the Unit Tests
|
## Running the Unit Tests
|
||||||
--------------------------------------
|
|
||||||
|
|
||||||
Make sure you have the necessary dependencies:
|
Make sure you have the necessary dependencies:
|
||||||
|
|
||||||
@ -208,7 +216,6 @@ Start `npm start` to auto-build jQuery as you work:
|
|||||||
npm start
|
npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
Run the unit tests with a local server that supports PHP. Ensure that you run the site from the root directory, not the "test" directory. No database is required. Pre-configured php local servers are available for Windows and Mac. Here are some options:
|
Run the unit tests with a local server that supports PHP. Ensure that you run the site from the root directory, not the "test" directory. No database is required. Pre-configured php local servers are available for Windows and Mac. Here are some options:
|
||||||
|
|
||||||
- Windows: [WAMP download](https://www.wampserver.com/en/)
|
- Windows: [WAMP download](https://www.wampserver.com/en/)
|
||||||
@ -216,14 +223,11 @@ Run the unit tests with a local server that supports PHP. Ensure that you run th
|
|||||||
- Linux: [Setting up LAMP](https://www.linux.com/training-tutorials/easy-lamp-server-installation/)
|
- Linux: [Setting up LAMP](https://www.linux.com/training-tutorials/easy-lamp-server-installation/)
|
||||||
- [Mongoose (most platforms)](https://code.google.com/p/mongoose/)
|
- [Mongoose (most platforms)](https://code.google.com/p/mongoose/)
|
||||||
|
|
||||||
|
## Essential Git
|
||||||
|
|
||||||
Essential Git
|
|
||||||
-------------
|
|
||||||
|
|
||||||
As the source code is handled by the Git version control system, it's useful to know some features used.
|
As the source code is handled by the Git version control system, it's useful to know some features used.
|
||||||
|
|
||||||
### Cleaning ###
|
### Cleaning
|
||||||
|
|
||||||
If you want to purge your working directory back to the status of upstream, the following commands can be used (remember everything you've worked on is gone after these):
|
If you want to purge your working directory back to the status of upstream, the following commands can be used (remember everything you've worked on is gone after these):
|
||||||
|
|
||||||
@ -232,35 +236,35 @@ git reset --hard upstream/main
|
|||||||
git clean -fdx
|
git clean -fdx
|
||||||
```
|
```
|
||||||
|
|
||||||
### Rebasing ###
|
### Rebasing
|
||||||
|
|
||||||
For feature/topic branches, you should always use the `--rebase` flag to `git pull`, or if you are usually handling many temporary "to be in a github pull request" branches, run the following to automate this:
|
For feature/topic branches, you should always use the `--rebase` flag to `git pull`, or if you are usually handling many temporary "to be in a github pull request" branches, run the following to automate this:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git config branch.autosetuprebase local
|
git config branch.autosetuprebase local
|
||||||
```
|
```
|
||||||
|
|
||||||
(see `man git-config` for more information)
|
(see `man git-config` for more information)
|
||||||
|
|
||||||
### Handling merge conflicts ###
|
### Handling merge conflicts
|
||||||
|
|
||||||
If you're getting merge conflicts when merging, instead of editing the conflicted files manually, you can use the feature
|
If you're getting merge conflicts when merging, instead of editing the conflicted files manually, you can use the feature
|
||||||
`git mergetool`. Even though the default tool `xxdiff` looks awful/old, it's rather useful.
|
`git mergetool`. Even though the default tool `xxdiff` looks awful/old, it's rather useful.
|
||||||
|
|
||||||
The following are some commands that can be used there:
|
The following are some commands that can be used there:
|
||||||
|
|
||||||
* `Ctrl + Alt + M` - automerge as much as possible
|
- `Ctrl + Alt + M` - automerge as much as possible
|
||||||
* `b` - jump to next merge conflict
|
- `b` - jump to next merge conflict
|
||||||
* `s` - change the order of the conflicted lines
|
- `s` - change the order of the conflicted lines
|
||||||
* `u` - undo a merge
|
- `u` - undo a merge
|
||||||
* `left mouse button` - mark a block to be the winner
|
- `left mouse button` - mark a block to be the winner
|
||||||
* `middle mouse button` - mark a line to be the winner
|
- `middle mouse button` - mark a line to be the winner
|
||||||
* `Ctrl + S` - save
|
- `Ctrl + S` - save
|
||||||
* `Ctrl + Q` - quit
|
- `Ctrl + Q` - quit
|
||||||
|
|
||||||
[QUnit](https://api.qunitjs.com) Reference
|
## [QUnit](https://api.qunitjs.com) Reference
|
||||||
-----------------
|
|
||||||
|
|
||||||
### Test methods ###
|
### Test methods
|
||||||
|
|
||||||
```js
|
```js
|
||||||
expect( numAssertions );
|
expect( numAssertions );
|
||||||
@ -268,11 +272,9 @@ stop();
|
|||||||
start();
|
start();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
*Note*: QUnit's eventual addition of an argument to stop/start is ignored in this test suite so that start and stop can be passed as callbacks without worrying about their parameters.
|
*Note*: QUnit's eventual addition of an argument to stop/start is ignored in this test suite so that start and stop can be passed as callbacks without worrying about their parameters.
|
||||||
|
|
||||||
### Test assertions ###
|
### Test assertions
|
||||||
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
ok( value, [message] );
|
ok( value, [message] );
|
||||||
@ -285,11 +287,11 @@ notStrictEqual( actual, expected, [message] );
|
|||||||
throws( block, [expected], [message] );
|
throws( block, [expected], [message] );
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Test Suite Convenience Methods Reference
|
||||||
|
|
||||||
Test Suite Convenience Methods Reference (See [test/data/testinit.js](https://github.com/jquery/jquery/blob/main/test/data/testinit.js))
|
See [test/data/testinit.js](https://github.com/jquery/jquery/blob/main/test/data/testinit.js).
|
||||||
------------------------------
|
|
||||||
|
|
||||||
### Returns an array of elements with the given IDs ###
|
### Returns an array of elements with the given IDs
|
||||||
|
|
||||||
```js
|
```js
|
||||||
q( ... );
|
q( ... );
|
||||||
@ -303,7 +305,7 @@ q("main", "foo", "bar");
|
|||||||
=> [ div#main, span#foo, input#bar ]
|
=> [ div#main, span#foo, input#bar ]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Asserts that a selection matches the given IDs ###
|
### Asserts that a selection matches the given IDs
|
||||||
|
|
||||||
```js
|
```js
|
||||||
t( testName, selector, [ "array", "of", "ids" ] );
|
t( testName, selector, [ "array", "of", "ids" ] );
|
||||||
@ -315,12 +317,10 @@ Example:
|
|||||||
t("Check for something", "//[a]", ["foo", "bar"]);
|
t("Check for something", "//[a]", ["foo", "bar"]);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Fires a native DOM event without going through jQuery
|
||||||
|
|
||||||
### Fires a native DOM event without going through jQuery ###
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
fireNative( node, eventType )
|
fireNative( node, eventType );
|
||||||
```
|
```
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
@ -329,7 +329,7 @@ Example:
|
|||||||
fireNative( jQuery( "#elem" )[ 0 ], "click" );
|
fireNative( jQuery( "#elem" )[ 0 ], "click" );
|
||||||
```
|
```
|
||||||
|
|
||||||
### Add random number to url to stop caching ###
|
### Add random number to url to stop caching
|
||||||
|
|
||||||
```js
|
```js
|
||||||
url( "some/url" );
|
url( "some/url" );
|
||||||
@ -348,8 +348,7 @@ url("mock.php?foo=bar");
|
|||||||
=> "data/mock.php?foo=bar&10538358345554"
|
=> "data/mock.php?foo=bar&10538358345554"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Run tests in an iframe
|
||||||
### Run tests in an iframe ###
|
|
||||||
|
|
||||||
Some tests may require a document other than the standard test fixture, and
|
Some tests may require a document other than the standard test fixture, and
|
||||||
these can be run in a separate iframe. The actual test code and assertions
|
these can be run in a separate iframe. The actual test code and assertions
|
||||||
@ -376,9 +375,7 @@ for this test, followed by the global `jQuery`, `window`, and `document` from
|
|||||||
the iframe. If the iframe code passes any arguments to `startIframeTest`,
|
the iframe. If the iframe code passes any arguments to `startIframeTest`,
|
||||||
they follow the `document` argument.
|
they follow the `document` argument.
|
||||||
|
|
||||||
|
## Questions?
|
||||||
Questions?
|
|
||||||
----------
|
|
||||||
|
|
||||||
If you have any questions, please feel free to ask on the
|
If you have any questions, please feel free to ask on the
|
||||||
[Developing jQuery Core forum](https://forum.jquery.com/developing-jquery-core) or in #jquery on [libera](https://web.libera.chat/).
|
[Developing jQuery Core forum](https://forum.jquery.com/developing-jquery-core) or in #jquery on [libera](https://web.libera.chat/).
|
||||||
|
Loading…
Reference in New Issue
Block a user