Commit Graph

413 Commits

Author SHA1 Message Date
Michał Gołębiowski-Owczarek
812b4a1a83
Build: Reduce the slim build header comment & jQuery.fn.jquery
So far, the slim build was expanded to its full exclusion list, generating the
following `jQuery.fn.jquery`:
```
v4.0.0-pre -ajax,-ajax/jsonp,-ajax/load,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-deprecated/ajax-event-alias,-callbacks,-deferred,-deferred/exceptionHook,-effects,-effects/Tween,-effects/animatedSelector,-queue,-queue/delay,-core/ready
```

This commit changes it to just `v4.0.0-pre slim`. Only the pure slim build is
treated this way, any modification to it goes through the old expansion; e.g.
for `custom:slim,-deprecated` we get the following `jQuery.fn.jquery`:
```
v4.0.0-pre -deprecated,-deprecated/ajax-event-alias,-deprecated/event,-ajax,-ajax/jsonp,-ajax/load,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-callbacks,-deferred,-deferred/exceptionHook,-effects,-effects/Tween,-effects/animatedSelector,-queue,-queue/delay,-core/ready
```

Since the version string is also put in the jQuery header comment, it also got
smaller.

Also, the logic to skip including the commit hash in the header comment - when
provided through the COMMIT environment variable which we do in Jenkins - in
minified builds headers has been applied to builds with exclusions as well.

Closes gh-4649
2020-04-27 22:23:59 +02:00
Michał Gołębiowski-Owczarek
a62309e01b
Docs: Update the link to the jsdom repository
Closes gh-4684
2020-04-25 20:47:25 +02:00
Jonathan
73415da25d
Docs: Use https for hyperlinks in README
Closes gh-4673
2020-04-17 11:46:49 +02:00
Michał Gołębiowski-Owczarek
358b769a00
Release: Use an in-repository dist README fixture
Use a dist README fixture kept in the jQuery repository instead of modifying
an existing one. This makes the jQuery repository the single source of truth
when it comes to jQuery releases and it makes it easier to make changes to
README without worrying how it will affect older jQuery lines.

The commit also ES6ifies build/release.js & build/release/dist.js

Closes gh-4614
2020-03-02 22:42:38 +01:00
Michał Gołębiowski-Owczarek
fbc44f52fe
Core: Exclude callbacks & deferred modules in the slim build as well
So far, the slim build only excluded ajax & effects modules. As many web apps
right now rely on native Promises, often with a polyfill for legacy browsers,
deferred & callbacks modules are not that useful for sites that already exclude
ajax & effects modules.

This decreases the gzipped minified size of the slim module by 1760 bytes,
to 19706 bytes (below 20k!).

Closes gh-4553
2020-01-20 18:58:23 +01:00
Michał Gołębiowski-Owczarek
0f780ba7cc
Build:Tests: Fix custom build tests, verify on Travis
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
2020-01-07 23:59:08 +01:00
Michał Gołębiowski-Owczarek
9b9ed469b4
Build: Create a grunt custom:slim alias for the Slim build (#4578)
Closes gh-4578
2020-01-07 16:42:49 +01:00
Michał Gołębiowski-Owczarek
f37c2e51f3
Build: Auto-convert sources to AMD
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
2019-12-09 20:00:44 +01:00
Michał Gołębiowski-Owczarek
9fd2fa5388
Build: Fix the Windows build
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
2019-12-02 19:55:19 +01:00
Michał Gołębiowski-Owczarek
d0ce00cdfa
Core: Migrate from AMD to ES modules 🎉
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
2019-11-18 21:15:03 +01:00
Michał Gołębiowski-Owczarek
bbad821c39
Build: Require strict mode in Node.js scripts via ESLint
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
2019-10-09 00:17:55 +02:00
Michał Gołębiowski-Owczarek
d7d0b52bda
Build: Support jquery-release --dry-run flag
Without this change passing `--dry-run` to jquery-release still pushes to the
jquery-dist repository which is dangerous as one can assume `--dry-run` to be
safe from external side effects.

Close gh-4498
2019-10-05 18:48:27 +02:00
Michał Gołębiowski-Owczarek
9a4d980639
Build: Stop copying src/core.js to dist on release
File `src/core.js` has started erroneously being copied to `dist/` in gh-2981.

Fixes gh-4489
Closes gh-4492
Ref gh-2979
Ref gh-2981
2019-10-04 16:13:14 +02:00
Michał Gołębiowski-Owczarek
47835965bd Selector: Inline Sizzle into the selector module
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
2019-07-29 21:19:21 +02:00
Michał Gołębiowski-Owczarek
438b1a3e8a
Build: ESLint: forbid unused function parameters
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
2019-05-13 22:25:11 +02:00
Michał Gołębiowski-Owczarek
9ec09c3b4a
Build: Fix the regex parsing AMD var-modules (#4389)
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
2019-05-13 21:55:45 +02:00
Michał Gołębiowski-Owczarek
84b6a0beb1
Build: Remove manual QUnit fixture resetting
It was needed when QUnit 1.x one used but we've since upgraded to QUnit 2.x.

Closes gh-4312
Ref gh-4307
2019-03-11 17:25:48 +01:00
Michał Gołębiowski-Owczarek
ca9356ecce
Build: Make Promises/A+ tests use the dot reporter instead of the default
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
2019-03-11 16:06:17 +01:00
Michał Gołębiowski-Owczarek
9cb124ed00
Build: Update jsdom; migrate a test with Symbol polyfill to an iframe test
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
2019-03-04 18:30:51 +01:00
Dave Methvin
6c38ebbd47 Build: Remove CRLF line endings to fix builds on Windows
Close gh-3929
2018-01-09 10:50:09 -05:00
Timo Tijhof
ecd8ddea33
Tests: Add support for running unit tests via grunt with karma
- 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
2017-12-18 12:27:38 -05:00
Michał Gołębiowski-Owczarek
56e891dea1 Tests: Make Node tests work for paths with spaces in them
Without this patch Jenkins tests fail as jQuery job names there contain spaces,
e.g. "jQuery Core".

Closes gh-3821
2017-10-18 17:44:50 +02:00
Michał Gołębiowski-Owczarek
81be78e380 Build: increase timeout in Promises/A+ tests 10 times
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
2017-09-25 19:27:50 +02:00
Michał Gołębiowski-Owczarek
781647b182 Build: Drop cross-spawn, use child_process.spawn shell option 2017-09-25 19:27:50 +02:00
Timmy Willison
f8faf1489e
Release: edit dist README version on release
Fixes gh-3574
2017-03-17 12:38:23 -04:00
Timmy Willison
0f52adc81f
Release: md5sum -> md5 -r for MAC 2017-03-16 14:59:57 -04:00
Timmy Willison
47caeaecd9
Release: update release dependencies 2017-03-15 14:57:20 -04:00
Timmy Willison
0588d0ce35
Build: Keep deprecated module in slim
Fixes gh-3237
Close gh-3533
2017-02-13 10:53:04 -05:00
Michał Gołębiowski
4e50967725 Build: Make the @CODE-replacing regex more robust
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
2016-12-05 18:43:10 +01:00
Timmy Willison
51c29dc1fe
Release: fix quotes for releasing on Windows 2016-09-22 18:18:25 -04:00
Dave Methvin
37f1da6b91 Build: Make sourcemap updates in two .replace() passes
Fixes gh-3260
Closes gh-3321
2016-09-19 13:03:32 -04:00
Timmy Willison
52e24471c8
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
2016-08-15 11:54:55 -04:00
Michał Gołębiowski
6e605afb1f 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.
2016-07-13 10:49:13 +02:00
Oleg Gaidarenko
58c6ca9822 Build: ESLint details
Use eslint pragmas, fix new errors, etc

Closes gh-3148
2016-06-11 10:41:33 +03:00
Oleg Gaidarenko
a4474c9a00 Tests: Move promise/A+ adapters for tests to dedicated folder 2016-06-11 10:39:51 +03:00
Oleg Gaidarenko
f80ae67c53 Build: Switch from jscs+jshint to eslint 2016-06-11 10:39:51 +03:00
Timmy Willison
95c7ab6897 Release: remove extraneous files from dist during release
Fixes gh-3094
Close gh-3116
2016-05-13 11:35:15 -04:00
Timmy Willison
5086b3012d Release: copy sizzle separately into an 'external' folder
Fixes gh-2945
2016-05-13 11:35:15 -04:00
Richard Gibson
356a3bccb0 Deferred: Separate the two paths in jQuery.when
Single- and no-argument calls act like Promise.resolve.
Multi-argument calls act like Promise.all.

Fixes gh-3029
Closes gh-3059
2016-05-02 12:30:31 -04:00
Michał Gołębiowski
3b356cfde4 Build: Strip the strict-mode related comment in exports/global.js
The comment (& the JSHint pragma) doesn't make sense in the context of the
full built file.

Closes gh-3078
2016-04-26 22:50:22 +02:00
Michał Gołębiowski
0652c4d6a2 Build: Strip excessive "use strict" pragmas when building
Fixes gh-3077
2016-04-26 22:50:18 +02:00
Richard Gibson
76084372c2 Deferred: Remove default callback context
Employs strict mode to simplify Deferred callback context handling.

Fixes gh-3060
Closes gh-3061
2016-04-23 00:30:48 -04:00
Timmy Willison
5cbb234dd3 Core: implement ready without Deferred
- Make jQuery.ready promise-compatible
- Gives up sync guarantee for post-ready callbacks

Fixes gh-1778
Fixes gh-1823
Close gh-2891
2016-04-04 11:26:22 -04:00
Oleg Gaidarenko
055cb7534e Build: try insight package to get info about custom builds
Fixes gh-2890
Closes gh-2988
2016-03-14 21:13:05 +03:00
Timmy Willison
0f5f0c981a Release: set version in source for releases
Fixes gh-2979
Close gh-2981
2016-03-14 10:37:11 -04:00
Timmy Willison
4a098f4883 Build: combine intro and outro
Fixes gh-2975
Close gh-2976
2016-03-09 11:42:42 -05:00
Timmy Willison
8a91f8442f Release: include external/sizzle in releases
Ref gh-2945
2016-02-24 10:21:58 -05:00
Timmy Willison
5943f1d7ff Build: use hard-coded path to sizzle in selector-sizzle
Fixes gh-2898
2016-02-10 13:47:25 -08:00
Michał Gołębiowski
c7431c7793 Build: Drop testing on jsdom with Node 0.10 & 0.12
Fixes gh-2841
2016-02-10 12:57:49 +01:00
Michał Gołębiowski
abb5715807 Build: switch from win-spawn to cross-spawn
The win-spawn package is deprecated.

Refs gh-2877
Refs 67c96a59f5
2016-01-27 13:02:58 +01:00
Josh Soref
aae44111e2 Docs: Fix various spelling errors
Closes gh-2761
2016-01-13 13:11:11 -05:00
Timmy Willison
cf7102c3f1 Release: push a custom slim build to the CDN
Fixes gh-2653
Close gh-2711
2015-11-16 11:22:20 -05:00
Timmy Willison
5f5aee3b58 Release: use chalk instead of colors for terminal colors 2015-11-12 13:23:53 -05:00
Timmy Willison
7bb39f3511 Release: remove antiquated release-notes.js 2015-10-29 15:21:46 -04:00
Martin Naumann
0c34e68843 Build: Fixed issue with base path that contain 'var'
Remove the cwd from the paths, so the regex doesn't kick in on "var"

Fixes gh-2450
Closes gh-2641
2015-10-12 18:17:12 +03:00
Michał Gołębiowski
2c7e9c9349 Tests: Add simple tests for Android 2.3
Fixes gh-2505
Closes gh-2509
Refs gh-2483
2015-09-08 18:03:49 +02:00
Michał Gołębiowski
dbb2daa8c3 Build: Don't install jsdom 3 on Node.js 0.10 & 0.12 by default
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
2015-09-08 17:42:38 +02:00
Oleg Gaidarenko
10fdad742a Build: Update jscs and lint files
Fixes gh-2056
2015-09-07 20:03:50 +03:00
Bruno Pérel
360a478033 Docs: Fix various spelling mistakes
Closes gh-2487
2015-07-30 15:47:23 +02:00
Timmy Willison
c44dd7775b Release: properly set the dist remote when it's a real release 2015-07-13 15:01:33 -04:00
Timmy Willison
63a577aa0b Build: space between curly and paren is optional
Fixes gh-2399
Close gh-2400
2015-06-19 13:40:11 -04:00
Michał Gołębiowski
bb026fc12c Core: Make jQuery objects iterable
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
2015-06-13 23:14:36 +02:00
Michał Gołębiowski
9c8a3ecdc4 Build: Refactor Node smoke tests
Utilize the assert module, avoid inline JSHint comments.
2015-06-13 23:08:19 +02:00
Chris Rebert
61e21a4eaf Build: bower.json: remove moot version field
Related:
a325da3d79

Close gh-2304
2015-05-13 12:28:21 -04:00
Timmy Willison
5c3101fee6 Build: use different versions of jsdom for Node and iojs testing
Fixes gh-2266
2015-05-07 09:57:59 -07:00
Michał Gołębiowski
ab40725879 Core: Test all factory use cases from intro.js
There is a lot of logic in intro.js; now we test four cases:
1. (implicitly, via QUnit tests) A real browser with window being the global
2. Browserify where there are both global & window variables.
3. Node with jsdom where window is passed manually to the jQuery factory.
4. Pure Node with incorrect window passed; jQuery should throw then.

Previously the second & fourth case was not tested and the third was tested
in a way that interfered with the main test environment.

We now also test if in the Browserify case we're not creating a jQuery global
by default.

Fixes gh-2181
Closes gh-2234
2015-04-27 22:44:47 +02:00
Richard Gibson
555a50d340 Deferred: Backwards-compatible standards interoperability
Fixes gh-1722
Closes gh-1996
2015-03-20 02:00:17 -04:00
Timmy Willison
1ba45fcc15 Release: push dist to same remote as project 2015-01-30 12:53:28 -08:00
Timmy Willison
a76c781236 Release: remove sourcemap comment from all copies of minified file
Fixes gh-1707
2015-01-30 12:22:31 -08:00
Timmy Willison
e0673dfedb Release: fix CDN archive creation
Fixes gh-1940
2015-01-29 17:38:35 -08:00
Timmy Willison
aae998b544 Release: dist can be run during a test 2015-01-29 15:36:48 -08:00
Timmy Willison
61224f5fef Release: bower.json is actually generated from scratch 2015-01-29 12:25:57 -08:00
Timmy Willison
26eca143c2 Release: Distribute files to distribution repo
Fixes gh-1869
Fixes gh-1673
Fixes gh-2045
2015-01-29 12:03:40 -08:00
Richard Gibson
bb928bde7e Build: Rearrange grunt/npm tasks into a build/dist/test pattern
Ref 76df9e4e38
Closes gh-1980
2015-01-11 10:28:18 -05:00
Dave Methvin
c34ed46eee Release: Remove copying of jquery-latest files 2015-01-06 21:59:14 -05:00
Timmy Willison
d6c97abb74 Build: Sizzle version labels must start with a dash 2014-12-17 11:17:41 -05:00
Timmy Willison
78ac753192 Build: account for version labels in Sizzle versions
Fixes gh-1939
2014-12-17 10:42:29 -05:00
Timmy Willison
6051609df3 Build: fix tests in AMD mode 2014-12-09 15:39:24 -05:00
David Corbacho
2c1b556d98 Build: Remove empty define({}) from build output
Fixes gh-1768
Closes gh-1569
2014-12-04 16:38:00 -05:00
Oleg Gaidarenko
dc4b914a05 Build: Fix various typos
Thanks @jamesgpearce, @vlajos, @imyousuf
Closes gh-1828
Closes gh-1830
Closes gh-1844
2014-11-08 17:24:33 +03:00
Timmy Willison
c869a1ef8a Build: update grunt-jscs-checker and pass with the new rules 2014-07-17 10:25:59 -07:00
Timmy Willison
e1949f4371 Build: drop bower; use npm for front-end deps
Fixes #15186
Closes gh-1620
2014-07-17 09:02:59 -07:00
Scott González
c5d9d88dce Build: Move all external libraries to external directory
Closes gh-1593
2014-06-24 10:17:50 -04:00
Timmy Willison
1d931068d3 Release: ensure Sizzle is the latest tag
Fixes #14915
2014-05-23 13:49:57 -04:00
Timmy Willison
b80700c75f Build: run jshint and jscs on release scripts 2014-05-23 13:01:03 -04:00
Michał Gołębiowski
a0568b07d8 Build: set default testswarm timeout to 15 minutes
We're not testing on IE6-7 anymore.
2014-04-15 11:47:52 +02:00
Michał Gołębiowski
7869891a97 Build: use browserSets from config file; allow to override 2014-04-15 11:34:02 +02:00
Scott González
5265cdac3d Build: Update release script for new jquery-release API
Closes gh-1544
2014-03-21 12:33:10 -04:00
Michał Gołębiowski
c1e9bb9e61 Build: Change the timeout for the weekly job from 4h to 1h 2014-03-18 11:55:06 +01:00
Michał Gołębiowski
aa951a3184 Build: Refactor testswarm Grunt task options
Add a possibility to specify the project name. Infer browserSets & timeout
out of it instead of defining it in the Jenkins configuration.
2014-03-16 04:14:03 +01:00
Jörn Zaefferer
22c515c671 Build: Fix testswarm task, use API correctly 2014-03-12 11:08:16 +01:00
Michał Gołębiowski
a81dbc4ed8 Build: Allow to specify timeout in the testswarm task 2014-03-11 21:12:39 +01:00
Michał Gołębiowski
14872941f9 Build: Make it possible to change browserSets in the testswarm task 2014-03-10 20:37:11 +01:00
Timmy Willison
984f77a930 Build: Fix AMD option for custom builds
Fixes #14859
2014-03-07 09:55:26 -05:00
Michał Gołębiowski
53e31f478e Build: Specify browserSets for TestSwarm directly 2014-01-27 22:01:15 +01:00
Michał Gołębiowski
d41fc68d9b Build: Remove obsolete UglifyJS workaround 2014-01-26 04:02:20 +01:00
Timmy Willison
de7702ac59 Release: Instantiate a zip archiver, run archivers async 2014-01-23 16:00:54 -05:00
Jörn Zaefferer
20ea8071b4 Release: Publish to npm
Closes gh-1479
2014-01-10 09:25:11 -05:00
Timmy Willison
23db994404 Release script: _tracMilestone -> tracMilestone 2013-12-21 12:07:40 -05:00
Timmy Willison
74a48958bd Release script: minor formatting issue. 2013-12-20 17:37:38 -05:00