You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2.[Questions and Discussion](#questions-and-discussion)
5
5
3.[How To Report Bugs](#how-to-report-bugs)
6
-
4.[Core Style Guide](#jquery-core-style-guide)
7
-
5.[Tips For Bug Patching](#tips-for-jquery-bug-patching)
8
-
6
+
4.[Tips for Bug Patching](#tips-for-bug-patching)
9
7
10
8
11
9
## Getting Involved
12
10
13
-
There are a number of ways to get involved with the development of jQuery core. Even if you've never contributed code to an Open Source project before, we're always looking for help identifying bugs, writing and reducing test cases and documentation.
14
-
15
-
This is the best way to contribute to jQuery core. Please read through the full guide detailing [How to Report Bugs](#How-to-Report-Bugs).
We're always looking for help [identifying bugs](#how-to-report-bugs), writing and reducing test cases, and improving documentation. And although new features are rare, anything passing our [guidelines](https://github.com/jquery/jquery/wiki/Adding-new-features) will be considered.
18
14
19
-
### Forum and IRC
15
+
More information on how to contribute to this and other jQuery organization projects is at [contribute.jquery.org](https://contribute.jquery.org), including a short guide with tips, tricks, and ideas on [getting started with open source](https://contribute.jquery.org/open-source/). Please review our [commit & pull request guide](https://contribute.jquery.org/commits-and-pull-requests/) and [style guides](https://contribute.jquery.org/style-guide/) for instructions on how to maintain a fork and submit patches.
20
16
21
-
The jQuery core development team frequently tracks posts on the [jQuery Development Forum](http://forum.jquery.com/developing-jquery-core). If you have longer posts or questions please feel free to post them there. If you think you've found a bug please [file it in the bug tracker](#How-to-Report-Bugs).
17
+
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](https://github.com/openjs-foundation/easycla).
22
18
23
-
Additionally most of the jQuery core development team can be found in the [#jquery-dev](http://webchat.freenode.net/?channels=jquery-dev) IRC channel on irc.freenode.net.
19
+
If you're looking for some good issues to start with, [here are some issues labeled "help wanted" or "patch welcome"](https://github.com/jquery/jquery-migrate/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22%2C%22Patch+Welcome%22).
24
20
25
-
### Weekly Status Meetings
21
+
##Questions and Discussion
26
22
27
-
Every week (unless otherwise noted) the jQuery core dev team has a meeting to discuss the progress of current work and to bring forward possible new blocker bugs for discussion.
23
+
### Looking for help?
28
24
29
-
The meeting is held in the [#jquery-meeting](http://webchat.freenode.net/?channels=jquery-meeting) IRC channel on irc.freenode.net at [Noon EST](http://www.timeanddate.com/worldclock/fixedtime.html?month=1&day=17&year=2011&hour=12&min=0&sec=0&p1=43) on Mondays.
25
+
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](https://stackoverflow.com). Please start there when you have questions, even if you think you've found a bug.
The jQuery Core team watches [jQuery GitHub Discussions](https://github.com/jquery/jquery/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](#how-to-report-bugs). The Core team can be found in the [#jquery/dev](https://matrix.to/#/#jquery_dev:gitter.im) Matrix channel on gitter.im.
32
28
29
+
### Weekly Status Meetings
33
30
34
-
## How to Report Bugs
31
+
The jQuery Core team has a weekly meeting to discuss the progress of current work. The meeting is held in the [#jquery/meeting](hhttps://matrix.to/#/#jquery_meeting:gitter.im) Matrix channel on gitter.im at [Noon EST](https://www.timeanddate.com/worldclock/fixedtime.html?month=10&day=7&year=2024&hour=12&min=0&sec=0&p1=43) on Mondays.
Many 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 and the console points to a line number inside of jQuery, this does *not* mean the bug is a jQuery bug; more often than not, these errors result from providing incorrect arguments when calling a jQuery function.
39
35
40
-
If you are new to jQuery, it is usually a much better idea to ask for help first in the [Using jQuery Forum](http://forum.jquery.com/using-jquery) or the [jQuery IRC channel](http://webchat.freenode.net/?channels=%23jquery). You will get much quicker support, and you will help avoid tying up the jQuery team with invalid bug reports. These same resources can also be useful if you want to confirm that your bug is indeed a bug in jQuery before filing any tickets.
36
+
## How to Report Bugs
41
37
38
+
### Make sure it is a jQuery Migrate bug
42
39
43
-
### Disable any browser extensions
40
+
Most bugs reported to our bug tracker are actually bugs in user code, not in jQuery Migrate code. Keep in mind that just because your code throws an error inside of jQuery Migrate, this does *not* mean the bug is a jQuery Migrate bug.
44
41
45
-
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.
42
+
Ask for help first on a discussion forum like [Stack Overflow](https://stackoverflow.com/). You will get much quicker support, and you will help avoid tying up the jQuery team with invalid bug reports.
46
43
44
+
### Disable browser extensions
47
45
48
-
### Try the latest version of jQuery
46
+
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.
49
47
50
-
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 jQuery version](https://releases.jquery.com/jquery/).
48
+
### Try the latest version of jQuery Migrate
51
49
52
-
### Try an older version of jQuery
50
+
Bugs in old versions of jQuery Migrate may have already been fixed. In order to avoid reporting known issues, make sure you are always testing against the [latest build](https://releases.jquery.com/git/jquery-migrate-git.js). We cannot fix bugs in older released files, if a bug has been fixed in a subsequent version of jQuery Migrate the site should upgrade.
53
51
54
-
Sometimes, bugs are introduced in newer versions of jQuery that do not exist in previous versions. When possible, it can be useful to try testing with an older release.
52
+
### Simplify the test case
55
53
56
-
### Reduce, reduce, reduce!
54
+
When experiencing a problem, [reduce your code](https://webkit.org/test-case-reduction/) 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.
57
55
58
-
When you are experiencing a problem, the most useful thing you can possibly do is to [reduce your code](https://webkit.org/test-case-reduction/) to the bare minimum required to reproduce the issue. This makes it *much* easier to isolate and fix the offending code. Bugs that are 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.
56
+
### Search for related or duplicate issues
59
57
60
-
## jQuery Core Style Guide
58
+
Go to the [jQuery Migrate issue tracker](https://github.com/jquery/jquery-migrate/issues) 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.
66
64
67
-
### Environment: localhost
68
-
69
-
To test the plugin you will need:
70
-
71
-
* Node.js
72
-
* NPM (comes with the latest version of Node.js)
65
+
### Build a Local Copy of jQuery Migrate
73
66
74
-
### Build a Local Copy of the plugin
67
+
Create a fork of the jQuery Migrate repo on GitHub at https://github.com/jquery/jquery-migrate
75
68
76
-
Create a fork of the plugin repo on github at http://github.com/jquery/jquery-migrate
77
-
78
-
Change directory to your web root directory, whatever that might be:
Get in the habit of pulling in the "upstream" `main` branch to stay up to date as jQuery Migrate receives new commits:
87
+
Get in the habit of pulling in the "upstream" main to stay up to date as jQuery Migrate receives new commits:
103
88
104
89
```bash
105
90
$ git pull upstream main
106
91
```
107
92
108
-
Run the build and rebuild when source files change:
93
+
Install the necessary dependencies:
109
94
110
95
```bash
111
-
$ npm start
96
+
$ npm install
112
97
```
113
98
114
-
In another terminal, run the test server:
99
+
Build all jQuery Migrate files:
115
100
116
101
```bash
117
-
$ npm run test:server
102
+
$ npm run build
118
103
```
119
104
120
-
Now open the jQuery test suite in a browser at http://localhost:3000/test/.
121
-
122
-
Success! You just built and tested jQuery!
123
-
124
-
125
-
### Fix a bug from a ticket filed at bugs.jquery.com:
126
-
127
-
**NEVER write your patches to the `main` branch**
128
-
129
-
**ALWAYS USE A "TOPIC" BRANCH!** Like so (#### = the ticket #)...
130
-
131
-
Make sure you start with your up-to-date `main` branch:
105
+
Start a test server:
132
106
133
107
```bash
134
-
$ git checkout main
108
+
$ npm run test:server
135
109
```
136
110
137
-
Create and checkout a new branch that includes the ticket #
111
+
Now open the jQuery test suite in a browser at http://localhost:3000/test/.
138
112
139
-
```bash
140
-
$ git checkout -b bug_####
113
+
Success! You just built and tested jQuery Migrate!
141
114
142
-
# ( Explanation: this useful command will:
143
-
# "checkout" a "-b" (branch) by the name of "bug_####"
144
-
# or create it if it doesn't exist )
145
-
```
115
+
### Test Suite Tips...
146
116
147
-
Now you're on branch: bug_####
117
+
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.
148
118
149
-
Determine the module/file you'll be working in...
119
+
Example:
150
120
151
-
Open up the corresponding /test/unit/?????.js and add the initial failing unit tests. This may seem awkward at first, but in the long run it will make sense. To truly and efficiently patch a bug, you need to be working against that bug.
121
+
http://localhost:3000/test/?module=css
152
122
153
-
Next, open the module files and make your changes
123
+
This will only run the "css" module tests. This will significantly speed up your development and debugging.
154
124
155
-
Run http://localhost/test --> **ALL TESTS MUST PASS**
125
+
**ALWAYS RUN THE FULL SUITE BEFORE COMMITTING AND PUSHING A PATCH!**
156
126
157
-
Once you're satisfied with your patch...
127
+
#### Change the test server port
158
128
159
-
Stage the files to be tracked:
129
+
The default port for the test server is 3000. You can change the port by setting the `PORT` environment variable.
160
130
161
131
```bash
162
-
$ git add filename
163
-
# (you can use "git status" to list the files you've changed)
132
+
$ PORT=3001 npm run test:server
164
133
```
165
134
135
+
#### Loading changes on the test page
166
136
167
-
( I recommend NEVER, EVER using "git add . " )
168
-
169
-
Once you've staged all of your changed files, go ahead and commit them
137
+
Rather than rebuilding jQuery Migrate 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.
170
138
171
139
```bash
172
-
$ git commit -m "Brief description of fix. Fixes #0000"
140
+
$ npm start
173
141
```
174
142
175
-
For a multiple line commit message, leave off the `-m "description"`.
143
+
Alternatively, you can **load tests as ECMAScript modules** to avoid the need for rebuilding altogether.
144
+
145
+
Set the `jquery-migrate:` field to `esmodules` after loading the test page.
176
146
177
-
You will then be led into vi (or the text editor that you have set up) to complete your commit message.
147
+
#### Running the test suite from the command line
178
148
179
-
Then, push your branch with the bug fix commits to your github fork
149
+
You can also run the test suite from the command line.
150
+
151
+
First, prepare the tests:
180
152
181
153
```bash
182
-
$ git push origin -u bug_####
154
+
$ npm run pretest
183
155
```
184
156
185
-
Before you tackle your next bug patch, return to the `main` branch:
157
+
Make sure jQuery Migrate is built (`npm run build`) and run the tests:
186
158
187
159
```bash
188
-
$ git checkout main
160
+
$ npm run test:unit
189
161
```
190
162
163
+
This will run each module in its own browser instance and report the results in the terminal.
191
164
192
-
### Test Suite Tips...
165
+
View the full help for the test suite for more info on running the tests from the command line:
193
166
194
-
By default the plugin runs against the current (jquery-3.x-git WIP) version of jQuery. You can select a different version by specifying it in the URL. Files are always retrieved from code.jquery.com or releases.jquery.com (the latter for development versions).
This will run the plugin with version 1.7.2 of jQuery, taken from http://code.jquery.com/jquery-1.7.2.js.
173
+
The jQuery Migrate source is organized with ECMAScript modules and then compiled into one file at build time.
201
174
202
-
**ALWAYS RUN THE FULL TEST SUITE BEFORE COMMITTING AND PUSHING A PATCH!**
175
+
### Browser support
203
176
177
+
Remember that jQuery Migrate supports multiple browsers and their versions; any contributed code must work in all of them. You can refer to the ["Version compatibility" section in Migrate README](https://github.com/jquery/jquery-migrate/blob/main/README.md#version-compatibility) for the current list of supported browsers.
0 commit comments