aboutsummaryrefslogtreecommitdiffstats
path: root/Gruntfile.js
Commit message (Collapse)AuthorAgeFilesLines
* Build: Test on Node 17, update Grunt & `karma-*` packagesMichał Gołębiowski-Owczarek2022-03-141-3/+12
| | | | | | | | | | | | | | This adds testing on Node.js 17 in addition to the currently tested 10, 12, 14 and 16 versions. Also, update Grunt & `karma-*` packages. Testing in Karma on jsdom is broken in Node 17 at the moment; until we find a fix, this change disables such testing on Node 17 or newer. Node smoke tests & promises aplus tests are disabled on Node.js 10 as they depend on jsdom and the latest jsdom version doesn't run properly on Node 10. Closes gh-5023
* Build: remove travis.yml and travis mentions from core (#4983)Timmy Willison2021-12-131-1/+1
| | | | We've migrated to GH actions on jQuery core and have already disabled travis builds for core.
* Build: Migrate CI to GitHub Actionsygj62021-11-301-5/+5
| | | Closes gh-4800
* Tests: Make Karma browser timeout larger than the QUnit oneMichał Gołębiowski-Owczarek2021-10-301-0/+4
| | | | | | | | | Since the default Karma browser no activity timeout was lower than the QUnit timeout, a single timing out test was interrupting the whole test run of a browser. The QUnit timeout is set to 1 minute so I set the Karma one to 2 minutes. Closes gh-4943
* Build: Update ESLint & eslint-plugin-import, fixing the buildMichał Gołębiowski-Owczarek2021-10-291-13/+32
| | | | | | | | | | Latest `main` started failing the build after some transitive dependencies got updated, incorrectly recognizing some files with default exports as unused. Since the new ESLint no longer supports Node 10 which we have to build on due to use in our CI, skip ESLint in Node 10. Ref gh-3225 Closes gh-4961
* Build: Take core-js-bundle from the external directory as wellMichał Gołębiowski-Owczarek2021-04-131-0/+3
| | | | | | | That package was missed in gh-4865 as it only broke browsers needing the polyfill which is just IE at the moment. Thus, it broke Core tests in IE only. Ref gh-4865 Closes gh-4870
* Build: Restore the external directoryMichał Gołębiowski-Owczarek2021-03-241-4/+24
| | | | | | | | | | | | In gh-4466, we removed the `external` directory in favor of loading some files directly from `node_modules`. This works fine locally but when deploying code for tests, this makes it impossible to not deploy `node_modules` as well. To avoid the issue, this change restores usage of the `external` directory. One change is that we no longer commit this directory to the repository, its only purpose is to have clear isolation from `node_modules`. Ref gh-4466 Closess gh-4865
* Build: Append .eslintignore paths to grunt eslint pathsEd Sanders2020-07-271-5/+15
| | | | | | | This allows us to turn off the `quiet` option which was suppressing warnings. We can also set `maxWarnings` to 0 now that aren't any. Closes gh-4689
* Docs: Change JS Foundation mentions to OpenJS FoundationMichał Gołębiowski-Owczarek2020-05-181-1/+1
| | | Closes gh-4711
* Build: Followups after introducing ES modules compiled via RollupMichał Gołębiowski-Owczarek2020-05-051-2/+2
| | | | | | | | | | This commit cleans up a few comments & configurations that are out of date after the migration to ES modules backed by a Rollup-based compilation. Also, de-indent AMD modules. This will preserve a more similar structure to the one on 3.x-stable where the body of the main `define` wrapper is not indented. Closes gh-4705
* Build: Lint the minified jQuery file as well - a Gruntfile fixMichał Gołębiowski-Owczarek2020-01-271-1/+1
| | | | | | | | While we have absolutely no style-related expectations to our minified file, we do care that it's valid ES 5.1. This is now verified. Fixes gh-3075 Ref gh-4594 Closes gh-4598
* Ajax: Deprecate AJAX event aliases, inline event/alias into deprecatedMichał Gołębiowski-Owczarek2020-01-211-2/+3
| | | | | | | | A new `src/deprecated` directory makes it possible to exclude some deprecated APIs from a custom build when their respective "parent" module is excluded without keeping that module outside of the `src/deprecated` directory or the `src/deprecated.js` file. Closes gh-4572
* Build: Make dev mode work in Karma again, serve source files from diskMichał Gołębiowski-Owczarek2020-01-081-4/+21
| | | | | | | | | | | | | | | | | | PR gh-4550 added support for running ES modules & AMD tests via Karma. This required reading the `esmodules` & `amd` props from both `QUnit.config` & `QUnit.urlParams`. By picking these two properties manually, the `dev` one stopped being respected while ones handled directly by QUnit were fine (like `hidepassed`). Instead of maintaining the full list of options, the code now iterates over QUnit URL config and handles the fallbacks in a more generic way. Apart from that, all jQuery source & test files are now read directly from disk instead of being cached by Karma so that one can run `grunt karma:chrome-debug` & work on a fix without restarting that Karma run after each change. A similar effect could have been achieved by setting `autoWatch` to `true` but then the main Karma page runs tests in an iframe by default when `grunt karma:chrome-debug` is run instead of relying on the current debug flow. Closes gh-4574 Ref gh-4550
* Build:Tests: Fix custom build tests, verify on Travis Michał Gołębiowski-Owczarek2020-01-071-2/+8
| | | | | | | | | | | This commit fixes unit tests for the following builds: 1. The no-deprecated build: `custom:-deprecated` 2. The current slim build: `custom:-ajax,-effects` 3. The future (#4553) slim build: `custom:-ajax,-callbacks,-deferred,-effects` It also adds separate Travis jobs for the no-deprecated & slim builds. Closes gh-4577
* Build: Make Karma work in ES modules modeMichał Gołębiowski-Owczarek2019-12-161-27/+39
| | | | | | Also, run such a suite in CI to make sure modules are working as expected when used directly. Closes gh-4550
* Build: Auto-convert sources to AMDMichał Gołębiowski-Owczarek2019-12-091-0/+2
| | | | | | | | | | | | | | | jQuery source has been migrated in gh-4541 from AMD to ES modules. To maintain support for consumers of our AMD modules, this commits adds a task transpiling the ES modules sources in `src/` to AMD in `amd/`. A "Load with AMD" checkbox was also restored to the QUnit setup. Note that, contrary to jQuery 3.x, AMD files need to be generated via `grunt amd` or `grunt` as sources are not authored in ECMAScript modules. To achieve a similar no-compile experience during jQuery 4.x testing, use the new "Load as modules" checkbox which works in all supported browsers except for IE & Edge (the legacy, EdgeHTML-based one). Ref gh-4541 Closes gh-4554
* Core: Migrate from AMD to ES modules 🎉Michał Gołębiowski-Owczarek2019-11-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | Migrate all source AMD modules to ECMAScript modules. The final bundle is compiled by a custom build process that uses Rollup under the hood. Test files themselves are still loaded via RequireJS as that has to work in IE 11. Tests can now be run in "Load as modules" mode which replaces the previous "Load with AMD" option. That option of running tests doesn't work in IE and Edge as it requires support for dynamic imports. Some of the changes required by the migration: * check `typeof` of `noGlobal` instead of using the variable directly as it's not available when modules are used * change the nonce module to be an object as ECMASscript module exports are immutable * remove some unused exports * import `./core/parseHTML.js` directly in `jquery.js` so that it's not being cut out when the `ajax` module is excluded in a custom compilation Closes gh-4541
* Build: Run tests on Travis only on browsers defined in the configMichał Gołębiowski-Owczarek2019-10-221-2/+4
| | | | | | The environmental variable BROWSERS was being created but it wasn't read in the list of browsers to pass to Karma. Closes gh-4532
* Build: Run tests on Travis on FirefoxHeadless as wellMichał Gołębiowski-Owczarek2019-10-211-5/+2
| | | | | | | | | | Also, run them on both ChromeHeadless & FirefoxHeadless locally on `grunt karma:main`. Plus, so far, the chrome addons were installed for all the jobs, even the ones that weren't used for browser testing. Changing that makes those jobs faster. Closes gh-4524
* Build: Require strict mode in Node.js scripts via ESLintMichał Gołębiowski-Owczarek2019-10-091-2/+2
| | | | | | | | So far, only browser-based JS files were required to be in strict mode (in the function form). This commit adds such a requirement to Node.js scripts where the global form is preferred. All Node.js scripts in sloppy mode were converted to strict mode. Closes gh-4499
* Build: Remove the external directory, read from node_modules directlyMichał Gołębiowski-Owczarek2019-08-261-24/+4
| | | | | | Now that Sizzle is gone & we use npm, we can read from node_modules directly and skip the setup that copies some files to the external directory. Closes gh-4466
* Tests: update npo.js and include unminified source insteadTimmy Willison2019-08-121-1/+1
| | | | Close gh-4446 Ref gh-4445
* Selector: Inline Sizzle into the selector moduleMichał Gołębiowski-Owczarek2019-07-291-5/+1
| | | | | | | | | | | | | | | | | | This commit removes Sizzle from jQuery, inlining its code & removing obsolete workarounds where applicable. The selector-native module has been removed. Further work on the selector module may decrease the size enough that it will no longer be necessary. If it turns out it's still useful, we'll reinstate it but the code will look different anyway as we'll want to share as much code as possible with the existing selector module. The Sizzle AUTHORS.txt file has been merged with the jQuery one - people are sorted by their first contributions to either of the two repositories. The commit reduces the gzipped jQuery size by 1460 bytes compared to master. Closes gh-4395
* Core: Drop support for IE <11, iOS <11, Firefox <65, Android Browser & PhantomJSMichał Gołębiowski-Owczarek2019-04-291-36/+7
| | | | | | | | | | | Also, update support comments format to match format described in: https://github.com/jquery/contribute.jquery.org/issues/95#issuecomment-69379197 with the change from: https://github.com/jquery/contribute.jquery.org/issues/95#issuecomment-448998379 (open-ended ranges end with `+`). Fixes gh-3950 Fixes gh-4299 Closes gh-4347
* Build: Run the basic test suite in jsdomMichał Gołębiowski-Owczarek2019-03-111-2/+50
| | | | | | The basic test suite is now run in jsdom on all supported Node.js versions (8, 10 & 11 as of now). Closes gh-4310
* Build: Update QUnit from 1.23.1 to 2.9.2Michał Gołębiowski-Owczarek2019-03-041-9/+3
| | | Closes gh-4307
* Build: Update jsdom; migrate a test with Symbol polyfill to an iframe testMichał Gołębiowski-Owczarek2019-03-041-2/+2
| | | | | | | | | | | So far, we've been testing that jQuery element iteration works with polyfilled Symbol & transpiled for-of via a Node test with jsdom with the Symbol global removed. Unfortunately, jsdom now requires Symbol to be present for its internal functionality so such a test is no longer possible. Instead, it's been migrated to an iframe test with transpiled JavaScript. This PR also enables us to use ECMAScript 2017 or newer in Node.js code. Closes gh-4305
* Build: Update most dependenciesabnud12019-02-191-1/+1
| | | | | | | | | | | | | | | | The only packages not fully updated are: - qunitjs & karma-qunit as that's a QUnit 2.x update that will require some changes and we'll do that later - jsdom as we need to first rewrite the test with the Symbol polyfill - newer jsdom versions don't work with such a hacked Symbol instance - sinon as the v2 -> v7 upgrade requires to update our unit tests - uglify-js & grunt-contrib-uglify as latest uglify-js versions slightly worsen the minified gzipped size Closes gh-4227 Closes gh-4228 Closes gh-4230 Closes gh-4232
* Tests: add IE launcher for debugging IE11 on WindowsTimmy Willison2018-11-271-0/+4
|
* Tests: Allow Karma to load unminfied sourceRichard Gibson2018-09-071-4/+4
| | | Closes gh-4128
* Traversing: $.fn.contents() support for objectLuis Emilio Velasco Sanchez2018-05-141-1/+1
| | | | | Fixes gh-4045 Closes gh-4046
* Build: Don't require sudo on Travis, use sandboxless headless ChromeMichał Gołębiowski-Owczarek2018-03-191-2/+11
| | | | | | The Chrome sandbox doesn't work on Travis unless sudo is enabled. Instead, we're disabling the Chrome sandbox. Closes gh-4011
* Build: remove artefact from previous commitOleg Gaydarenko2018-03-071-1/+0
| | | | Follow-up for 09684ba3f210594e41ecddf369ac94c688d53ccb
* Build: Seasonal update of uglify and its optionsOleg Gaydarenko2018-03-051-1/+1
| | | | | | | | raw gz Compared to last run = = dist/jquery.js -294 -88 dist/jquery.min.js Closes gh-3994
* Build: Add "-debug" suffix to name of karma debug tasksTimo Tijhof2018-01-171-12/+15
| | | | | Ref gh-3922 Close gh-3936
* Tests: correctly set sudo in travis config, not karma configTimmy Willison2018-01-161-7/+1
|
* Tests: temporarily require sudo access for karma:main on travisTimmy Willison2018-01-161-1/+7
| | | | | - This should fix the broken travis build on Node 8 - See https://github.com/travis-ci/travis-ci/issues/8836
* Build: Fix UglifyJS output in Android 4.0; update uglifyTimmy Willison2018-01-081-1/+6
| | | | | | | - Thanks to @mgol for first pass Fixes gh-3743 Close gh-3920
* Tests: Add support for running unit tests via grunt with karmaTimo Tijhof2017-12-181-0/+84
| | | | | | | | | | | | | - Update QUnit to 1.23.1 - Remove unused dl#dl from test/index.html - Remove unused map#imgmap from test/index.html - Ensure all urls to data use baseURI - Add the 'grunt karma:main' task - customContextFile & customDebugFile - Add 'npm run jenkins' script Close gh-3744 Fixes gh-1999
* Build: Update to Babel 7, use for-of plugin instead of preset-es2015Henry Zhu2017-09-251-1/+2
| | | Closes gh-3786
* Build: fix uglify options for uglify updateTimmy Willison2017-07-101-3/+7
| | | | | | | - Uses new typeofs option for compression - See https://github.com/mishoo/UglifyJS2/issues/2198 Close gh-3710
* Build: Drop support for building on Node.js 0.12Michał Gołębiowski2016-12-301-28/+11
| | | | | | | | | | | Node.js 0.12 is no longer supported by upstream. So far we had to keep a workaround that would skip running ESLint there (or even load its task) as it no longer supports Node.js <4; the same applied to Node smoke tests as jsdom has also dropped support for those old Node versions. Those workarounds have been removed now. Ref 030191ae32dfcb7ecb2efb61d17a4964a3633e44 Closes gh-3478
* Build: ESLint setup improvementsMichał Gołębiowski2016-12-191-2/+11
| | | | | | | 1. Use the short name of the preset in the config. 2. Run ESLint first on non-minified files. 3. Explicitly specify environments in every config file (those settings cascade which means we've been assuming a Node.js environment where we shouldn't have).
* Build: jQuery Foundation -> JS FoundationTimmy Willison2016-12-051-1/+1
| | | | Close gh-3414
* Build: Stop testing on Node.js 0.10Michał Gołębiowski2016-10-311-2/+2
| | | | | Node.js 0.10 loses upstream support today (see https://github.com/nodejs/LTS/) so let's stop testing against it as well.
* Build: Simplify Gruntfile constructionsOleg Gaidarenko2016-08-021-25/+35
| | | | Fixes gh-3246
* Build: Don't lint every file in dist/ (#3245)Michał Gołębiowski2016-07-261-3/+4
| | | | | 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`.
* Build: Skip running ESLint on Node.js 0.xMichał Gołębiowski2016-07-131-13/+35
| | | | | | | | | 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
* Build: Improve ESLint configuration (#3188)Oleg Gaidarenko2016-06-221-1/+2
| | | | | | | | | * Bump eslint-config-jquery package to 0.1.4 version * Add subtask "dist" to "eslint" task and add it to the build task list * Make gitignore globs more flexible for the "dist" folder Fixes gh-3169
* Build: ESLint detailsOleg Gaidarenko2016-06-111-2/+3
| | | | | | Use eslint pragmas, fix new errors, etc Closes gh-3148