aboutsummaryrefslogtreecommitdiffstats
path: root/package.json
Commit message (Collapse)AuthorAgeFilesLines
* Tests: reuse browser workers in BrowserStack tests (#5428)Timmy Willison2024-03-051-8/+8
| | | | | | | | | - reuse BrowserStack workers. - add support for "latest" and "latest-1" in browser version filters - add support for specifying non-final browser versions, such as beta versions - more accurate eslint for files in test/runner - switched `--no-isolate` command flag to `--isolate`. Now that browser instances are shared, it made more sense to me to default to no isolation unless specified. This turned out to be cleaner because the only place we isolate is in browserstack.yml. - fixed an issue with retries where it wasn't always waiting for the retried test run - enable strict mode in test yargs command
* Build: update jenkins script to only buildTimmy Willison2024-02-261-1/+1
| | | | | - this will soon be replaced by a new GH actions workflow Close gh-5422
* Tests: migrate testing infrastructure to minimal dependenciesTimmy Willison2024-02-261-38/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Runner - 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 - 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. - cleans up after itself (closes the local tunnel, stops the test server, etc.) - Requires `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` environment variables. ## Selenium Runner - 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-5418
* Build: migrate grunt authors to a custom scriptTimmy Willison2024-01-221-1/+2
| | | | | | | - the new script pulls all authors from the Sizzle repo - added temporary grunt task for releases Close gh-5395
* Build: Update ESLint-related packages, fix linting errorsMichał Gołębiowski-Owczarek2023-11-021-3/+3
| | | | | | | | The main change is the new rule in `eslint-config-jquery`: `template-curly-spacing`. Closes gh-5347 Ref jquery/eslint-config-jquery#21 Ref gh-5348
* Build: Run pretest before test:* npm scriptsMichał Gołębiowski-Owczarek2023-10-161-8/+8
| | | | | | | | | | | | | Build was already happening in scripts like `test:browser` but those scripts were missing `pretest`, meaning that running `npm install && npm test:browser` may have failed if `pretest` wasn't run before or if its results were out of date. Even worse, with such stale data some tests may erroneously succeed. This also removes a separate `pretest` step from GitHub Actions as it's no longer needed. Closes gh-5338
* Build: run pretest in jenkins scriptTimmy Willison2023-09-201-1/+1
|
* Core: Move the factory to separate exportsMichał Gołębiowski-Owczarek2023-09-191-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since versions 1.11.0/2.1.0, jQuery has used a module wrapper with one strange addition - in CommonJS environments, if a global `window` with a `document` was not present, jQuery exported a factory accepting a `window` implementation and returning jQuery. This approach created a number of problems: 1. Properly typing jQuery would be a nightmare as the exported value depends on the environment. In practice, typing definitions ignored the factory case. 2. Since we now use named exports for the jQuery module version, it felt weird to have `jQuery` and `$` pointing to the factory instead of real jQuery. Instead, for jQuery 4.0 we leverage the just added `exports` field in `package.json` to expose completely separate factory entry points: one for the full build, one for the slim one. Exports definitions for `./factory` & `./factory-slim` are simpler than for `.` and `./slim` - this is because it's a new entry point, we only expose a named export and so there's no issue with just pointing Node.js to the CommonJS version (we cannot use the module version for `import` from Node.js to avoid double package hazard). The factory entry points are also not meant for the Web browser which always has a proper `window` - and they'd be unfit for an inclusion in a regular script tag anyway. Because of that, we also don't generate minified versions of these entry points. The factory files are not pushed to the CDN since they are mostly aimed at Node.js. Closes gh-5293
* Build: migrate most grunt tasks off of gruntTimmy Willison2023-09-181-37/+38
| | | | | | | | | | | | | | | | | | | | | | | | | Updated tasks include: - 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 `rollup.watch` directly 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 Close gh-5318
* Build: Add `exports` to package.json, export slim & esm buildsMichał Gołębiowski-Owczarek2023-07-101-3/+35
| | | | | | | | | | | | | | | | | | | | Summary of the changes: * define the `exports` field in `package.json`; `jQuery` & `$` are also exported as named exports in ESM builds now * declare `"type": "module"` globally except for the `build` folder * add the `--esm` option to `grunt custom`, generating jQuery as an ECMAScript module into the `dist-module` folder * expand `node_smoke_tests` to test the slim & ESM builds and their various combinations; also, test both jQuery loaded via a path to the file as well as from module specifiers that should be parsed via the `exports` feature * add details about ESM usage to the release package README * run `compare_size` on all built minified files; don't run it anymore on unminified files where they don't provide lots of value * remove the remove_map_comment task; SWC doesn't insert the `//# sourceMappingURL=` pragma by default so there's nothing to strip Fixes gh-4592 Closes gh-5255
* CSS: Make the reliableTrDimensions support test work with Bootstrap CSSMichał Gołębiowski-Owczarek2023-07-101-0/+1
| | | | | | | | | | | | | | | | | | | Bootstrap 5 includes the following CSS on the page: ```css *, *::before, *::after { box-sizing: border-box; } ``` That threw our `reliableTrDimensions` support test off. This change fixes the support test and adds a unit test ensuring support test values on a page including Bootstrap 5 CSS are the same as on a page without it. Fixes gh-5270 Closes gh-5278 Ref gh-5279
* Build: Switch form Terser to SWC for JS minification (#5286)Michał Gołębiowski-Owczarek2023-07-101-2/+1
| | | | | | | | Also, as part of this, fix the `file` & `sources` properties of the source map file. Fixes gh-5285 Closes gh-5286 Ref gh-5258
* Build: Drop individual AMD modulesMichał Gołębiowski-Owczarek2023-06-271-2/+1
| | | | | | | | | | With this change, jQuery build no longer generates the `amd` directory with AMD modules transpiled from source `src` ECMAScript Modules. To use individual jQuery modules from source, ESM is now required. Note that this DOES NOT affect the main `"jquery"` AMD module defined by built jQuery files; those remain supported. Closes gh-5276
* Build: Switch the minifier from UglifyJS to TerserMichał Gołębiowski-Owczarek2023-05-311-3/+3
| | | | | | | | | | | | | | | UglifyJS is ES5-only, while Terser supports newer ECMAScript versions. jQuery is authored in ES5 but jQuery 4.x will also have an ESM build that cannot be minified using UglifyJS directly. We could strip the `export` statement, minify via UglifyJS and re-add one but that increases complexity & may not fully play nice with source maps. On the other hand, switching to Terser increases the minfied size by just 324 bytes and the minified gzipped one by just 70 bytes. Such differences largely disappear among bigger size gains from the `3.x-stable` line - around 2.7 KB minified gzipped as of now. Closes gh-5258
* Selector: Stop relying on CSS.supports( "selector(...)" )Michał Gołębiowski-Owczarek2023-02-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | `CSS.supports( "selector(...)" )` has different semantics than selectors passed to `querySelectorAll`. Apart from the fact that the former returns `false` for unrecognized selectors and the latter throws, `qSA` is more forgiving and accepts some invalid selectors, auto-correcting them where needed - for example, mismatched brackers are auto-closed. This behavior difference is breaking for many users. To add to that, a recent CSSWG resolution made `:is()` & `:where()` the only pseudos with forgiving parsing; browsers are in the process of making `:has()` parsing unforgiving. Taking all that into account, we go back to our previous try-catch approach without relying on `CSS.supports( "selector(...)" )`. The only difference is we detect forgiving parsing in `:has()` and mark the selector as buggy. The PR also updates `playwright-webkit` so that we test against a version of WebKit that already has non-forgiving `:has()`. Fixes gh-5194 Closes gh-5206 Ref gh-5098 Ref gh-5107 Ref w3c/csswg-drafts#7676 Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
* Ajax: Support binary data (including FormData)Michał Gołębiowski-Owczarek2023-02-011-0/+1
| | | | | | | | | | | | Two changes have been applied: * prefilters are now applied before data is converted to a string; this allows prefilters to disable such a conversion * a prefilter for binary data is added; it disables data conversion for non-string non-plain-object `data`; for `FormData` bodies, it removes manually-set `Content-Type` header - this is required as browsers need to append their own boundary to the header Ref gh-4150 Closes gh-5197
* Build: Run GitHub Action browser tests on Playwright WebKitMichał Gołębiowski-Owczarek2023-01-231-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | So far, we've been running browser tests on GitHub Actions in Chrome and Firefox. Regular Safari is not available in GitHub Actions but Playwright WebKit comes close to a dev version of Safari. With this change, our GitHub CI & local test runs will invoke tests on all actively developed browser engines on all PRs. Also, our GitHub Actions browser tests are now running on Node.js 18. Detection of the Playwright WebKit browser in support unit tests is done by checking if the `test_browser` query parameter is set to `"Playwright"`; this is a `karma-webkit-launcher` feature. Detecting that browser via user agent as we normally do is hard as the UA on Linux is very similar to a real Safari one but it actually uses a newer version of the engine. In addition, we now allow to pass custom browsers when one needs it; e.g., to run the tests in all three engines on Linux/macOS, run: ``` grunt && BROWSERS=ChromeHeadless,FirefoxHeadless,WebkitHeadless grunt karma:main ``` Closes gh-5190
* Build: remove stale Insight package from custom buildsTimmy Willison2022-12-201-1/+0
| | | Close gh-5182
* Selector: Re-introduce selector-native.jsMichał Gołębiowski-Owczarek2022-11-211-1/+2
| | | | | | | | | | | | | | | | | | | | | Re-introduce the `selector-native` similar to the one on the `3.x-stable` branch. One difference is since the `main` branch inlined Sizzle, some selector utils can be shared between the main `selector` module and `selector-native`. The main `selector` module can be disabled in favor of `selector-native` via: grunt custom:-selector Other changes: * Tests: Fix Safari detection - Chrome Headless has a different user agent than Safari and a browser check in selector tests didn't take that into account. * Tests: Run selector-native tests in `npm test` * Selector: Fix querying on document fragments Ref gh-4395 Closes gh-5085
* Build: Update Grunt from 1.4.1 to 1.5.3Michał Gołębiowski-Owczarek2022-10-031-1/+1
| | | | | | | This will resolve the following security issues: * Path Traversal in Grunt: https://github.com/advisories/GHSA-j383-35pm-c5h4 * Race Condition in Grunt: https://github.com/advisories/GHSA-rm36-94g8-835r Closes gh-5134
* Build: Test on Node 17, update Grunt & `karma-*` packagesMichał Gołębiowski-Owczarek2022-03-141-9/+9
| | | | | | | | | | | | | | 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
* Tests: lock colors version to 1.4.0Timmy Willison2022-01-101-0/+1
|
* Build: Update ESLint & eslint-plugin-import, fixing the buildMichał Gołębiowski-Owczarek2021-10-291-2/+2
| | | | | | | | | | 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: Restore the external directoryMichał Gołębiowski-Owczarek2021-03-241-0/+1
| | | | | | | | | | | | 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: Rename master to main across the repositoryMichał Gołębiowski-Owczarek2021-02-051-1/+1
| | | | | | The default branch was updated, this updates the remaining occurrences in code & comments. Closes gh-4838
* Build: Fix commitplease husky configBeatriz Rezener2020-07-201-1/+1
| | | | Fixes gh-4735 Closes gh-4737
* Build: Update dependenciesMichał Gołębiowski-Owczarek2020-07-151-24/+24
| | | | | | This also resolves a security warning from GitHub about a vulnerable `request` version - the new `testswarm` package version depends on a fixed `request`. Closes gh-4732
* Build: Update eslint-config-jquery, fix linting violationsMichał Gołębiowski-Owczarek2020-05-181-1/+1
| | | | | Closes gh-4696 Ref jquery/eslint-config-jquery#15 Ref jquery/eslint-config-jquery#16
* Docs: Change JS Foundation mentions to OpenJS FoundationMichał Gołębiowski-Owczarek2020-05-181-1/+1
| | | Closes gh-4711
* Build:Tests: Fix custom build tests, verify on Travis Michał Gołębiowski-Owczarek2020-01-071-1/+3
| | | | | | | | | | | 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-1/+3
| | | | | | 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-1/+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
* Build: Fix the Windows buildMichał Gołębiowski-Owczarek2019-12-021-1/+0
| | | | | | | This commit gets rid of rollup-plugin-hypothetical in favor of a simpler inline Rollup plugin that fits our need and is compatible with Windows. Fixes gh-4548 Closes gh-4549
* Build: Require extensions for ES6 imports, prevent import cyclesMichał Gołębiowski-Owczarek2019-11-251-0/+1
| | | | | | | | | | | | | | | | jQuery source is now authored in ECMAScript modules. Native browser support for them requires full file names including extensions. Rollup works even if import paths don't specify extensions, though, so one import slipped through without such an extension, breaking native browser import of src/jquery.js. A new ESLint rule using eslint-plugin-import prevents us from regressing on that front. Also, eslint-plugin-import's no-cycle rule is used to avoid import cycles. Closes gh-4544 Ref gh-4541 Ref 075320149ae30a5c593c06b2fb015bdf033e0acf
* Core: Migrate from AMD to ES modules 🎉Michał Gołębiowski-Owczarek2019-11-181-1/+3
| | | | | | | | | | | | | | | | | | | | | | 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: Remove the external directory, read from node_modules directlyMichał Gołębiowski-Owczarek2019-08-261-1/+0
| | | | | | 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
* Selector: Inline Sizzle into the selector moduleMichał Gołębiowski-Owczarek2019-07-291-1/+0
| | | | | | | | | | | | | | | | | | 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
* Build: ESLint: forbid unused function parametersMichał Gołębiowski-Owczarek2019-05-131-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
* Build: Update Sizzle from 2.3.3 to 2.3.4Michał Gołębiowski-Owczarek2019-04-091-1/+1
| | | | | | Fixes gh-1756 Fixes gh-4170 Fixes gh-4249 Closes gh-4345
* Build: Update the master version to 4.0.0-preMichał Gołębiowski-Owczarek2019-04-081-1/+1
|
* Tests: Fix the core-js polyfill inclusion methodMichał Gołębiowski-Owczarek2019-04-041-1/+1
| | | | | | | | core-js 3 no longer includes a built file in the bundle but core-js-bundle does. Closes gh-4342 Ref gh-4341
* Build: Update Sinon from 2.3.7 to 7.3.1, other updatesMichał Gołębiowski-Owczarek2019-04-041-8/+8
| | | Closes gh-4341
* Build: Run the basic test suite in jsdomMichał Gołębiowski-Owczarek2019-03-111-0/+1
| | | | | | 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-4/+3
| | | Closes gh-4307
* Build: Update jsdom; migrate a test with Symbol polyfill to an iframe testMichał Gołębiowski-Owczarek2019-03-041-1/+1
| | | | | | | | | | | 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-16/+20
| | | | | | | | | | | | | | | | 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/+1
|
* Update node dependencies (sans jsdom, qunit, and sinon)Timmy Willison2018-06-201-15/+15
| | | Close gh-4098
* 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: Updating the master version to 3.3.2-pre.Timmy Willison2018-01-201-1/+1
|