Comparing changes
Open a pull request
|
|
Timmy Willison |
Build: Updating the master version to 3.1.1-pre.
|
No user is associated with the committer email.
|
93f7062
|
|
|
markelog |
Build: More ESLint related changes
|
522f546
|
|||
|
|
markelog |
Build: Don't use ESLint 3.x
Since it is not supported by older node versions :/ |
02c5e29
|
|
|
mgol |
Build: Fix the regex removing the ESLint comment from wrapper.js
The new regex from after the switch from JSHint to ESLint wasn't catching the ESLint pragma correctly. Also, the spacing of the pragma comment was updated to match other comments. |
6e605af
|
|||
|
|
mgol |
Build: Skip running ESLint on Node.js 0.x
ESLint 3.0 drops support for Node.js older than 4.x. To be able to update to this version and yet not block our contributors from building jQuery on older Node.js (at least until it's supported by upstream) this commit makes ESLint skipped on older Node; a proper message is displayed then. Fixes gh-3222 |
030191a
|
|||
|
|
mgol |
Build: Upgrade ESLint to 3.x again
ESLint is now skipped in Node older than 4.x so we're safe. Refs gh-3222 |
96966c0
|
|
|
markelog |
Build: Update eslint config and fix associated errors
|
e4fd41f
|
|
|
all3fox + mgol |
Build: use commitplease via husky, prohibit #NNNN github-style tickets
Closes gh-3176 |
04a2e03
|
|||
|
|
mgol + markelog |
Build: Don't lint every file in dist/ (#3245)
Currently the "all" target for the eslint task includes way more than the "dev" & "dist" targets combined and those 2 tasks are the one run in `npm test`. |
edf7a43
|
|
|
timmywil |
Build: add new email to mailmap
|
9c90be9
|
|||
|
|
markelog |
Build: Simplify Gruntfile constructions
Fixes gh-3246 |
308e4b5
|
|||
|
|
markelog |
Build: .eslintrc -> .eslintrc.json
`.eslintrc` format is deprecated - http://eslint.org/docs/user-guide/configuring#configuration-file-formats Fixes gh-3248 Closes gh-3247 |
6acf4a7
|
|
|
gibson042 |
Event: Optimize delegated event processing
Closes gh-3255 |
76c5237
|
|
|
dmethvin |
Traversing: Let .not(arraylike) pass non-element nodes
|
560c0c6
|
|
|
timmywil |
Core: expose noConflict in AMD mode
- For compability reasons, we had already added the global in AMD mode, but without noConflict. This adds back noConflict to AMD (which fixes noConflict mode in the tests). Fixes gh-2930 |
This commit was signed with a verified signature.
GPG key ID: F50CDDF42C347961
Learn about signing commits
|
52e2447
|
|
|
mgol |
Tests: Disable a whitespace-setting test in Edge 14
Working around this problem would require us to skip setting whitespace-only values except when they're valid which would be very fragile. Another option would be to set the value and see if it succeeded and then react to that. We've tried something like that in the past to be able to overwrite !important styles (see 24e5879) but it broke the CSS cascade (see https://bugs.jquery.com/ticket/14836#comment:5) and was triggering MutationObserver callbacks too often so it was reverted in PR gh-1532. Ref gh-3204 Ref gh-1532 |
3f5f543
|
|||
|
|
mgol |
Build: Update promises-aplus-tests for compat with Node 7
The older promises-aplus-tests was relying on old Mocha that, in turn, used an obsolete graceful-fs version that is not guaranteed to work fine with the upcoming Node 7 and later. |
2d4f534
|
|
|
timmywil |
Core: rnotwhite -> rhtmlnotwhite and jQuery.trim -> stripAndCollapse
- Renames and changes rnotwhite to focus on HTML whitespace chars - Change internal use of jQuery.trim to more accurate strip and collapse - Adds tests to ensure HTML space characters are retained where valid - Doesn't add tests where the difference is inconsequential and existing tests are adequate. Fixes gh-3003 Fixes gh-3072 Close gh-3316 |
This commit was signed with a verified signature.
GPG key ID: 6DCFDB0E8CC4EDF4
Learn about signing commits
|
3bbcce6
|
|
|
gibson042 + timmywil |
Core: Compress stripAndCollapse
Close gh-3318 |
This commit was signed with a verified signature.
GPG key ID: F50CDDF42C347961
Learn about signing commits
|
b5d09b9
|
||
|
|
mgol |
Tests: Add test results for Safari 10/iOS 10, remove for Safari 8
|
223ed99
|
|||
|
|
dmethvin |
Build: Make sourcemap updates in two .replace() passes
|
37f1da6
|
|||
|
|
stevemao + timmywil |
Core: remove precautionary variable `readyFiring`
Close gh-3284 |
This commit was signed with a verified signature.
GPG key ID: F50CDDF42C347961
Learn about signing commits
|
fcb8a1b
|
|
|
timmywil |
Release: add email to .mailmap, update AUTHORS
- Not sure how that got there. I did check the privacy box at one point, but can't find any commits with that email |
This commit was signed with a verified signature.
GPG key ID: 6DCFDB0E8CC4EDF4
Learn about signing commits
|
cc16f11
|
||
|
|
timmywil |
Release: fix quotes for releasing on Windows
|
This commit was signed with a verified signature.
GPG key ID: 6DCFDB0E8CC4EDF4
Learn about signing commits
|
51c29dc
|
||
|
|
timmywil |
3.1.1
|
This commit was signed with a verified signature.
GPG key ID: 6DCFDB0E8CC4EDF4
Learn about signing commits
|
ee2e377
|
- 0 .eslintrc → .eslintrc.json
- +2 −2 .gitignore
- +4 −2 .mailmap
- +1 −1 .npmignore
- +1 −1 AUTHORS.txt
- +59 −26 Gruntfile.js
- +5 −4 build/release/cdn.js
- +4 −3 build/release/dist.js
- +2 −6 build/tasks/build.js
- +4 −2 dist/{.eslintrc → .eslintrc.json}
- +10,220 −0 dist/jquery.js
- +4 −0 dist/jquery.min.js
- +1 −0 dist/jquery.min.map
- +8,107 −0 dist/jquery.slim.js
- +4 −0 dist/jquery.slim.min.js
- +1 −0 dist/jquery.slim.min.map
- +88 −33 external/sizzle/dist/sizzle.js
- +2 −2 external/sizzle/dist/sizzle.min.js
- +1 −1 external/sizzle/dist/sizzle.min.map
- +14 −10 package.json
- 0 src/{.eslintrc → .eslintrc.json}
- +7 −7 src/ajax.js
- +3 −2 src/ajax/load.js
- +6 −3 src/attributes/attr.js
- +12 −17 src/attributes/classes.js
- +20 −5 src/attributes/prop.js
- +19 −15 src/attributes/val.js
- +3 −3 src/callbacks.js
- +8 −7 src/core.js
- +9 −6 src/core/access.js
- +4 −10 src/core/ready-no-deferred.js
- +14 −0 src/core/stripAndCollapse.js
- +9 −7 src/css.js
- +1 −1 src/css/showHide.js
- +26 −8 src/data.js
- +3 −3 src/data/Data.js
- +11 −6 src/effects.js
- +41 −22 src/event.js
- +6 −6 src/exports/global.js
- +3 −2 src/jquery.js
- +17 −9 src/manipulation/getAll.js
- +11 −7 src/serialize.js
- +19 −12 src/traversing/findFilter.js
- +8 −0 src/var/rnothtmlwhite.js
- +0 −5 src/var/rnotwhite.js
- +1 −1 src/wrapper.js
- +0 −1 test/{.eslintrc → .eslintrc.json}
- +1 −0 test/data/test3.html
- +1 −3 test/data/testinit.js
- +1 −1 test/node_smoke_tests/{.eslintrc → .eslintrc.json}
- +0 −4 test/promises_aplus_adapters/.eslintrc
- +4 −0 test/promises_aplus_adapters/.eslintrc.json
- +30 −9 test/unit/ajax.js
- +47 −3 test/unit/attributes.js
- +13 −17 test/unit/core.js
- +10 −1 test/unit/css.js
- +1 −1 test/unit/manipulation.js
- +2 −19 test/unit/support.js
- +14 −0 test/unit/traversing.js
| @@ -8,11 +8,11 @@ | ||
| .bower.json | ||
| .sizecache.json | ||
| -npm-debug.log | ||
| +npm-debug.log* | ||
| # Ignore everything in dist folder except for eslint config | ||
| /dist/* | ||
| -!/dist/.eslintrc | ||
| +!/dist/.eslintrc.json | ||
| /node_modules | ||
| @@ -86,8 +86,10 @@ Scott Jehl <scottjehl@gmail.com> <scott@scottjehl.com> | ||
| Sebastian Burkhard <sebi.burkhard@gmail.com> | ||
| Senya Pugach <upisfree@outlook.com> | ||
| Thomas Tortorini <thomastortorini@gmail.com> Mr21 | ||
| -Timmy Willison <timmywillisn@gmail.com> | ||
| -Timmy Willison <timmywillisn@gmail.com> <tim.willison@thisismedium.com> | ||
| +Timmy Willison <4timmywil@gmail.com> | ||
| +Timmy Willison <4timmywil@gmail.com> <timmywillisn@gmail.com> | ||
| +Timmy Willison <4timmywil@gmail.com> <tim.willison@thisismedium.com> | ||
| +Timmy Willison <4timmywil@gmail.com> <timmywil@users.noreply.github.com> | ||
| Timo Tijhof <krinklemail@gmail.com> | ||
| TJ Holowaychuk <tj@vision-media.ca> | ||
| Tom H Fuertes <tomfuertes@gmail.com> | ||
| @@ -1,5 +1,5 @@ | ||
| .eslintignore | ||
| -.eslintrc | ||
| +.eslintrc.json | ||
| /.editorconfig | ||
| /.gitattributes | ||
| @@ -77,7 +77,7 @@ Jared Grippe <jared@deadlyicon.com> | ||
| Sylvester Keil <sylvester@keil.or.at> | ||
| Brandon Sterne <bsterne@mozilla.com> | ||
| Mathias Bynens <mathias@qiwi.be> | ||
| -Timmy Willison <timmywillisn@gmail.com> | ||
| +Timmy Willison <4timmywil@gmail.com> | ||
| Corey Frang <gnarf37@gmail.com> | ||
| Digitalxero <digitalxero> | ||
| Anton Kovalyov <anton@kovalyov.net> | ||
| @@ -14,9 +14,14 @@ module.exports = function( grunt ) { | ||
| var fs = require( "fs" ), | ||
| gzip = require( "gzip-js" ), | ||
| + oldNode = /^v0\./.test( process.version ); | ||
| - // Skip jsdom-related tests in Node.js 0.10 & 0.12 | ||
| - runJsdomTests = !/^v0/.test( process.version ); | ||
| + // Support: Node.js <4 | ||
| + // Skip running tasks that dropped support for Node.js 0.10 & 0.12 | ||
| + // in those Node versions. | ||
| + function runIfNewNode( task ) { | ||
| + return oldNode ? "print_old_node_message:" + task : task; | ||
| + } | ||
| if ( !grunt.option( "filename" ) ) { | ||
| grunt.option( "filename", "jquery.js" ); | ||
| @@ -108,9 +113,15 @@ module.exports = function( grunt ) { | ||
| // See https://github.com/sindresorhus/grunt-eslint/issues/119 | ||
| quiet: true | ||
| }, | ||
| - all: ".", | ||
| - dist: "dist/jquery.js", | ||
| - dev: [ "src/**/*.js", "Gruntfile.js", "test/**/*.js", "build/**/*.js" ] | ||
| + | ||
| + // We have to explicitly declare "src" property otherwise "newer" | ||
| + // task wouldn't work properly :/ | ||
| + dist: { | ||
| + src: "dist/jquery.js" | ||
| + }, | ||
| + dev: { | ||
| + src: [ "src/**/*.js", "Gruntfile.js", "test/**/*.js", "build/**/*.js" ] | ||
| + } | ||
| }, | ||
| testswarm: { | ||
| tests: [ | ||
| @@ -144,7 +155,7 @@ module.exports = function( grunt ) { | ||
| ] | ||
| }, | ||
| watch: { | ||
| - files: [ "<%= eslint.dev %>" ], | ||
| + files: [ "<%= eslint.dev.src %>" ], | ||
| tasks: [ "dev" ] | ||
| }, | ||
| uglify: { | ||
| @@ -176,33 +187,55 @@ module.exports = function( grunt ) { | ||
| } ); | ||
| // Load grunt tasks from NPM packages | ||
| - require( "load-grunt-tasks" )( grunt ); | ||
| + // Support: Node.js <4 | ||
| + // Don't load the eslint task in old Node.js, it won't parse. | ||
| + require( "load-grunt-tasks" )( grunt, { | ||
| + pattern: oldNode ? [ "grunt-*", "!grunt-eslint" ] : [ "grunt-*" ] | ||
| + } ); | ||
| // Integrate jQuery specific tasks | ||
| grunt.loadTasks( "build/tasks" ); | ||
| - grunt.registerTask( "lint", [ "jsonlint", "eslint:all" ] ); | ||
| + grunt.registerTask( "print_old_node_message", function() { | ||
| + var task = [].slice.call( arguments ).join( ":" ); | ||
| + grunt.log.writeln( "Old Node.js detected, running the task \"" + task + "\" skipped..." ); | ||
| + } ); | ||
| - // Don't run Node-related tests in Node.js < 1.0.0 as they require an old | ||
| - // jsdom version that needs compiling, making it harder for people to compile | ||
| - // jQuery on Windows. (see gh-2519) | ||
| - grunt.registerTask( "test_fast", runJsdomTests ? [ "node_smoke_tests" ] : [] ); | ||
| + grunt.registerTask( "lint", [ | ||
| + "jsonlint", | ||
| + runIfNewNode( "eslint" ) | ||
| + ] ); | ||
| - grunt.registerTask( "test", [ "test_fast" ].concat( | ||
| - runJsdomTests ? [ "promises_aplus_tests" ] : [] | ||
| - ) ); | ||
| + grunt.registerTask( "lint:newer", [ | ||
| + "newer:jsonlint", | ||
| + runIfNewNode( "newer:eslint" ) | ||
| + ] ); | ||
| - // Short list as a high frequency watch task | ||
| - grunt.registerTask( "dev", [ | ||
| - "build:*:*", | ||
| - "newer:eslint:dev", | ||
| - "uglify", | ||
| - "remove_map_comment", | ||
| - "dist:*" | ||
| - ] | ||
| - ); | ||
| + grunt.registerTask( "test:fast", runIfNewNode( "node_smoke_tests" ) ); | ||
| + grunt.registerTask( "test:slow", runIfNewNode( "promises_aplus_tests" ) ); | ||
| - grunt.registerTask( "default", [ "dev", "eslint:dist", "test_fast", "compare_size" ] ); | ||
| + grunt.registerTask( "test", [ | ||
| + "test:fast", | ||
| + "test:slow" | ||
| + ] ); | ||
| - grunt.registerTask( "precommit_lint", [ "newer:jsonlint", "newer:eslint:all" ] ); | ||
| + grunt.registerTask( "dev", [ | ||
| + "build:*:*", | ||
| + runIfNewNode( "newer:eslint:dev" ), | ||
| + "newer:uglify", | ||
| + "remove_map_comment", | ||
| + "dist:*", | ||
| + "compare_size" | ||
| + ] ); | ||
| + | ||
| + grunt.registerTask( "default", [ | ||
| + runIfNewNode( "eslint:dev" ), | ||
| + "build:*:*", | ||
| + "uglify", | ||
| + "remove_map_comment", | ||
| + "dist:*", | ||
| + runIfNewNode( "eslint:dist" ), | ||
| + "test:fast", | ||
| + "compare_size" | ||
| + ] ); | ||
| }; | ||
| @@ -40,11 +40,12 @@ function makeReleaseCopies( Release ) { | ||
| // Map files need to reference the new uncompressed name; | ||
| // assume that all files reside in the same directory. | ||
| - // "file":"jquery.min.js","sources":["jquery.js"] | ||
| + // "file":"jquery.min.js" ... "sources":["jquery.js"] | ||
| text = fs.readFileSync( builtFile, "utf8" ) | ||
| - .replace( /"file":"([^"]+)","sources":\["([^"]+)"\]/, | ||
| - "\"file\":\"" + unpathedFile.replace( /\.min\.map/, ".min.js" ) + | ||
| - "\",\"sources\":[\"" + unpathedFile.replace( /\.min\.map/, ".js" ) + "\"]" ); | ||
| + .replace( /"file":"([^"]+)"/, | ||
| + "\"file\":\"" + unpathedFile.replace( /\.min\.map/, ".min.js\"" ) ) | ||
| + .replace( /"sources":\["([^"]+)"\]/, | ||
| + "\"sources\":[\"" + unpathedFile.replace( /\.min\.map/, ".js" ) + "\"]" ); | ||
| fs.writeFileSync( releaseFile, text ); | ||
| } else if ( builtFile !== releaseFile ) { | ||
| shell.cp( "-f", builtFile, releaseFile ); | ||
| @@ -94,17 +94,18 @@ module.exports = function( Release, files, complete ) { | ||
| fs.writeFileSync( Release.dir.dist + "/bower.json", generateBower() ); | ||
| console.log( "Adding files to dist..." ); | ||
| - Release.exec( "git add .", "Error adding files." ); | ||
| + | ||
| + Release.exec( "git add -A", "Error adding files." ); | ||
| Release.exec( | ||
| - "git commit -m 'Release " + Release.newVersion + "'", | ||
| + "git commit -m \"Release " + Release.newVersion + "\"", | ||
| "Error committing files." | ||
| ); | ||
| console.log(); | ||
| console.log( "Tagging release on dist..." ); | ||
| Release.exec( "git tag " + Release.newVersion, | ||
| "Error tagging " + Release.newVersion + " on dist repo." ); | ||
| - Release.tagTime = Release.exec( "git log -1 --format='%ad'", | ||
| + Release.tagTime = Release.exec( "git log -1 --format=\"%ad\"", | ||
| "Error getting tag timestamp." ).trim(); | ||
| } | ||
| @@ -17,7 +17,6 @@ module.exports = function( grunt ) { | ||
| read = function( fileName ) { | ||
| return grunt.file.read( srcFolder + fileName ); | ||
| }, | ||
| - globals = read( "exports/global.js" ), | ||
| wrapper = read( "wrapper.js" ).split( /\/\/ \@CODE\n\/\/[^\n]+/ ), | ||
| config = { | ||
| baseUrl: "src", | ||
| @@ -38,11 +37,8 @@ module.exports = function( grunt ) { | ||
| // Avoid breaking semicolons inserted by r.js | ||
| skipSemiColonInsertion: true, | ||
| wrap: { | ||
| - start: wrapper[ 0 ].replace( /\/\*eslint .* \*\/\n/, "" ), | ||
| - end: globals.replace( | ||
| - /\/\*\s*ExcludeStart\s*\*\/[\w\W]*?\/\*\s*ExcludeEnd\s*\*\//ig, | ||
| - "" | ||
| - ) + wrapper[ 1 ] | ||
| + start: wrapper[ 0 ].replace( /\/\*\s*eslint(?: |-).*\s*\*\/\n/, "" ), | ||
| + end: wrapper[ 1 ] | ||
| }, | ||
| rawText: {}, | ||
| onBuildWrite: convert | ||
| @@ -1,10 +1,12 @@ | ||
| { | ||
| - "extends": "../src/.eslintrc", | ||
| + "extends": "../src/.eslintrc.json", | ||
| "rules": { | ||
| - // That is okay for built version | ||
| + // That is okay for the built version | ||
| "no-multiple-empty-lines": "off", | ||
| // Because sizze is not compatible to jquery code style | ||
| + "no-nested-ternary": "off", | ||
| + "no-unused-expressions": "off", | ||
| "lines-around-comment": "off", | ||
| "space-in-parens": "off", | ||
| "camelcase": "off", | ||
Showing you all comments on commits in this comparison.
|
This was PR #3225, I forgot to link the commit. |
|
This was PR #3225, I forgot to link the commit. |
|
@markelog Why the PR reference in the commit title? It shoulnd't be there, instead there should be the line saying |
|
That's what happens when pr closed via github interface, we discuss this on of the meetings a month ago |
|
I missed the discussion; do you have a link? Was the decision that we accept landing commits in this way? |
No, there should be something in the archives though or maybe it was on github, this is the reason on why we allow only |
|
Just some remarks : It's good to transform a spaghetti code into a more clearer code but multiplying return statements is also considered as bad pratice because you can't figure out rapidly where you exit the function and where you continue with the other test conditions. Do what you want with this :
I add that getData is quite a too generic name... |
As is the use of passive voice, since it obscures the actor. For an opposing point of view, I think early returns are much clearer than else-if chains because they allow you to clearly assert that specific cases are not in the domain of inputs at that point in the function. In any case, we rarely refactor code for style reasons because of the risk of introducing errors. jQuery is too widely used to go rearranging things for no functional reason. |
"The actor" is not me but the developer community. Was it on what you wanted me to be clearer about?
Yep ! That is exactly what I said to myself when I understood the transformation. Funny, no? :D |
|
@LaurentBarbareau We mainly did this transformation to satisfy eslint's recommended rules. There are multiple ways we could have done it, but we went with this one. Further transformation would just be a matter of taste. |
|
@timmywil Ok! It's a good argument. |