Skip to content

Commit 55cd3a4

Browse files
authoredMay 5, 2020
Build: Followups after introducing ES modules compiled via Rollup
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 jquerygh-4705
1 parent 297d18d commit 55cd3a4

File tree

6 files changed

+9
-17
lines changed

6 files changed

+9
-17
lines changed
 

‎.eslintrc.json

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
{
22
"root": true,
33

4-
"extends": "./.eslintrc-node.json",
5-
6-
"overrides": [
7-
{
8-
"files": "rollup.config.js",
9-
"parserOptions": {
10-
"sourceType": "module"
11-
}
12-
}
13-
]
4+
"extends": "./.eslintrc-node.json"
145
}

‎Gruntfile.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = function( grunt ) {
2424
grunt.initConfig( {
2525
pkg: grunt.file.readJSON( "package.json" ),
2626
dst: readOptionalJSON( "dist/.destination.json" ),
27-
"compare_size": {
27+
compare_size: {
2828
files: [ "dist/jquery.js", "dist/jquery.min.js" ],
2929
options: {
3030
compress: {
@@ -232,7 +232,7 @@ module.exports = function( grunt ) {
232232
"test/data/jquery-1.9.1.js",
233233
"test/data/testinit-jsdom.js",
234234

235-
// We don't support various loading methods like AMD,
235+
// We don't support various loading methods like esmodules,
236236
// choosing a version etc. for jsdom.
237237
"dist/jquery.js",
238238

‎build/tasks/amd.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ module.exports = function( grunt ) {
1919

2020
const outputRollupOptions = {
2121
format: "amd",
22-
dir: "amd"
22+
dir: "amd",
23+
indent: false
2324
};
2425

2526
grunt.registerTask(

‎build/tasks/build.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module.exports = function( grunt ) {
5454

5555
grunt.registerMultiTask(
5656
"build",
57-
"Concatenate source, remove sub AMD definitions, " +
57+
"Build jQuery ECMAScript modules, " +
5858
"(include/exclude modules with +/- flags), embed date/version",
5959
async function() {
6060
const done = this.async();
@@ -302,7 +302,7 @@ module.exports = function( grunt ) {
302302
);
303303

304304
grunt.file.write( name, compiledContents );
305-
grunt.log.ok( "File '" + name + "' created." );
305+
grunt.log.ok( `File '${ name }' created.` );
306306
done();
307307
} catch ( err ) {
308308
done( err );

‎src/.eslintrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
// Code Style. This makes that indentation check is not
3535
// performed for 1 depth of outer FunctionExpressions
3636
"ignoredNodes": [
37-
"Program > ExpressionStatement > CallExpression > FunctionExpression > *"
37+
"Program > ExpressionStatement > CallExpression > :last-child > *"
3838
]
3939
} ]
4040
},

‎src/ajax.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ jQuery.extend( {
576576
}
577577

578578
// We can fire global events as of now if asked to
579-
// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
579+
// Don't fire events if jQuery.event is undefined in an ESM-usage scenario (trac-15118)
580580
fireGlobals = jQuery.event && s.global;
581581

582582
// Watch for a new set of requests

0 commit comments

Comments
 (0)
Please sign in to comment.