aboutsummaryrefslogtreecommitdiffstats
path: root/build/tasks
Commit message (Collapse)AuthorAgeFilesLines
* Build: Report Brotli sizes in compareSizeMichał Gołębiowski-Owczarek2024-11-251-4/+12
| | | | | | | | | | | | | | | | So far, we were mostly optimizing gzipped sizes. However, using Brotli is more and more popular as all modern browsers support it and compression is much better. It makes sense to also pay attention to these numbers. The `comparseSize` version stays at `2` as this only introduces a new field without affecting existing ones. The only drawback is comparisons with branches that didnt have Brotli computed before will return `NaN`. This can be easily fixed locally by checking out the branch and running the build, but at least we don't lose gzipped sizes in the meantime. Closes gh-5586 (cherry picked from commit e4b5e6227717039a9c695b12e40d3f73ffec31b0)
* Build: Fix pre release matching in compare size regexTimmy Willison2024-11-211-2/+2
| | | | | | Closes gh-5584 (cherry picked from commit 041f6e347b621227822b900a7a821d341f0c5d53)
* Release: migrate release process to release-itTimmy Willison2024-07-2912-100/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *Authors* - Checking and updating authors has been migrated to a custom script in the repo *Changelog* - changelogplease is no longer maintained - generate changelog in markdown for GitHub releases - generate changelog in HTML for blog posts - generate contributors list in HTML for blog posts *dist* - clone dist repo, copy files, and commit/push - commit tag with dist files on main branch; remove dist files from main branch after release *cdn* - clone cdn repo, copy files, and commit/push - create versioned and unversioned copies in cdn/ - generate md5 sums and archives for Google and MSFT *build* - implement reproducible builds and verify release builds * uses the last modified date for the latest commit * See https://reproducible-builds.org/ - the verify workflow also ensures all files were properly published to the CDN and npm *docs* - the new release workflow is documented at build/release/README.md *verify* - use the last modified date of the commit before the tag - use versioned filenames when checking map files on the CDN - skip factory and package.json files when verifying CDN *misc* - now that we don't need the jquery-release script and now that we no longer need to build on Node 10, we can use ESM in all files in the build folder - limit certain workflows to the main repo (not forks) - version has been set to the previously released version 3.7.1, as release-it expects - release-it added the `preReleaseBase` option and we now always set it to `1` in the npm script. This is a noop for stable releases. - include post-release script to be run manually after a release, with further steps that should be verified manually Ref jquery/jquery-release#114 Closes gh-5522
* Build: upgrade dependencies, including eslint 9.4.0 and uglify 3.7.7Timmy Willison2024-06-153-3/+3
| | | | | | | | | | | | | - Sinon is already at the latest version that supports IE9. - Upgraded uglify to 3.7.7, which is the latest that worked with IE9. I tried 3.9.4, which we are using in jquery-migrate, and 3.8.1, but there were failures in traversing ("Permission denied" errors). - Upgraded eslint to version 9, which required some changes. Mainly, unused arguments in catch expressions error by default in 9+. The config now makes use of `caughtErrorsIgnorePattern`, which is set to `"^_"`, the same as unused function params. - Ignored main branch dist files when switching branches. Closes gh-5508
* Build: make compare size cache readable for manual editsTimmy Willison2024-03-111-1/+3
| | | | Ref gh-5441
* Build: fix size comparison for slim files when the branch is dirtyTimmy Willison2024-03-111-1/+1
| | | | Ref gh-5441
* Build: migrate more uses of fs.promises; use node: protocolTimmy Willison2024-03-117-26/+26
| | | | Ref gh-5441
* Build: drop support for Node 10Timmy Willison2024-03-091-8/+8
| | | | Close gh-5437
* Tests: migrate testing infrastructure to minimal dependenciesTimmy Willison2024-03-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a complete rework of our testing infrastructure. The main goal is to modernize and drop deprecated or undermaintained dependencies (specifically, grunt, karma, and testswarm). We've achieved that by limiting our dependency list to ones that are unlikely to drop support any time soon. The new dependency list includes: - `qunit` (our trusty unit testing library) - `selenium-webdriver` (for spinning up local browsers) - `express` (for starting a test server and adding middleware) - express middleware includes uses of `body-parser` and `raw-body` - `yargs` (for constructing a CLI with pretty help text) - BrowserStack (for running each of our QUnit modules separately in all of our supported browsers) - `browserstack-local` (for opening a local tunnel. This is the same package still currently used in the new Browserstack SDK) - We are not using any other BrowserStack library. The newest BrowserStack SDK does not fit our needs (and isn't open source). Existing libraries, such as `node-browserstack` or `browserstack-runner`, either do not quite fit our needs, are under-maintained and out-of-date, or are not robust enough to meet all of our requirements. We instead call the [BrowserStack REST API](https://github.com/browserstack/api) directly. **BrowserStack** - automatically retries individual modules in case of test failure(s) - automatically attempts to re-establish broken tunnels - automatically refreshes the page in case a test run has stalled - Browser workers are reused when running isolated modules in the same browser - runs all browsers concurrently and uses as many sessions as are available under the BrowserStack plan. It will wait for available sessions if there are none. - supports filtering the available list of browsers by browser name, browser version, device, OS, and OS version (see `npm run test:unit -- --list-browsers` for more info). It will retrieve the latest matching browser available if any of those parameters are not specified. Supports latest and latest-\d+ in place of browser version. - cleans up after itself (closes the local tunnel, stops the test server, etc.) - Requires `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` environment variables. **Selenium** - supports running any local browser as long as the driver is installed, including support for headless mode in Chrome, FF, and Edge - supports running `basic` tests on the latest [jsdom](https://github.com/jsdom/jsdom#readme), which can be seen in action in this PR (see `test:browserless`) - Node tests will run as before in PRs and all non-dependabot branches, but now includes tests on real Safari in a GH actions macos image instead of playwright-webkit. - can run multiple browsers and multiple modules concurrently Other notes: - Stale dependencies have been removed and all remaining dependencies have been upgraded with a few exceptions: - `sinon`: stopped supporting IE in version 10. But, `sinon` has been updated to 9.x. - `husky`: latest does not support Node 10 and runs on `npm install`. Needed for now until git builds are migrated to GitHub Actions. - `rollup`: latest does not support Node 10. Needed for now until git builds are migrated to GitHub Actions. - BrowserStack tests are set to run on each `main` branch commit - `debug` mode leaves Selenium browsers open whether they pass or fail and leaves browsers with test failures open on BrowserStack. The latter is to avoid leaving open too many sessions. - This PR includes a workflow to dispatch BrowserStack runs on-demand - The Node version used for most workflow tests has been upgraded to 20.x - updated supportjQuery to 3.7.1 Run `npm run test:unit -- --help` for CLI documentation Close gh-5427
* Release: use buildDefaultFiles directly and pass version (#5409)Timmy Willison2024-02-062-2/+4
| | | | | | | - also add the ability to pass VERSION in env to test final builds - adjust sha regex to account for lack of shas - set the version on the dist package.json Close gh-5408
* Build: Update ESLint-related packages, fix linting errors (3.x version)Michał Gołębiowski-Owczarek2023-11-027-19/+21
| | | | | | | | The main change is the new rule in `eslint-config-jquery`: `template-curly-spacing`. Closes gh-5348 Ref jquery/eslint-config-jquery#21 Ref gh-5347
* Build: sort branches in compare_size; last run lastTimmy Willison2023-09-211-3/+20
| | | Close gh-5334
* Build: migrate most grunt tasks off of grunt (3.x)Timmy Willison2023-09-2016-524/+693
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Close gh-5330 - lint - npmcopy - build, minify, and process for distribution. - new custom build command using yargs - compare size of minified/gzip built files - pretest scripts, including qunit-fixture, babel transpilation, and npmcopy - node smoke tests - promises aplus tests - new watch task using nodemon, which runs `npm run build:all` on `src` changes. Also: - upgraded husky and added the new lint command - updated lint config to use new "flat" config format. See https://eslint.org/docs/latest/use/configure/configuration-files-new - Temporarily disabled one lint rule until flat config is supported by eslint-plugin-import. See https://github.com/import-js/eslint-plugin-import/issues/2556 - committed package-lock.json - updated all test scripts to use the new build - added an express test server that uses middleware-mockserver this can be used to run tests without karma - build-all-variants is now build:all - run pretest script in jenkins --------- Co-authored-by: Michał Gołębiowski-Owczarek <m.goleb@gmail.com>
* Build: Generate the slim build on `grunt` & run `compare_size` on itMichał Gołębiowski-Owczarek2023-07-103-36/+52
| | | | | | | | | | | | | | Summary of the changes: * expand `node_smoke_tests` to test the full & slim builds * run `compare_size` on all built minified files; don't run it anymore on unminified files where they don't provide lots of value The main goal of this change is to make it easier to compare sizes of both the full & slim builds between the `3.x-stable` & `main` branches. Closes gh-5291 Ref gh-5255 (partially cherry-picked from commit 8be4c0e4f89d6c8f780e5937a0534921d8c7815e)
* Build: remove stale Insight package from custom buildsTimmy Willison2022-12-201-42/+2
| | | Close gh-5181
* Selector: Inline Sizzle into the selector module: 3.x version (#5113)Michał Gołębiowski-Owczarek2022-12-141-26/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit removes Sizzle from jQuery, inlining its code & removing obsolete workarounds where applicable. 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 main `selector` module can be disabled in favor of `selector-native` via: grunt custom:-selector For backwards compatibility, the legacy `sizzle` alias is also supported (it will be dropped in jQuery `4.0.0`): grunt custom:-selector Sizzle tests have been ported to jQuery ones. Ones that are not compatible with the `selector-native` module are disabled if the regular selector module is excluded. Backwards compatibility is still kept for all `Sizzle` utils - they continue to be available under `jQuery.find` - but the primary implementation is now attached directly to jQuery. Some selector utils shared by `selector` & `selector-native` have been extracted & deduplicated. `jQuery.text` and `jQuery.isXMLDoc` have been moved to the `core` module. The commit reduces the gzipped jQuery size by 851 bytes compared to the `3.x-stable` branch. Closes gh-5113 Ref gh-4395 Ref gh-4406
* Tests: Exclude tests based on compilation flags, not API presence (3.x version)Michał Gołębiowski-Owczarek2022-07-122-1/+9
| | | | | | | | | | | | | Introduces a new test API, `includesModule`. The method returns whether a particular module like "ajax" or "deprecated" is included in the current jQuery build; it handles the slim build as well. The util was created so that we don't treat presence of particular APIs to decide whether to run a test as then if we accidentally remove an API, the tests would still not fail. Closes gh-5071 Fixes gh-5069 Ref gh-5046 (partially cherry picked from commit fae5fee8b435cc20352d28b0a384b9784b1ad9ed)
* Build:Tests: Fix custom build tests, verify on Travis; name Travis jobsMichał Gołębiowski-Owczarek2020-01-271-1/+1
| | | | | | | | | | | | | | | | 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 4.0 (#4553) slim build: `custom:-ajax,-callbacks,-deferred,-effects` It also adds separate Travis jobs for the no-deprecated & slim builds. Apart from that, add intuitive names to Travis jobs. Otherwise it's hard to see at a glance that a particular job is running on Firefox ESR, for example. Ref gh-4577 Ref gh-4596 Closes gh-4600
* Build: Create a `grunt custom:slim` alias for the Slim buildMichał Gołębiowski-Owczarek2020-01-071-1/+19
| | | | | | Closes gh-4578 (cherry-picked from 9b9ed469b43e9fa6e2c752444470ae4c87d03d57)
* Build: Require strict mode in Node.js scripts via ESLintMichał Gołębiowski-Owczarek2019-10-096-12/+12
| | | | | | | | | | | 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 (cherry picked from commit bbad821c399da92995a11b88d6684970479d4a9b)
* Build: ESLint: forbid unused function parametersMichał Gołębiowski-Owczarek2019-09-261-1/+1
| | | | | | | | | | | | | | | | This commit requires all function parameters to be used, not just the last one. In cases where that's not possible as we need to match an external API, there's an escape hatch of prefixing an unused argument with `_`. This change makes it easier to catch unused AMD dependencies and unused parameters in internal functions the API of which we may change at will, among other things. Unused AMD dependencies have been removed as part of this commit. Closes gh-4381 (cherry-picked from 438b1a3e8a52d3e4efd8aba45498477038849c97)
* Build: Fix the regex parsing AMD var-modules (#4389)Michał Gołębiowski-Owczarek2019-09-261-1/+1
| | | | | | | | | | | | | | | | | | | The previous regex caused the final jQuery binary to have syntax errors for var-modules with names starting with "return". For example, the following module wouldn't work when the file is named `returnTrue.js`: ```js define( function() { "use strict"; return function returnTrue() { return true; }; } ); ``` Closes gh-4389 (cherry picked from commit 9ec09c3b4aa5182c2a8b8f51afb861b685a4003c)
* Build: Remove manual QUnit fixture resettingMichał Gołębiowski-Owczarek2019-03-111-3/+1
| | | | | | It was needed when QUnit 1.x one used but we've since upgraded to QUnit 2.x. Closes gh-4312 Ref gh-4307
* Build: Make Promises/A+ tests use the dot reporter instead of the defaultMichał Gołębiowski-Owczarek2019-03-111-5/+6
| | | | | | The default reporter is very verbose as it prints all the test names it encounters. We already use the dot reporter for Karma tests. Closes gh-4313
* Build: Update jsdom; migrate a test with Symbol polyfill to an iframe testMichał Gołębiowski-Owczarek2019-03-041-12/+12
| | | | | | | | | | | 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: Remove CRLF line endings to fix builds on WindowsDave Methvin2018-01-091-1/+1
| | | Close gh-3929
* Tests: Add support for running unit tests via grunt with karmaTimo Tijhof2017-12-181-0/+22
| | | | | | | | | | | | | - 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
* Tests: Make Node tests work for paths with spaces in themMichał Gołębiowski-Owczarek2017-10-182-3/+3
| | | | | | Without this patch Jenkins tests fail as jQuery job names there contain spaces, e.g. "jQuery Core". Closes gh-3821
* Build: increase timeout in Promises/A+ tests 10 timesMichał Gołębiowski-Owczarek2017-09-251-3/+6
| | | | | | | The promises-aplus-tests sets up a default 200 ms Mocha timeout. This makes our tests randomly fail on Jenkins. 2 seconds will be safer. Closes gh-3791
* Build: Drop cross-spawn, use child_process.spawn shell optionMichał Gołębiowski-Owczarek2017-09-253-9/+11
|
* Build: Make the @CODE-replacing regex more robustMichał Gołębiowski2016-12-051-1/+5
| | | | | | | | | | | | | The code replacing @CODE in wrapper.js was written so that it expected both the code and the next line to start in the first column. This commit adjusts the regex so to get rid of that assumption and to work properly regardless of number of lines with comments after this block. While this is technically not necessary for our code, contributors sometimes re-format the wrapper file in their pull requests and the error messages they get don't tell them what's the real problem with their code. Closes gh-3429
* Core: expose noConflict in AMD modeTimmy Willison2016-08-151-5/+1
| | | | | | | | - 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
* Build: Fix the regex removing the ESLint comment from wrapper.jsMichał Gołębiowski2016-07-131-1/+1
| | | | | | | 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.
* Build: ESLint detailsOleg Gaidarenko2016-06-112-5/+10
| | | | | | Use eslint pragmas, fix new errors, etc Closes gh-3148
* Tests: Move promise/A+ adapters for tests to dedicated folderOleg Gaidarenko2016-06-111-5/+5
|
* Deferred: Separate the two paths in jQuery.whenRichard Gibson2016-05-021-2/+12
| | | | | | | | Single- and no-argument calls act like Promise.resolve. Multi-argument calls act like Promise.all. Fixes gh-3029 Closes gh-3059
* Build: Strip the strict-mode related comment in exports/global.jsMichał Gołębiowski2016-04-261-1/+4
| | | | | | | The comment (& the JSHint pragma) doesn't make sense in the context of the full built file. Closes gh-3078
* Build: Strip excessive "use strict" pragmas when buildingMichał Gołębiowski2016-04-261-1/+1
| | | | Fixes gh-3077
* Deferred: Remove default callback contextRichard Gibson2016-04-231-0/+3
| | | | | | | Employs strict mode to simplify Deferred callback context handling. Fixes gh-3060 Closes gh-3061
* Core: implement ready without DeferredTimmy Willison2016-04-041-2/+11
| | | | | | | | | - Make jQuery.ready promise-compatible - Gives up sync guarantee for post-ready callbacks Fixes gh-1778 Fixes gh-1823 Close gh-2891
* Build: try insight package to get info about custom buildsOleg Gaidarenko2016-03-141-2/+41
| | | | | Fixes gh-2890 Closes gh-2988
* Build: combine intro and outroTimmy Willison2016-03-091-2/+7
| | | | | Fixes gh-2975 Close gh-2976
* Build: use hard-coded path to sizzle in selector-sizzleTimmy Willison2016-02-101-4/+1
| | | | Fixes gh-2898
* Build: Drop testing on jsdom with Node 0.10 & 0.12Michał Gołębiowski2016-02-101-20/+0
| | | | Fixes gh-2841
* Build: switch from win-spawn to cross-spawnMichał Gołębiowski2016-01-271-1/+1
| | | | | | | The win-spawn package is deprecated. Refs gh-2877 Refs 67c96a59f5af9e8404b3f904028e1c730d647498
* Release: push a custom slim build to the CDNTimmy Willison2015-11-163-7/+13
| | | | | Fixes gh-2653 Close gh-2711
* Build: Fixed issue with base path that contain 'var'Martin Naumann2015-10-121-1/+1
| | | | | | | Remove the cwd from the paths, so the regex doesn't kick in on "var" Fixes gh-2450 Closes gh-2641
* Tests: Add simple tests for Android 2.3Michał Gołębiowski2015-09-081-4/+8
| | | | | | Fixes gh-2505 Closes gh-2509 Refs gh-2483
* Build: Don't install jsdom 3 on Node.js 0.10 & 0.12 by defaultMichał Gołębiowski2015-09-083-28/+21
| | | | | | | | | | | | | | | | | | | | | jsdom 3 requires Python & Visual Studio on Windows which is a significant barrier to contributors. Newer jsdom versions don't require pre-compiling but work only on io.js. This commit installs the new jsdom everywhere (it does install in old Node.js, it just won't work) and executes Node-related tests only on newer Nodes or if a working jsdom version is installed. The latter can be achieved by running the `old_jsdom` task. Node.js is merging with io.js soon so this will become a smaller problem over time. One drawback is our Jenkins setup runs on Node 0.10 so it won't be running Node tests anymore. We have Travis set up on io.js, though so all PRs have those tests run. When the new LTS Node.js arrives (as it soon merges with io.js) we should update our Jenkins infrastructure so that it runs on this new version. Fixes gh-2519 Closes gh-2526
* Build: Update jscs and lint filesOleg Gaidarenko2015-09-075-30/+53
| | | | Fixes gh-2056