aboutsummaryrefslogtreecommitdiffstats
path: root/.gitignore
Commit message (Collapse)AuthorAgeFilesLines
* Core: Fix the exports setup to make bundlers work with ESM & CommonJSMichał Gołębiowski-Owczarek2024-03-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We cannot pass a single file via the `module` condition as then `require( "jquery" )` will not return jQuery but instead the module object with `default`, `$` & `jQuery` as keys. Instead: 1. For Node.js, detected via the `node` condition: 1. Expose a regular CommonJS version to `require` 2. Expose a tiny wrapper over CommonJS to `import` 2. For bundlers, detected via the `module` condition: 1. Expose a regular ESM version to `import` 2. Expose a tiny wrapper over ESM to `require` 3. If neither Node.js nor bundlers are detected (no `node` or `module` conditions`): 1. Expose a regular CommonJS version to `require` 2. Expose a regular ESM version to `import` The reasons for such definitions are as follows: 1. In Node.js, one can synchronously import from a CommonJS file inside of an ESM one but not vice-versa. To use an ESM file in a CommonJS one, a dynamic import is required and that forces asynchronicity. 2. In some bundlers CommonJS is not necessarily enabled - e.g. in Rollup without the CommonJS plugin. Therefore, the ESM version needs to be pure ESM. However, bundlers allow synchronously calling `require` on an ESM file. This is possible since bundlers merge the files before they are passed to the browser to execute and the final bundles no longer contain async import code. 3. Bare ESM & CommonJS versions are provided to non-Node non-bundler environments where we cannot assume interoperability between ESM & CommonJS is supported. 4. Bare versions cannot be supplied to Node or bundlers as projects using both ESM & CommonJS to fetch jQuery would result in duplicate jQuery instances, leading to increased JS size and disjoint data storage. In addition to the above changes, the `script` condition has been dropped. Only Webpack documents this condition and it's not clear when exactly it's triggered. Adding support for a new condition can be added later without a breaking change; removing is not so easy. The `production` & `development` conditions have been removed as well. They were not really applied correctly; we'd need to provide both of them to each current leaf which would double the size of the definition for the `.` & `./slim` entry points. In jQuery, the only difference between development & production builds is minification; there are no logic changes so we can pass unminified versions to all the tooling, expecting minification down the line. As for the factory entry points: 1. Node.js always gets the CommonJS version 2. Bundlers always get the ESM version 3. Other tools take the ESM version when using `import` and the CommonJS when using `require`. The complexity is lower than for the `.` & `./slim` entry points because there's no default export to handle so Node/bundler wrapper files are not necessary. Other changes: * Tests: Change "node:assert" to "node:assert/strict"; the former is deprecated * Docs: Mention that the CommonJS module doesn't expose named exports * Tests: Run Node & bundler tests for all the above cases Fixes gh-5416 Closes gh-5429
* Tests: migrate testing infrastructure to minimal dependenciesTimmy Willison2024-02-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 most grunt tasks off of gruntTimmy Willison2023-09-181-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+10
| | | | | | | | | | | | | | | | | | | | 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
* Build: Drop individual AMD modulesMichał Gołębiowski-Owczarek2023-06-271-1/+0
| | | | | | | | | | 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: Restore the external directoryMichał Gołębiowski-Owczarek2021-03-241-1/+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:Tests: Fix custom build tests, verify on Travis Michał Gołębiowski-Owczarek2020-01-071-0/+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 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: 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
* 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: Remove package-lock.json, add it to .gitignoreMichał Gołębiowski-Owczarek2017-09-251-0/+1
| | | | | | | | | | | | | | | | | | npm 5, even the version included in the latest Node.js 8.5.0 re-generates `package-lock.json` on each install. And when it does on a system that doesn't support all the optional dependencies that are supported on the OS where the lockfile was generated, it removes those optional deps from the lockfile. The effect is that everyone firing `npm install` on our repo on any OS other than macOS will immediately get a dirty state of the repo as the `fsevents` dependency subtree gets removed from `package-lock.json`. That's a really bad experience. This commit removes package-lock.json from the repository and adds it to .gitignore. We'll start committing the file again once the issue is resolved on npm's part. Fixes gh-3792
* Build: update node dependencies; commit package-lock.jsonCDAGaming2017-06-261-0/+1
| | | | | - Also ignore yarn.lock Close gh-3669
* Build: Simplify Gruntfile constructionsOleg Gaidarenko2016-08-021-2/+2
| | | | Fixes gh-3246
* Build: Improve ESLint configuration (#3188)Oleg Gaidarenko2016-06-221-1/+4
| | | | | | | | | * 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-1/+1
| | | | | | Use eslint pragmas, fix new errors, etc Closes gh-3148
* Build: add `npm-debug.log` to `.gitignore`Oleg Gaidarenko2016-02-131-0/+2
|
* Core: Make jQuery objects iterableMichał Gołębiowski2015-06-131-0/+2
| | | | | | | | | | Make iterating over jQuery objects possible using ES 2015 for-of: for ( node of $( "<div id=narwhal>" ) ) { console.log( node.id ); // "narwhal" } Fixes gh-1693
* Build: drop bower; use npm for front-end depsTimmy Willison2014-07-171-1/+0
| | | | | Fixes #15186 Closes gh-1620
* Build: Use absolute paths in .gitignore and .npmignore.Michał Gołębiowski2013-12-181-4/+4
| | | | | .gitignore/.npmignore treat all its paths as relative to *every* directory in the repository. In most cases that’s not what’s desired.
* Manage bower dependencies with grunt-bowercopyTimmy Willison2013-12-061-4/+3
| | | | | | | | | | | | Tracked bower dependencies are located at "src/sizzle" and "test/libs". The source-destination mapping is in the Gruntfile. When updating a bower dependency, update the version in bower.json, run `grunt bower`, and then commit the result. When adding a dependency, update the bowercopy task accordingly. Fixes #14615. Closes gh-1452.
* Keep bower_components in .gitignore.Michał Gołębiowski2013-11-151-0/+1
|
* Use grunt and bower packages as local dependencies. Close gh-1433.Timmy Willison2013-11-141-1/+1
|
* AMD-ify jQuery sourcegit s! Woo! Fixes #14113, #14163.Timmy Willison2013-08-151-2/+0
|
* Include Sizzle and Qunit with bower. Fixes #14118.Timmy Willison2013-07-101-0/+1
|
* Add warnings and ignore the built Sizzle file.Dave Methvin2013-02-271-0/+1
|
* Allow users to store custom dist destinations in dist/.destination.jsonRick Waldron2012-06-051-0/+1
| | | | Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
* Strips IIFEs from modules; Always require built jQuery for tests.Rick Waldron2012-06-041-0/+1
|
* Fix #11767. Modularize build and unit tests for exluding effects.Richard Gibson2012-05-281-1/+0
| | | | Closes gh-785. To build a version of jQuery without effects, use `grunt build:*:*:-effects`. The unit tests feature-check for the interfaces and skip the unit tests for effects if they don't detect it.
* Adds back dist/.sizecache.json; maintain build/.sizecache.json until build ↵Rick Waldron2012-05-281-0/+1
| | | | dir is removed
* Add .sizecache.json to the gitignoretimmywil2012-05-281-1/+1
|
* Initial grunt implementationRick Waldron waldron.rick@gmail.com2012-04-181-1/+2
|
* $.Callbacks, $.Topic and notify/progress on $.Deferred.jaubourg2011-09-191-0/+1
|
* Landing pull request 511. Adding a little Makefile jQuery sizing utility to ↵Corey Frang2011-09-191-0/+1
| | | | | | | easily see differences in size between makes. Fixes #10308. More Details: - https://github.com/jquery/jquery/pull/511
* Introduce submodules, closes #8536Carl Fürstenberg2011-03-151-2/+0
| | | | | | Instead of the manual clone of sizzle and qunit, use git submodules instead. this will ensure that all future releases can be recreated by checking out an tag.
* Adding .DS_Store to Git ignore.John Resig2009-12-091-0/+1
|
* Ignore html files living in the main directory (likely being used for testing).John Resig2009-12-091-0/+1
|
* Switched from using Git Submodules to just doing a straight clone of the ↵jeresig2009-11-301-0/+2
| | | | QUnit and Sizzle directories. Works much better for what we want.
* Ignore diff and patch files.jeresig2009-11-301-0/+2
|
* Hide the .settings file in the gitignore.John Resig2009-11-151-2/+2
|
* Ignoring src/selector.js (build) and Emacs backup filesKim Dalsgaard2009-11-151-0/+3
|
* We don't want to filter out the qunit file.John Resig2009-10-221-2/+1
|
* Added gitignore for people using git-svnYehuda Katz2009-07-161-0/+2