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:
Timmy Willison 2024-10-13 15:30:15 -04:00 committed by GitHub
parent d74fc265de
commit cbc2bc1fd3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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).
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:
@ -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`.
Environments in which to use jQuery
--------------------------------------
## Environments in which to use jQuery
- [Browser support](https://jquery.com/browser-support/)
- 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.
@ -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
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).
@ -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.*
Running the Unit Tests
--------------------------------------
## Running the Unit Tests
Make sure you have the necessary dependencies:
@ -208,7 +216,6 @@ Start `npm start` to auto-build jQuery as you work:
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:
- 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/)
- [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.
### 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):
@ -232,35 +236,35 @@ git reset --hard upstream/main
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:
```bash
git config branch.autosetuprebase local
```
(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
`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:
* `Ctrl + Alt + M` - automerge as much as possible
* `b` - jump to next merge conflict
* `s` - change the order of the conflicted lines
* `u` - undo a merge
* `left mouse button` - mark a block to be the winner
* `middle mouse button` - mark a line to be the winner
* `Ctrl + S` - save
* `Ctrl + Q` - quit
- `Ctrl + Alt + M` - automerge as much as possible
- `b` - jump to next merge conflict
- `s` - change the order of the conflicted lines
- `u` - undo a merge
- `left mouse button` - mark a block to be the winner
- `middle mouse button` - mark a line to be the winner
- `Ctrl + S` - save
- `Ctrl + Q` - quit
[QUnit](https://api.qunitjs.com) Reference
-----------------
## [QUnit](https://api.qunitjs.com) Reference
### Test methods ###
### Test methods
```js
expect( numAssertions );
@ -268,11 +272,9 @@ stop();
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.
### Test assertions ###
### Test assertions
```js
ok( value, [message] );
@ -285,11 +287,11 @@ notStrictEqual( actual, 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
q( ... );
@ -303,7 +305,7 @@ q("main", "foo", "bar");
=> [ div#main, span#foo, input#bar ]
```
### Asserts that a selection matches the given IDs ###
### Asserts that a selection matches the given IDs
```js
t( testName, selector, [ "array", "of", "ids" ] );
@ -315,12 +317,10 @@ Example:
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
fireNative( node, eventType )
fireNative( node, eventType );
```
Example:
@ -329,7 +329,7 @@ Example:
fireNative( jQuery( "#elem" )[ 0 ], "click" );
```
### Add random number to url to stop caching ###
### Add random number to url to stop caching
```js
url( "some/url" );
@ -348,8 +348,7 @@ url("mock.php?foo=bar");
=> "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
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`,
they follow the `document` argument.
Questions?
----------
## Questions?
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/).