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 gh-4705
This commit is contained in:
Michał Gołębiowski-Owczarek 2020-05-05 14:30:14 +02:00 committed by GitHub
parent 297d18dd13
commit 55cd3a4436
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 17 deletions

View File

@ -1,14 +1,5 @@
{
"root": true,
"extends": "./.eslintrc-node.json",
"overrides": [
{
"files": "rollup.config.js",
"parserOptions": {
"sourceType": "module"
}
}
]
"extends": "./.eslintrc-node.json"
}

View 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",

View File

@ -19,7 +19,8 @@ module.exports = function( grunt ) {
const outputRollupOptions = {
format: "amd",
dir: "amd"
dir: "amd",
indent: false
};
grunt.registerTask(

View 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 );

View 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 > *"
]
} ]
},

View 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