]> source.dussan.org Git - jquery.git/commitdiff
Build: Followups after introducing ES modules compiled via Rollup
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Tue, 5 May 2020 12:30:14 +0000 (14:30 +0200)
committerGitHub <noreply@github.com>
Tue, 5 May 2020 12:30:14 +0000 (14:30 +0200)
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 gh-4705

.eslintrc.json
Gruntfile.js
build/tasks/amd.js
build/tasks/build.js
src/.eslintrc.json
src/ajax.js

index 2fad01637db13327ae5431fcb475cd869f11a9e9..d2c977ca851d8ba124539a86f9a140e55318f87a 100644 (file)
@@ -1,14 +1,5 @@
 {
        "root": true,
 
-       "extends": "./.eslintrc-node.json",
-
-       "overrides": [
-               {
-                       "files": "rollup.config.js",
-                       "parserOptions": {
-                               "sourceType": "module"
-                       }
-               }
-       ]
+       "extends": "./.eslintrc-node.json"
 }
index 0d79e37c0c0123948628377aa6eef4fa4dfa0aae..3b6cd5bba08749e460a3f4e5fbd8b2e043499f2c 100644 (file)
@@ -24,7 +24,7 @@ module.exports = function( grunt ) {
        grunt.initConfig( {
                pkg: grunt.file.readJSON( "package.json" ),
                dst: readOptionalJSON( "dist/.destination.json" ),
-               "compare_size": {
+               compare_size: {
                        files: [ "dist/jquery.js", "dist/jquery.min.js" ],
                        options: {
                                compress: {
@@ -232,7 +232,7 @@ module.exports = function( grunt ) {
                                                "test/data/jquery-1.9.1.js",
                                                "test/data/testinit-jsdom.js",
 
-                                               // We don't support various loading methods like AMD,
+                                               // We don't support various loading methods like esmodules,
                                                // choosing a version etc. for jsdom.
                                                "dist/jquery.js",
 
index 617773ff29d84f194514932a51e0595f7b515b82..c4c9c8941e814a594373085f282dee3b2240bdca 100644 (file)
@@ -19,7 +19,8 @@ module.exports = function( grunt ) {
 
        const outputRollupOptions = {
                format: "amd",
-               dir: "amd"
+               dir: "amd",
+               indent: false
        };
 
        grunt.registerTask(
index 6f984b7054e7037b9ff0c81d803a79174a6f29c2..06a5f404863bb8ef0077f7ed7396ce9c62ac43de 100644 (file)
@@ -54,7 +54,7 @@ module.exports = function( grunt ) {
 
        grunt.registerMultiTask(
                "build",
-               "Concatenate source, remove sub AMD definitions, " +
+               "Build jQuery ECMAScript modules, " +
                        "(include/exclude modules with +/- flags), embed date/version",
        async function() {
                const done = this.async();
@@ -302,7 +302,7 @@ module.exports = function( grunt ) {
                                );
 
                        grunt.file.write( name, compiledContents );
-                       grunt.log.ok( "File '" + name + "' created." );
+                       grunt.log.ok( `File '${ name }' created.` );
                        done();
                } catch ( err ) {
                        done( err );
index 0c1f3f8a789c43468afe4f26eddd853a612847b8..8b0b90f16ef72c0f76207ebeee10c01573f45124 100644 (file)
@@ -34,7 +34,7 @@
                                        // Code Style. This makes that indentation check is not
                                        // performed for 1 depth of outer FunctionExpressions
                                        "ignoredNodes": [
-                                               "Program > ExpressionStatement > CallExpression > FunctionExpression > *"
+                                               "Program > ExpressionStatement > CallExpression > :last-child > *"
                                        ]
                                } ]
                        },
index 61079883ed0ccc3ba36b5ee1a6c4b8c9b0a1271d..a6dc4095a66d18bb22f08a80ecc14cffeaef677e 100644 (file)
@@ -576,7 +576,7 @@ jQuery.extend( {
                }
 
                // We can fire global events as of now if asked to
-               // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
+               // Don't fire events if jQuery.event is undefined in an ESM-usage scenario (trac-15118)
                fireGlobals = jQuery.event && s.global;
 
                // Watch for a new set of requests