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
This commit is contained in:
Michał Gołębiowski-Owczarek 2019-11-18 21:15:03 +01:00 committed by GitHub
parent a612733be0
commit d0ce00cdfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
124 changed files with 787 additions and 1310 deletions

View File

@ -15,9 +15,7 @@
"env": {}, "env": {},
"globals": { "globals": {
"window": true, "window": true
"define": true,
"module": true
}, },
"rules": { "rules": {

View File

@ -4,7 +4,7 @@
"extends": "jquery", "extends": "jquery",
"parserOptions": { "parserOptions": {
"ecmaVersion": 2017 "ecmaVersion": 2018
}, },
"env": { "env": {

View File

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

View File

@ -129,14 +129,14 @@ Rather than rebuilding jQuery with `grunt` every time you make a change, you can
$ grunt watch $ grunt watch
``` ```
Alternatively, you can **load tests in AMD** to avoid the need for rebuilding altogether. Alternatively, you can **load tests as ECMAScript modules** to avoid the need for rebuilding altogether.
Click "Load with AMD" after loading the test page. Click "Load as modules" after loading the test page.
### Repo organization ### Repo organization
The jQuery source is organized with AMD modules and then concatenated and compiled at build time. The jQuery source is organized with ECMAScript modules and then compiled into one file at build time.
jQuery also contains some special modules we call "var modules", which are placed in folders named "var". At build time, these small modules are compiled to simple var statements. This makes it easy for us to share variables across modules. Browse the "src" folder for examples. jQuery also contains some special modules we call "var modules", which are placed in folders named "var". At build time, these small modules are compiled to simple var statements. This makes it easy for us to share variables across modules. Browse the "src" folder for examples.

View File

@ -177,7 +177,7 @@ module.exports = function( grunt ) {
"test/unit/ready.js", "test/unit/ready.js",
{ pattern: "dist/jquery.*", included: false, served: true }, { pattern: "dist/jquery.*", included: false, served: true },
{ pattern: "src/**", included: false, served: true }, { pattern: "src/**", type: "module", included: false, served: true },
{ pattern: "node_modules/**", included: false, served: true }, { pattern: "node_modules/**", included: false, served: true },
{ {
pattern: "test/**/*.@(js|css|jpg|html|xml|svg)", pattern: "test/**/*.@(js|css|jpg|html|xml|svg)",

View File

@ -1,132 +1,66 @@
/** /**
* Special concat/build task to handle various jQuery build requirements * Special build task to handle various jQuery build requirements.
* Concats AMD modules, removes their definitions, * Compiles JS modules into one bundle, sets the custom AMD name,
* and includes/excludes specified modules * and includes/excludes specified modules
*/ */
"use strict"; "use strict";
module.exports = function( grunt ) { module.exports = function( grunt ) {
var fs = require( "fs" ), const fs = require( "fs" );
requirejs = require( "requirejs" ), const path = require( "path" );
Insight = require( "insight" ), const rollup = require( "rollup" );
pkg = require( "../../package.json" ), const rollupHypothetical = require( "rollup-plugin-hypothetical" );
srcFolder = __dirname + "/../../src/", const Insight = require( "insight" );
rdefineEnd = /\}\s*?\);[^}\w]*$/, const pkg = require( "../../package.json" );
read = function( fileName ) { const srcFolder = path.resolve( `${ __dirname }/../../src` );
return grunt.file.read( srcFolder + fileName ); const read = function( fileName ) {
}, return grunt.file.read( `${ srcFolder }/${ fileName }` );
};
// Catch `// @CODE` and subsequent comment lines event if they don't start // Catch `// @CODE` and subsequent comment lines event if they don't start
// in the first column. // in the first column.
wrapper = read( "wrapper.js" ).split( /[\x20\t]*\/\/ @CODE\n(?:[\x20\t]*\/\/[^\n]+\n)*/ ), const wrapper = read( "wrapper.js" )
.split( /[\x20\t]*\/\/ @CODE\n(?:[\x20\t]*\/\/[^\n]+\n)*/ );
config = { const inputFileName = "jquery.js";
baseUrl: "src", const inputRollupOptions = {
name: "jquery", input: `${ srcFolder }/${ inputFileName }`
// Allow strict mode
useStrict: true,
// We have multiple minify steps
optimize: "none",
// Include dependencies loaded with require
findNestedDependencies: true,
// Avoid inserting define() placeholder
skipModuleInsertion: true,
// Avoid breaking semicolons inserted by r.js
skipSemiColonInsertion: true,
wrap: {
start: wrapper[ 0 ].replace( /\/\*\s*eslint(?: |-).*\s*\*\/\n/, "" ),
end: wrapper[ 1 ]
},
rawText: {},
onBuildWrite: convert
}; };
const outputRollupOptions = {
/** // The ESM format is not actually used as we strip it during
* Strip all definitions generated by requirejs // the build; it's just that it doesn't generate any extra
* Convert "var" modules to var declarations // wrappers so there's nothing for us to remove.
* "var module" means the module only contains a return format: "esm",
* statement that should be converted to a var declaration
* This is indicated by including the file in any "var" folder
* @param {String} name
* @param {String} path
* @param {String} contents The contents to be written (including their AMD wrappers)
*/
function convert( name, path, contents ) {
var amdName;
// Convert var modules intro: wrapper[ 0 ]
if ( /.\/var\//.test( path.replace( process.cwd(), "" ) ) ) { .replace( /\n*$/, "" ),
contents = contents outro: wrapper[ 1 ]
.replace( .replace( /^\n*/, "" )
/define\(\s*(["'])[\w\W]*?\1[\w\W]*?return/, };
"var " + const rollupHypotheticalOptions = {
( /var\/([\w-]+)/.exec( name )[ 1 ] ) + allowFallthrough: true,
" =" files: {}
) };
.replace( rdefineEnd, "" );
} else {
contents = contents
.replace( /\s*return\s+[^\}]+(\}\s*?\);[^\w\}]*)$/, "$1" )
// Multiple exports
.replace( /\s*exports\.\w+\s*=\s*\w+;/g, "" );
// Remove define wrappers, closure ends, and empty declarations
contents = contents
.replace( /define\([^{]*?{\s*(?:("|')use strict\1(?:;|))?/, "" )
.replace( rdefineEnd, "" );
// Remove anything wrapped with
// /* ExcludeStart */ /* ExcludeEnd */
// or a single line directly after a // BuildExclude comment
contents = contents
.replace( /\/\*\s*ExcludeStart\s*\*\/[\w\W]*?\/\*\s*ExcludeEnd\s*\*\//ig, "" )
.replace( /\/\/\s*BuildExclude\n\r?[\w\W]*?\n\r?/ig, "" );
// Remove empty definitions
contents = contents
.replace( /define\(\[[^\]]*\]\)[\W\n]+$/, "" );
}
// AMD Name
if ( ( amdName = grunt.option( "amd" ) ) != null && /^exports\/amd$/.test( name ) ) {
if ( amdName ) {
grunt.log.writeln( "Naming jQuery with AMD name: " + amdName );
} else {
grunt.log.writeln( "AMD name now anonymous" );
}
// Remove the comma for anonymous defines
contents = contents
.replace( /(\s*)"jquery"(\,\s*)/, amdName ? "$1\"" + amdName + "\"$2" : "" );
}
return contents;
}
grunt.registerMultiTask( grunt.registerMultiTask(
"build", "build",
"Concatenate source, remove sub AMD definitions, " + "Concatenate source, remove sub AMD definitions, " +
"(include/exclude modules with +/- flags), embed date/version", "(include/exclude modules with +/- flags), embed date/version",
function() { async function() {
var flag, index, const done = this.async();
done = this.async(),
flags = this.flags, try {
optIn = flags[ "*" ], let flag, index;
name = grunt.option( "filename" ), const flags = this.flags;
minimum = this.data.minimum, const optIn = flags[ "*" ];
removeWith = this.data.removeWith, let name = grunt.option( "filename" );
excluded = [], const minimum = this.data.minimum;
included = [], const removeWith = this.data.removeWith;
version = grunt.config( "pkg.version" ), const excluded = [];
const included = [];
let version = grunt.config( "pkg.version" );
/** /**
* Recursively calls the excluder to remove on all modules in the list * Recursively calls the excluder to remove on all modules in the list
@ -134,15 +68,16 @@ module.exports = function( grunt ) {
* @param {String} [prepend] Prepend this to the module name. * @param {String} [prepend] Prepend this to the module name.
* Indicates we're walking a directory * Indicates we're walking a directory
*/ */
excludeList = function( list, prepend ) { const excludeList = ( list, prepend ) => {
if ( list ) { if ( list ) {
prepend = prepend ? prepend + "/" : ""; prepend = prepend ? `${ prepend }/` : "";
list.forEach( function( module ) { list.forEach( function( module ) {
// Exclude var modules as well // Exclude var modules as well
if ( module === "var" ) { if ( module === "var" ) {
excludeList( excludeList(
fs.readdirSync( srcFolder + prepend + module ), prepend + module fs.readdirSync( `${ srcFolder }/${ prepend }${ module }` ),
prepend + module
); );
return; return;
} }
@ -164,7 +99,7 @@ module.exports = function( grunt ) {
} }
} ); } );
} }
}, };
/** /**
* Adds the specified module to the excluded or included list, depending on the flag * Adds the specified module to the excluded or included list, depending on the flag
@ -172,11 +107,11 @@ module.exports = function( grunt ) {
* the src directory starting with + or - to indicate * the src directory starting with + or - to indicate
* whether it should included or excluded * whether it should included or excluded
*/ */
excluder = function( flag ) { const excluder = flag => {
var additional, let additional;
m = /^(\+|\-|)([\w\/-]+)$/.exec( flag ), const m = /^(\+|\-|)([\w\/-]+)$/.exec( flag );
exclude = m[ 1 ] === "-", const exclude = m[ 1 ] === "-";
module = m[ 2 ]; const module = m[ 2 ];
if ( exclude ) { if ( exclude ) {
@ -192,7 +127,10 @@ module.exports = function( grunt ) {
// These are the removable dependencies // These are the removable dependencies
// It's fine if the directory is not there // It's fine if the directory is not there
try { try {
excludeList( fs.readdirSync( srcFolder + module ), module ); excludeList(
fs.readdirSync( `${ srcFolder }/${ module }` ),
module
);
} catch ( e ) { } catch ( e ) {
grunt.verbose.writeln( e ); grunt.verbose.writeln( e );
} }
@ -204,7 +142,7 @@ module.exports = function( grunt ) {
if ( additional ) { if ( additional ) {
excludeList( additional.remove || additional ); excludeList( additional.remove || additional );
if ( additional.include ) { if ( additional.include ) {
included = included.concat( additional.include ); included.push( ...additional.include );
grunt.log.writeln( "+" + additional.include ); grunt.log.writeln( "+" + additional.include );
} }
} }
@ -220,7 +158,7 @@ module.exports = function( grunt ) {
// Filename can be passed to the command line using // Filename can be passed to the command line using
// command line options // command line options
// e.g. grunt build --filename=jquery-custom.js // e.g. grunt build --filename=jquery-custom.js
name = name ? ( "dist/" + name ) : this.data.dest; name = name ? `dist/${ name }` : this.data.dest;
// append commit id to version // append commit id to version
if ( process.env.COMMIT ) { if ( process.env.COMMIT ) {
@ -246,13 +184,34 @@ module.exports = function( grunt ) {
excluder( flag ); excluder( flag );
} }
// Remove the jQuery export from the entry file, we'll use our own
// custom wrapper.
rollupHypotheticalOptions.files[ inputRollupOptions.input ] = read( inputFileName )
.replace( /\n*export default jQuery;\n*/, "\n" );
// Replace exports/global with a noop noConflict // Replace exports/global with a noop noConflict
if ( ( index = excluded.indexOf( "exports/global" ) ) > -1 ) { if ( ( index = excluded.indexOf( "exports/global" ) ) > -1 ) {
config.rawText[ "exports/global" ] = "define(['../core']," + rollupHypotheticalOptions.files[ `${ srcFolder }/exports/global.js` ] =
"function( jQuery ) {\njQuery.noConflict = function() {};\n});"; "import jQuery from \"../core.js\";\n\n" +
"jQuery.noConflict = function() {};";
excluded.splice( index, 1 ); excluded.splice( index, 1 );
} }
// Set a desired AMD name.
let amdName = grunt.option( "amd" );
if ( amdName != null ) {
if ( amdName ) {
grunt.log.writeln( "Naming jQuery with AMD name: " + amdName );
} else {
grunt.log.writeln( "AMD name now anonymous" );
}
// Remove the comma for anonymous defines
rollupHypotheticalOptions.files[ `${ srcFolder }/exports/amd.js` ] =
read( "exports/amd.js" )
.replace( /(\s*)"jquery"(\,\s*)/, amdName ? "$1\"" + amdName + "\"$2" : "" );
}
grunt.verbose.writeflags( excluded, "Excluded" ); grunt.verbose.writeflags( excluded, "Excluded" );
grunt.verbose.writeflags( included, "Included" ); grunt.verbose.writeflags( included, "Included" );
@ -264,46 +223,54 @@ module.exports = function( grunt ) {
grunt.config.set( "pkg.version", version ); grunt.config.set( "pkg.version", version );
grunt.verbose.writeln( "Version changed to " + version ); grunt.verbose.writeln( "Version changed to " + version );
// Have to use shallow or core will get excluded since it is a dependency // Replace excluded modules with empty sources.
config.excludeShallow = excluded; for ( const module of excluded ) {
rollupHypotheticalOptions.files[ `${ srcFolder }/${ module }.js` ] = "";
}
} }
config.include = included;
/** // Turn off opt-in if necessary
* Handle Final output from the optimizer if ( !optIn ) {
* @param {String} compiled
*/ // Remove the default inclusions, they will be overwritten with the explicitly
config.out = function( compiled ) { // included ones.
compiled = compiled rollupHypotheticalOptions.files[ inputRollupOptions.input ] = "";
}
// Import the explicitly included modules.
if ( included.length ) {
rollupHypotheticalOptions.files[ inputRollupOptions.input ] += included
.map( module => `import "./${module}.js";` )
.join( "\n" );
}
const bundle = await rollup.rollup( {
...inputRollupOptions,
plugins: [ rollupHypothetical( rollupHypotheticalOptions ) ]
} );
const { output: [ { code } ] } = await bundle.generate( outputRollupOptions );
const compiledContents = code
// Embed Version // Embed Version
.replace( /@VERSION/g, version ) .replace( /@VERSION/g, version )
// Embed Date // Embed Date
// yyyy-mm-ddThh:mmZ // yyyy-mm-ddThh:mmZ
.replace( /@DATE/g, ( new Date() ).toISOString().replace( /:\d+\.\d+Z$/, "Z" ) ); .replace(
/@DATE/g,
( new Date() ).toISOString()
.replace( /:\d+\.\d+Z$/, "Z" )
);
// Write concatenated source to file grunt.file.write( name, compiledContents );
grunt.file.write( name, compiled );
};
// Turn off opt-in if necessary
if ( !optIn ) {
// Overwrite the default inclusions with the explicit ones provided
config.rawText.jquery = "define([" +
( included.length ? included.join( "," ) : "" ) +
"]);";
}
// Trace dependencies and concatenate files
requirejs.optimize( config, function( response ) {
grunt.verbose.writeln( response );
grunt.log.ok( "File '" + name + "' created." ); grunt.log.ok( "File '" + name + "' created." );
done(); done();
}, function( err ) { } catch ( err ) {
done( err ); done( err );
} ); }
} ); } );
// Special "alias" task to make custom build creation less grawlix-y // Special "alias" task to make custom build creation less grawlix-y
@ -315,17 +282,17 @@ module.exports = function( grunt ) {
// //
// grunt build:*:*:+ajax:-dimensions:-effects:-offset // grunt build:*:*:+ajax:-dimensions:-effects:-offset
grunt.registerTask( "custom", function() { grunt.registerTask( "custom", function() {
var args = this.args, const args = this.args;
modules = args.length ? args[ 0 ].replace( /,/g, ":" ) : "", const modules = args.length ? args[ 0 ].replace( /,/g, ":" ) : "";
done = this.async(), const done = this.async();
insight = new Insight( { const insight = new Insight( {
trackingCode: "UA-1076265-4", trackingCode: "UA-1076265-4",
pkg: pkg pkg: pkg
} ); } );
function exec( trackingAllowed ) { function exec( trackingAllowed ) {
var tracks = args.length ? args[ 0 ].split( "," ) : []; let tracks = args.length ? args[ 0 ].split( "," ) : [];
var defaultPath = [ "build", "custom" ]; const defaultPath = [ "build", "custom" ];
tracks = tracks.map( function( track ) { tracks = tracks.map( function( track ) {
return track.replace( /\//g, "+" ); return track.replace( /\//g, "+" );
@ -335,7 +302,7 @@ module.exports = function( grunt ) {
// Track individuals // Track individuals
tracks.forEach( function( module ) { tracks.forEach( function( module ) {
var path = defaultPath.concat( [ "individual" ], module ); const path = defaultPath.concat( [ "individual" ], module );
insight.track.apply( insight, path ); insight.track.apply( insight, path );
} ); } );

11
dist/.eslintrc.json vendored
View File

@ -3,8 +3,19 @@
"extends": "../.eslintrc-browser.json", "extends": "../.eslintrc-browser.json",
"parserOptions": {
"ecmaVersion": 5,
"sourceType": "script"
},
"rules": { "rules": {
// That is okay for the built version // That is okay for the built version
"no-multiple-empty-lines": "off" "no-multiple-empty-lines": "off"
},
"globals": {
"define": false,
"module": true,
"Symbol": false
} }
} }

View File

@ -36,7 +36,7 @@
"grunt-compare-size": "0.4.2", "grunt-compare-size": "0.4.2",
"grunt-contrib-uglify": "3.4.0", "grunt-contrib-uglify": "3.4.0",
"grunt-contrib-watch": "1.1.0", "grunt-contrib-watch": "1.1.0",
"grunt-eslint": "21.0.0", "grunt-eslint": "22.0.0",
"grunt-git-authors": "3.2.0", "grunt-git-authors": "3.2.0",
"grunt-jsonlint": "1.1.0", "grunt-jsonlint": "1.1.0",
"grunt-karma": "3.0.1", "grunt-karma": "3.0.1",
@ -59,6 +59,8 @@
"qunit": "2.9.2", "qunit": "2.9.2",
"raw-body": "2.3.3", "raw-body": "2.3.3",
"requirejs": "2.3.6", "requirejs": "2.3.6",
"rollup": "1.25.2",
"rollup-plugin-hypothetical": "2.1.0",
"sinon": "7.3.1", "sinon": "7.3.1",
"strip-json-comments": "2.0.1", "strip-json-comments": "2.0.1",
"testswarm": "1.1.0", "testswarm": "1.1.0",

View File

@ -3,11 +3,42 @@
"extends": "../.eslintrc-browser.json", "extends": "../.eslintrc-browser.json",
"parserOptions": {
"ecmaVersion": 2015,
"sourceType": "module"
},
"overrides": [ "overrides": [
{ {
"files": "wrapper.js", "files": "wrapper.js",
"parserOptions": {
"ecmaVersion": 5,
"sourceType": "script"
},
"rules": {
"no-unused-vars": "off"
},
"globals": { "globals": {
"jQuery": false "jQuery": false,
"module": true
}
},
{
"files": "exports/amd.js",
"globals": {
"define": false
}
},
{
"files": "core.js",
"globals": {
// Defining Symbol globally would create a danger of using
// it unguarded in another place, it seems safer to define
// it only for this module.
"Symbol": false
} }
} }
] ]

View File

@ -1,19 +1,15 @@
define( [ import jQuery from "./core.js";
"./core", import document from "./var/document.js";
"./var/document", import rnothtmlwhite from "./var/rnothtmlwhite.js";
"./var/rnothtmlwhite", import location from "./ajax/var/location.js";
"./ajax/var/location", import nonce from "./ajax/var/nonce.js";
"./ajax/var/nonce", import rquery from "./ajax/var/rquery.js";
"./ajax/var/rquery",
"./core/init", import "./core/init.js";
"./ajax/parseXML", import "./ajax/parseXML.js";
"./event/trigger", import "./event/trigger.js";
"./deferred", import "./deferred.js";
"./serialize" // jQuery.param import "./serialize"; // jQuery.param
], function( jQuery, document, rnothtmlwhite, location, nonce, rquery ) {
"use strict";
var var
r20 = /%20/g, r20 = /%20/g,
@ -615,7 +611,8 @@ jQuery.extend( {
// Add or update anti-cache param if needed // Add or update anti-cache param if needed
if ( s.cache === false ) { if ( s.cache === false ) {
cacheURL = cacheURL.replace( rantiCache, "$1" ); cacheURL = cacheURL.replace( rantiCache, "$1" );
uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached; uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" +
( nonce.guid++ ) + uncached;
} }
// Put hash and anti-cache on the URL that will be requested (gh-1732) // Put hash and anti-cache on the URL that will be requested (gh-1732)
@ -864,5 +861,4 @@ jQuery.each( [ "get", "post" ], function( _i, method ) {
}; };
} ); } );
return jQuery; export default jQuery;
} );

View File

@ -1,11 +1,8 @@
define( [ import jQuery from "../core.js";
"../core", import nonce from "./var/nonce.js";
"./var/nonce", import rquery from "./var/rquery.js";
"./var/rquery",
"../ajax"
], function( jQuery, nonce, rquery ) {
"use strict"; import "../ajax.js";
var oldCallbacks = [], var oldCallbacks = [],
rjsonp = /(=)\?(?=&|$)|\?\?/; rjsonp = /(=)\?(?=&|$)|\?\?/;
@ -14,7 +11,7 @@ var oldCallbacks = [],
jQuery.ajaxSetup( { jQuery.ajaxSetup( {
jsonp: "callback", jsonp: "callback",
jsonpCallback: function() { jsonpCallback: function() {
var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) );
this[ callback ] = true; this[ callback ] = true;
return callback; return callback;
} }
@ -98,5 +95,3 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
return "script"; return "script";
} }
} ); } );
} );

View File

@ -1,14 +1,11 @@
define( [ import jQuery from "../core.js";
"../core", import stripAndCollapse from "../core/stripAndCollapse.js";
"../core/stripAndCollapse",
"../core/parseHTML",
"../ajax",
"../traversing",
"../manipulation",
"../selector"
], function( jQuery, stripAndCollapse ) {
"use strict"; import "../core/parseHTML.js";
import "../ajax.js";
import "../traversing.js";
import "../manipulation.js";
import "../selector.js";
/** /**
* Load a url into a page * Load a url into a page
@ -72,5 +69,3 @@ jQuery.fn.load = function( url, params, callback ) {
return this; return this;
}; };
} );

View File

@ -1,8 +1,4 @@
define( [ import jQuery from "../core.js";
"../core"
], function( jQuery ) {
"use strict";
// Cross-browser xml parsing // Cross-browser xml parsing
jQuery.parseXML = function( data ) { jQuery.parseXML = function( data ) {
@ -25,6 +21,4 @@ jQuery.parseXML = function( data ) {
return xml; return xml;
}; };
return jQuery.parseXML; export default jQuery.parseXML;
} );

View File

@ -1,10 +1,7 @@
define( [ import jQuery from "../core.js";
"../core", import document from "../var/document.js";
"../var/document",
"../ajax"
], function( jQuery, document ) {
"use strict"; import "../ajax.js";
// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
jQuery.ajaxPrefilter( function( s ) { jQuery.ajaxPrefilter( function( s ) {
@ -70,5 +67,3 @@ jQuery.ajaxTransport( "script", function( s ) {
}; };
} }
} ); } );
} );

View File

@ -1,5 +1 @@
define( function() { export default window.location;
"use strict";
return window.location;
} );

View File

@ -1,5 +1 @@
define( function() { export default { guid: Date.now() };
"use strict";
return Date.now();
} );

View File

@ -1,5 +1 @@
define( function() { export default ( /\?/ );
"use strict";
return ( /\?/ );
} );

View File

@ -1,9 +1,6 @@
define( [ import jQuery from "../core.js";
"../core",
"../ajax"
], function( jQuery ) {
"use strict"; import "../ajax.js";
jQuery.ajaxSettings.xhr = function() { jQuery.ajaxSettings.xhr = function() {
return new window.XMLHttpRequest(); return new window.XMLHttpRequest();
@ -116,5 +113,3 @@ jQuery.ajaxTransport( function( options ) {
} }
}; };
} ); } );
} );

View File

@ -1,13 +1,9 @@
define( [ import jQuery from "./core.js";
"./core",
"./attributes/attr",
"./attributes/prop",
"./attributes/classes",
"./attributes/val"
], function( jQuery ) {
"use strict"; import "./attributes/attr.js";
import "./attributes/prop.js";
import "./attributes/classes.js";
import "./attributes/val.js";
// Return jQuery for attributes-only inclusion // Return jQuery for attributes-only inclusion
return jQuery; export default jQuery;
} );

View File

@ -1,13 +1,10 @@
define( [ import jQuery from "../core.js";
"../core", import access from "../core/access.js";
"../core/access", import nodeName from "../core/nodeName.js";
"../core/nodeName", import rnothtmlwhite from "../var/rnothtmlwhite.js";
"../var/rnothtmlwhite", import isIE from "../var/isIE.js";
"../var/isIE",
"../selector"
], function( jQuery, access, nodeName, rnothtmlwhite, isIE ) {
"use strict"; import "../selector.js";
jQuery.fn.extend( { jQuery.fn.extend( {
attr: function( name, value ) { attr: function( name, value ) {
@ -128,5 +125,3 @@ jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name )
} }
}; };
} ); } );
} );

View File

@ -1,12 +1,9 @@
define( [ import jQuery from "../core.js";
"../core", import stripAndCollapse from "../core/stripAndCollapse.js";
"../core/stripAndCollapse", import rnothtmlwhite from "../var/rnothtmlwhite.js";
"../var/rnothtmlwhite", import dataPriv from "../data/var/dataPriv.js";
"../data/var/dataPriv",
"../core/init"
], function( jQuery, stripAndCollapse, rnothtmlwhite, dataPriv ) {
"use strict"; import "../core/init.js";
function getClass( elem ) { function getClass( elem ) {
return elem.getAttribute && elem.getAttribute( "class" ) || ""; return elem.getAttribute && elem.getAttribute( "class" ) || "";
@ -181,5 +178,3 @@ jQuery.fn.extend( {
return false; return false;
} }
} ); } );
} );

View File

@ -1,11 +1,8 @@
define( [ import jQuery from "../core.js";
"../core", import access from "../core/access.js";
"../core/access", import isIE from "../var/isIE.js";
"../var/isIE",
"../selector"
], function( jQuery, access, isIE ) {
"use strict"; import "../selector.js";
var rfocusable = /^(?:input|select|textarea|button)$/i, var rfocusable = /^(?:input|select|textarea|button)$/i,
rclickable = /^(?:a|area)$/i; rclickable = /^(?:a|area)$/i;
@ -136,5 +133,3 @@ jQuery.each( [
], function() { ], function() {
jQuery.propFix[ this.toLowerCase() ] = this; jQuery.propFix[ this.toLowerCase() ] = this;
} ); } );
} );

View File

@ -1,12 +1,8 @@
define( [ import jQuery from "../core.js";
"../core", import stripAndCollapse from "../core/stripAndCollapse.js";
"../core/stripAndCollapse", import nodeName from "../core/nodeName.js";
"../core/nodeName",
"../core/init" import "../core/init.js";
], function( jQuery, stripAndCollapse, nodeName ) {
"use strict";
var rreturn = /\r/g; var rreturn = /\r/g;
@ -147,15 +143,11 @@ jQuery.extend( {
while ( i-- ) { while ( i-- ) {
option = options[ i ]; option = options[ i ];
/* eslint-disable no-cond-assign */ if ( ( option.selected =
if ( option.selected =
jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
) { ) ) {
optionSet = true; optionSet = true;
} }
/* eslint-enable no-cond-assign */
} }
// Force browsers to behave consistently when non-matching value is set // Force browsers to behave consistently when non-matching value is set
@ -178,5 +170,3 @@ jQuery.each( [ "radio", "checkbox" ], function() {
} }
}; };
} ); } );
} );

View File

@ -1,10 +1,6 @@
define( [ import jQuery from "./core.js";
"./core", import toType from "./core/toType.js";
"./core/toType", import rnothtmlwhite from "./var/rnothtmlwhite.js";
"./var/rnothtmlwhite"
], function( jQuery, toType, rnothtmlwhite ) {
"use strict";
// Convert String-formatted options into Object-formatted ones // Convert String-formatted options into Object-formatted ones
function createOptions( options ) { function createOptions( options ) {
@ -231,5 +227,4 @@ jQuery.Callbacks = function( options ) {
return self; return self;
}; };
return jQuery; export default jQuery;
} );

View File

@ -1,29 +1,21 @@
/* global Symbol */ import arr from "./var/arr.js";
// Defining this global in .eslintrc.json would create a danger of using the global import getProto from "./var/getProto.js";
// unguarded in another place, it seems safer to define global only for this module import slice from "./var/slice.js";
import flat from "./var/flat.js";
define( [ import push from "./var/push.js";
"./var/arr", import indexOf from "./var/indexOf.js";
"./var/getProto", import class2type from "./var/class2type.js";
"./var/slice", import toString from "./var/toString.js";
"./var/flat", import hasOwn from "./var/hasOwn.js";
"./var/push", import fnToString from "./var/fnToString.js";
"./var/indexOf", import ObjectFunctionString from "./var/ObjectFunctionString.js";
"./var/class2type", import support from "./var/support.js";
"./var/toString", import isWindow from "./var/isWindow.js";
"./var/hasOwn", import DOMEval from "./core/DOMEval.js";
"./var/fnToString", import toType from "./core/toType.js";
"./var/ObjectFunctionString",
"./var/support",
"./var/isWindow",
"./core/DOMEval",
"./core/toType"
], function( arr, getProto, slice, flat, push, indexOf,
class2type, toString, hasOwn, fnToString, ObjectFunctionString,
support, isWindow, DOMEval, toType ) {
"use strict";
// When custom compilation is used, the version string can get large.
// eslint-disable-next-line max-len
var version = "@VERSION", var version = "@VERSION",
rhtmlSuffix = /HTML$/i, rhtmlSuffix = /HTML$/i,
@ -431,5 +423,4 @@ function isArrayLike( obj ) {
typeof length === "number" && length > 0 && ( length - 1 ) in obj; typeof length === "number" && length > 0 && ( length - 1 ) in obj;
} }
return jQuery; export default jQuery;
} );

View File

@ -1,16 +1,13 @@
define( [ import document from "../var/document.js";
"../var/document"
], function( document ) {
"use strict";
var preservedScriptAttributes = { var preservedScriptAttributes = {
type: true, type: true,
src: true, src: true,
nonce: true, nonce: true,
noModule: true noModule: true
}; };
function DOMEval( code, node, doc ) { function DOMEval( code, node, doc ) {
doc = doc || document; doc = doc || document;
var i, val, var i, val,
@ -37,7 +34,6 @@ define( [
} }
} }
doc.head.appendChild( script ).parentNode.removeChild( script ); doc.head.appendChild( script ).parentNode.removeChild( script );
} }
return DOMEval; export default DOMEval;
} );

View File

@ -1,9 +1,5 @@
define( [ import jQuery from "../core.js";
"../core", import toType from "../core/toType.js";
"../core/toType"
], function( jQuery, toType ) {
"use strict";
// Multifunctional method to get and set values of a collection // Multifunctional method to get and set values of a collection
// The value/s can optionally be executed if it's a function // The value/s can optionally be executed if it's a function
@ -66,6 +62,4 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
return len ? fn( elems[ 0 ], key ) : emptyGet; return len ? fn( elems[ 0 ], key ) : emptyGet;
}; };
return access; export default access;
} );

View File

@ -1,7 +1,3 @@
define( [], function() {
"use strict";
// Matches dashed string for camelizing // Matches dashed string for camelizing
var rdashAlpha = /-([a-z])/g; var rdashAlpha = /-([a-z])/g;
@ -15,6 +11,4 @@ function camelCase( string ) {
return string.replace( rdashAlpha, fcamelCase ); return string.replace( rdashAlpha, fcamelCase );
} }
return camelCase; export default camelCase;
} );

View File

@ -1,13 +1,9 @@
// Initialize a jQuery object // Initialize a jQuery object
define( [ import jQuery from "../core.js";
"../core", import document from "../var/document.js";
"../var/document", import rsingleTag from "./var/rsingleTag.js";
"./var/rsingleTag",
"../traversing/findFilter" import "../traversing/findFilter.js";
], function( jQuery, document, rsingleTag ) {
"use strict";
// A central reference to the root jQuery(document) // A central reference to the root jQuery(document)
var rootjQuery, var rootjQuery,
@ -123,6 +119,4 @@ init.prototype = jQuery.fn;
// Initialize central reference // Initialize central reference
rootjQuery = jQuery( document ); rootjQuery = jQuery( document );
return init; export default init;
} );

View File

@ -1,23 +1,20 @@
define( [ import jQuery from "../core.js";
"../core", import documentElement from "../var/documentElement.js";
"../var/documentElement",
"../selector/contains" // jQuery.contains
], function( jQuery, documentElement ) {
"use strict";
var isAttached = function( elem ) { import "../selector/contains.js"; // jQuery.contains
var isAttached = function( elem ) {
return jQuery.contains( elem.ownerDocument, elem ); return jQuery.contains( elem.ownerDocument, elem );
}, },
composed = { composed: true }; composed = { composed: true };
// Support: IE 9 - 11+, Edge 12 - 18+ // Support: IE 9 - 11+, Edge 12 - 18+
// Check attachment across shadow DOM boundaries when possible (gh-3504) // Check attachment across shadow DOM boundaries when possible (gh-3504)
if ( documentElement.getRootNode ) { if ( documentElement.getRootNode ) {
isAttached = function( elem ) { isAttached = function( elem ) {
return jQuery.contains( elem.ownerDocument, elem ) || return jQuery.contains( elem.ownerDocument, elem ) ||
elem.getRootNode( composed ) === elem.ownerDocument; elem.getRootNode( composed ) === elem.ownerDocument;
}; };
} }
return isAttached; export default isAttached;
} );

View File

@ -1,13 +1,7 @@
define( function() {
"use strict";
function nodeName( elem, name ) { function nodeName( elem, name ) {
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
}; };
return nodeName; export default nodeName;
} );

View File

@ -1,11 +1,7 @@
define( [ import jQuery from "../core.js";
"../core", import document from "../var/document.js";
"../var/document", import rsingleTag from "./var/rsingleTag.js";
"./var/rsingleTag", import buildFragment from "../manipulation/buildFragment.js";
"../manipulation/buildFragment"
], function( jQuery, document, rsingleTag, buildFragment ) {
"use strict";
// Argument "data" should be string of html // Argument "data" should be string of html
// context (optional): If specified, the fragment will be created in this context, // context (optional): If specified, the fragment will be created in this context,
@ -52,7 +48,3 @@ jQuery.parseHTML = function( data, context, keepScripts ) {
return jQuery.merge( [], parsed.childNodes ); return jQuery.merge( [], parsed.childNodes );
}; };
return jQuery.parseHTML;
} );

View File

@ -1,9 +1,5 @@
define( [ import jQuery from "../core.js";
"../core", import document from "../var/document.js";
"../var/document"
], function( jQuery, document ) {
"use strict";
var readyCallbacks = [], var readyCallbacks = [],
whenReady = function( fn ) { whenReady = function( fn ) {
@ -89,5 +85,3 @@ if ( document.readyState !== "loading" ) {
// A fallback to window.onload, that will always work // A fallback to window.onload, that will always work
window.addEventListener( "load", completed ); window.addEventListener( "load", completed );
} }
} );

View File

@ -1,11 +1,8 @@
define( [ import jQuery from "../core.js";
"../core", import document from "../var/document.js";
"../var/document",
"../core/readyException",
"../deferred"
], function( jQuery, document ) {
"use strict"; import "../core/readyException.js";
import "../deferred.js";
// The deferred used on DOM ready // The deferred used on DOM ready
var readyList = jQuery.Deferred(); var readyList = jQuery.Deferred();
@ -79,5 +76,3 @@ if ( document.readyState !== "loading" ) {
// A fallback to window.onload, that will always work // A fallback to window.onload, that will always work
window.addEventListener( "load", completed ); window.addEventListener( "load", completed );
} }
} );

View File

@ -1,13 +1,7 @@
define( [ import jQuery from "../core.js";
"../core"
], function( jQuery ) {
"use strict";
jQuery.readyException = function( error ) { jQuery.readyException = function( error ) {
window.setTimeout( function() { window.setTimeout( function() {
throw error; throw error;
} ); } );
}; };
} );

View File

@ -1,14 +1,10 @@
define( [ import rnothtmlwhite from "../var/rnothtmlwhite.js";
"../var/rnothtmlwhite"
], function( rnothtmlwhite ) {
"use strict";
// Strip and collapse whitespace according to HTML spec // Strip and collapse whitespace according to HTML spec
// https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
function stripAndCollapse( value ) { function stripAndCollapse( value ) {
var tokens = value.match( rnothtmlwhite ) || []; var tokens = value.match( rnothtmlwhite ) || [];
return tokens.join( " " ); return tokens.join( " " );
} }
return stripAndCollapse; export default stripAndCollapse;
} );

View File

@ -1,9 +1,5 @@
define( [ import class2type from "../var/class2type.js";
"../var/class2type", import toString from "../var/toString.js";
"../var/toString"
], function( class2type, toString ) {
"use strict";
function toType( obj ) { function toType( obj ) {
if ( obj == null ) { if ( obj == null ) {
@ -15,5 +11,4 @@ function toType( obj ) {
typeof obj; typeof obj;
} }
return toType; export default toType;
} );

View File

@ -1,7 +1 @@
define( function() { export default ( /HTML$/i );
"use strict";
return ( /HTML$/i );
} );

View File

@ -1,7 +1,3 @@
define( function() { // rsingleTag matches a string consisting of a single HTML element with no attributes
"use strict"; // and captures the element's name
export default ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
// rsingleTag matches a string consisting of a single HTML element with no attributes
// and captures the element's name
return ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
} );

View File

@ -1,27 +1,22 @@
define( [ import jQuery from "./core.js";
"./core", import access from "./core/access.js";
"./core/access", import nodeName from "./core/nodeName.js";
"./core/nodeName", import rcssNum from "./var/rcssNum.js";
"./var/rcssNum", import isIE from "./var/isIE.js";
"./var/isIE", import rnumnonpx from "./css/var/rnumnonpx.js";
"./css/var/rnumnonpx", import cssExpand from "./css/var/cssExpand.js";
"./css/var/cssExpand", import isAutoPx from "./css/isAutoPx.js";
"./css/isAutoPx", import cssCamelCase from "./css/cssCamelCase.js";
"./css/cssCamelCase", import getStyles from "./css/var/getStyles.js";
"./css/var/getStyles", import swap from "./css/var/swap.js";
"./css/var/swap", import curCSS from "./css/curCSS.js";
"./css/curCSS", import adjustCSS from "./css/adjustCSS.js";
"./css/adjustCSS", import support from "./css/support.js";
"./css/support", import finalPropName from "./css/finalPropName.js";
"./css/finalPropName",
"./core/init", import "./core/init.js";
"./core/ready", import "./core/ready.js";
"./selector" // contains import "./selector.js"; // contains
], function( jQuery, access, nodeName, rcssNum, isIE, rnumnonpx, cssExpand, isAutoPx,
cssCamelCase, getStyles, swap, curCSS, adjustCSS, support, finalPropName ) {
"use strict";
var var
@ -426,5 +421,4 @@ jQuery.fn.extend( {
} }
} ); } );
return jQuery; export default jQuery;
} );

View File

@ -1,10 +1,6 @@
define( [ import jQuery from "../core.js";
"../core", import isAutoPx from "./isAutoPx.js";
"./isAutoPx", import rcssNum from "../var/rcssNum.js";
"../var/rcssNum"
], function( jQuery, isAutoPx, rcssNum ) {
"use strict";
function adjustCSS( elem, prop, valueParts, tween ) { function adjustCSS( elem, prop, valueParts, tween ) {
var adjusted, scale, var adjusted, scale,
@ -71,5 +67,4 @@ function adjustCSS( elem, prop, valueParts, tween ) {
return adjusted; return adjusted;
} }
return adjustCSS; export default adjustCSS;
} );

View File

@ -1,8 +1,4 @@
define( [ import camelCase from "../core/camelCase.js";
"../core/camelCase"
], function( camelCase ) {
"use strict";
// Matches dashed string for camelizing // Matches dashed string for camelizing
var rmsPrefix = /^-ms-/; var rmsPrefix = /^-ms-/;
@ -15,6 +11,4 @@ function cssCamelCase( string ) {
return camelCase( string.replace( rmsPrefix, "ms-" ) ); return camelCase( string.replace( rmsPrefix, "ms-" ) );
} }
return cssCamelCase; export default cssCamelCase;
} );

View File

@ -1,10 +1,6 @@
define( [ import jQuery from "../core.js";
"../core", import isAttached from "../core/isAttached.js";
"../core/isAttached", import getStyles from "./var/getStyles.js";
"./var/getStyles"
], function( jQuery, isAttached, getStyles ) {
"use strict";
function curCSS( elem, name, computed ) { function curCSS( elem, name, computed ) {
var ret; var ret;
@ -28,5 +24,4 @@ function curCSS( elem, name, computed ) {
ret; ret;
} }
return curCSS; export default curCSS;
} );

View File

@ -1,8 +1,4 @@
define( [ import document from "../var/document.js";
"../var/document"
], function( document ) {
"use strict";
var cssPrefixes = [ "Webkit", "Moz", "ms" ], var cssPrefixes = [ "Webkit", "Moz", "ms" ],
emptyStyle = document.createElement( "div" ).style, emptyStyle = document.createElement( "div" ).style,
@ -36,6 +32,4 @@ function finalPropName( name ) {
return vendorProps[ name ] = vendorPropName( name ) || name; return vendorProps[ name ] = vendorPropName( name ) || name;
} }
return finalPropName; export default finalPropName;
} );

View File

@ -1,9 +1,6 @@
define( [ import jQuery from "../core.js";
"../core",
"../selector"
], function( jQuery ) {
"use strict"; import "../selector.js";
jQuery.expr.pseudos.hidden = function( elem ) { jQuery.expr.pseudos.hidden = function( elem ) {
return !jQuery.expr.pseudos.visible( elem ); return !jQuery.expr.pseudos.visible( elem );
@ -11,5 +8,3 @@ jQuery.expr.pseudos.hidden = function( elem ) {
jQuery.expr.pseudos.visible = function( elem ) { jQuery.expr.pseudos.visible = function( elem ) {
return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
}; };
} );

View File

@ -1,7 +1,3 @@
define( function() {
"use strict";
var ralphaStart = /^[a-z]/, var ralphaStart = /^[a-z]/,
// The regex visualized: // The regex visualized:
@ -36,6 +32,4 @@ function isAutoPx( prop ) {
rautoPx.test( prop[ 0 ].toUpperCase() + prop.slice( 1 ) ); rautoPx.test( prop[ 0 ].toUpperCase() + prop.slice( 1 ) );
}; };
return isAutoPx; export default isAutoPx;
} );

View File

@ -1,10 +1,6 @@
define( [ import jQuery from "../core.js";
"../core", import dataPriv from "../data/var/dataPriv.js";
"../data/var/dataPriv", import isHiddenWithinTree from "../css/var/isHiddenWithinTree.js";
"../css/var/isHiddenWithinTree"
], function( jQuery, dataPriv, isHiddenWithinTree ) {
"use strict";
var defaultDisplayMap = {}; var defaultDisplayMap = {};
@ -101,5 +97,4 @@ jQuery.fn.extend( {
} }
} ); } );
return showHide; export default showHide;
} );

View File

@ -1,10 +1,6 @@
define( [ import document from "../var/document.js";
"../var/document", import documentElement from "../var/documentElement.js";
"../var/documentElement", import support from "../var/support.js";
"../var/support"
], function( document, documentElement, support ) {
"use strict";
var reliableTrDimensionsVal; var reliableTrDimensionsVal;
@ -35,6 +31,4 @@ support.reliableTrDimensions = function() {
return reliableTrDimensionsVal; return reliableTrDimensionsVal;
}; };
return support; export default support;
} );

View File

@ -1,5 +1 @@
define( function() { export default [ "Top", "Right", "Bottom", "Left" ];
"use strict";
return [ "Top", "Right", "Bottom", "Left" ];
} );

View File

@ -1,7 +1,4 @@
define( function() { export default function( elem ) {
"use strict";
return function( elem ) {
// Support: IE <=11+ (trac-14150) // Support: IE <=11+ (trac-14150)
// In IE popup's `window` is the opener window which makes `window.getComputedStyle( elem )` // In IE popup's `window` is the opener window which makes `window.getComputedStyle( elem )`
@ -15,5 +12,4 @@ define( function() {
} }
return view.getComputedStyle( elem ); return view.getComputedStyle( elem );
}; };
} );

View File

@ -1,18 +1,13 @@
define( [ import jQuery from "../../core.js";
"../../core"
// css is assumed // isHiddenWithinTree reports if an element has a non-"none" display style (inline and/or
], function( jQuery ) { // through the CSS cascade), which is useful in deciding whether or not to make it visible.
"use strict"; // It differs from the :hidden selector (jQuery.expr.pseudos.hidden) in two important ways:
// * A hidden ancestor does not force an element to be classified as hidden.
// isHiddenWithinTree reports if an element has a non-"none" display style (inline and/or // * Being disconnected from the document does not force an element to be classified as hidden.
// through the CSS cascade), which is useful in deciding whether or not to make it visible. // These differences improve the behavior of .toggle() et al. when applied to elements that are
// It differs from the :hidden selector (jQuery.expr.pseudos.hidden) in two important ways: // detached or contained within hidden ancestors (gh-2404, gh-2863).
// * A hidden ancestor does not force an element to be classified as hidden. export default function( elem, el ) {
// * Being disconnected from the document does not force an element to be classified as hidden.
// These differences improve the behavior of .toggle() et al. when applied to elements that are
// detached or contained within hidden ancestors (gh-2404, gh-2863).
return function( elem, el ) {
// isHiddenWithinTree might be called from jQuery#filter function; // isHiddenWithinTree might be called from jQuery#filter function;
// in that case, element will be second argument // in that case, element will be second argument
@ -22,5 +17,4 @@ define( [
return elem.style.display === "none" || return elem.style.display === "none" ||
elem.style.display === "" && elem.style.display === "" &&
jQuery.css( elem, "display" ) === "none"; jQuery.css( elem, "display" ) === "none";
}; };
} );

View File

@ -1,7 +1,3 @@
define( [ import pnum from "../../var/pnum.js";
"../../var/pnum"
], function( pnum ) {
"use strict";
return new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); export default new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
} );

View File

@ -1,9 +1,5 @@
define( function() {
"use strict";
// A method for quickly swapping in/out CSS properties to get correct calculations. // A method for quickly swapping in/out CSS properties to get correct calculations.
return function( elem, options, callback ) { export default function( elem, options, callback ) {
var ret, name, var ret, name,
old = {}; old = {};
@ -22,5 +18,3 @@ return function( elem, options, callback ) {
return ret; return ret;
}; };
} );

View File

@ -1,12 +1,8 @@
define( [ import jQuery from "./core.js";
"./core", import access from "./core/access.js";
"./core/access", import camelCase from "./core/camelCase.js";
"./core/camelCase", import dataPriv from "./data/var/dataPriv.js";
"./data/var/dataPriv", import dataUser from "./data/var/dataUser.js";
"./data/var/dataUser"
], function( jQuery, access, camelCase, dataPriv, dataUser ) {
"use strict";
// Implementation Summary // Implementation Summary
// //
@ -176,5 +172,4 @@ jQuery.fn.extend( {
} }
} ); } );
return jQuery; export default jQuery;
} );

View File

@ -1,11 +1,7 @@
define( [ import jQuery from "../core.js";
"../core", import camelCase from "../core/camelCase.js";
"../core/camelCase", import rnothtmlwhite from "../var/rnothtmlwhite.js";
"../var/rnothtmlwhite", import acceptData from "./var/acceptData.js";
"./var/acceptData"
], function( jQuery, camelCase, rnothtmlwhite, acceptData ) {
"use strict";
function Data() { function Data() {
this.expando = jQuery.expando + Data.uid++; this.expando = jQuery.expando + Data.uid++;
@ -158,5 +154,4 @@ Data.prototype = {
} }
}; };
return Data; export default Data;
} );

View File

@ -1,11 +1,7 @@
define( function() {
"use strict";
/** /**
* Determines whether an object can have data * Determines whether an object can have data
*/ */
return function( owner ) { export default function( owner ) {
// Accepts only: // Accepts only:
// - Node // - Node
@ -15,5 +11,3 @@ return function( owner ) {
// - Any // - Any
return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
}; };
} );

View File

@ -1,7 +1,3 @@
define( [ import Data from "../Data.js";
"../Data"
], function( Data ) {
"use strict";
return new Data(); export default new Data();
} );

View File

@ -1,7 +1,3 @@
define( [ import Data from "../Data.js";
"../Data"
], function( Data ) {
"use strict";
return new Data(); export default new Data();
} );

View File

@ -1,10 +1,7 @@
define( [ import jQuery from "./core.js";
"./core", import slice from "./var/slice.js";
"./var/slice",
"./callbacks"
], function( jQuery, slice ) {
"use strict"; import "./callbacks.js";
function Identity( v ) { function Identity( v ) {
return v; return v;
@ -392,5 +389,4 @@ jQuery.extend( {
} }
} ); } );
return jQuery; export default jQuery;
} );

View File

@ -1,9 +1,6 @@
define( [ import jQuery from "../core.js";
"../core",
"../deferred"
], function( jQuery ) {
"use strict"; import "../deferred.js";
// These usually indicate a programmer mistake during development, // These usually indicate a programmer mistake during development,
// warn about them ASAP rather than swallowing them by default. // warn about them ASAP rather than swallowing them by default.
@ -19,5 +16,3 @@ jQuery.Deferred.exceptionHook = function( error, stack ) {
); );
} }
}; };
} );

View File

@ -1,11 +1,8 @@
define( [ import jQuery from "./core.js";
"./core", import slice from "./var/slice.js";
"./var/slice", import trim from "./var/trim.js";
"./var/trim",
"./event/alias"
], function( jQuery, slice, trim ) {
"use strict"; import "./event/alias.js";
jQuery.fn.extend( { jQuery.fn.extend( {
@ -70,4 +67,3 @@ jQuery.holdReady = function( hold ) {
jQuery.trim = function( text ) { jQuery.trim = function( text ) {
return text == null ? "" : trim.call( text ); return text == null ? "" : trim.call( text );
}; };
} );

View File

@ -1,11 +1,8 @@
define( [ import jQuery from "./core.js";
"./core", import access from "./core/access.js";
"./core/access", import isWindow from "./var/isWindow.js";
"./var/isWindow",
"./css"
], function( jQuery, access, isWindow ) {
"use strict"; import "./css.js";
// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
@ -53,5 +50,4 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
} ); } );
} ); } );
return jQuery; export default jQuery;
} );

47
src/effects.js vendored
View File

@ -1,26 +1,21 @@
define( [ import jQuery from "./core.js";
"./core", import document from "./var/document.js";
"./var/document", import rcssNum from "./var/rcssNum.js";
"./var/rcssNum", import rnothtmlwhite from "./var/rnothtmlwhite.js";
"./var/rnothtmlwhite", import cssExpand from "./css/var/cssExpand.js";
"./css/var/cssExpand", import isHiddenWithinTree from "./css/var/isHiddenWithinTree.js";
"./css/var/isHiddenWithinTree", import adjustCSS from "./css/adjustCSS.js";
"./css/adjustCSS", import cssCamelCase from "./css/cssCamelCase.js";
"./css/cssCamelCase", import dataPriv from "./data/var/dataPriv.js";
"./data/var/dataPriv", import showHide from "./css/showHide.js";
"./css/showHide",
"./core/init", import "./core/init.js";
"./queue", import "./queue.js";
"./deferred", import "./deferred.js";
"./traversing", import "./traversing.js";
"./manipulation", import "./manipulation.js";
"./css", import "./css.js";
"./effects/Tween" import "./effects/Tween.js";
], function( jQuery, document, rcssNum, rnothtmlwhite, cssExpand,
isHiddenWithinTree, adjustCSS, cssCamelCase, dataPriv, showHide ) {
"use strict";
var var
fxNow, inProgress, fxNow, inProgress,
@ -225,12 +220,9 @@ function defaultPrefilter( elem, props, opts ) {
showHide( [ elem ], true ); showHide( [ elem ], true );
} }
/* eslint-disable no-loop-func */ // eslint-disable-next-line no-loop-func
anim.done( function() { anim.done( function() {
/* eslint-enable no-loop-func */
// The final step of a "hide" animation is actually hiding the element // The final step of a "hide" animation is actually hiding the element
if ( !hidden ) { if ( !hidden ) {
showHide( [ elem ] ); showHide( [ elem ] );
@ -693,5 +685,4 @@ jQuery.fx.speeds = {
_default: 400 _default: 400
}; };
return jQuery; export default jQuery;
} );

View File

@ -1,12 +1,8 @@
define( [ import jQuery from "../core.js";
"../core", import isAutoPx from "../css/isAutoPx.js";
"../css/isAutoPx", import finalPropName from "../css/finalPropName.js";
"../css/finalPropName",
"../css" import "../css.js";
], function( jQuery, isAutoPx, finalPropName ) {
"use strict";
function Tween( elem, options, prop, end, easing ) { function Tween( elem, options, prop, end, easing ) {
return new Tween.prototype.init( elem, options, prop, end, easing ); return new Tween.prototype.init( elem, options, prop, end, easing );
@ -112,5 +108,3 @@ jQuery.fx = Tween.prototype.init;
// Back compat <1.8 extension point // Back compat <1.8 extension point
jQuery.fx.step = {}; jQuery.fx.step = {};
} );

View File

@ -1,15 +1,10 @@
define( [ import jQuery from "../core.js";
"../core",
"../selector",
"../effects"
], function( jQuery ) {
"use strict"; import "../selector.js";
import "../effects.js";
jQuery.expr.pseudos.animated = function( elem ) { jQuery.expr.pseudos.animated = function( elem ) {
return jQuery.grep( jQuery.timers, function( fn ) { return jQuery.grep( jQuery.timers, function( fn ) {
return elem === fn.elem; return elem === fn.elem;
} ).length; } ).length;
}; };
} );

View File

@ -1,19 +1,14 @@
define( [ import jQuery from "./core.js";
"./core", import document from "./var/document.js";
"./var/document", import documentElement from "./var/documentElement.js";
"./var/documentElement", import rnothtmlwhite from "./var/rnothtmlwhite.js";
"./var/rnothtmlwhite", import rcheckableType from "./var/rcheckableType.js";
"./var/rcheckableType", import slice from "./var/slice.js";
"./var/slice", import dataPriv from "./data/var/dataPriv.js";
"./data/var/dataPriv", import nodeName from "./core/nodeName.js";
"./core/nodeName",
"./core/init", import "./core/init.js";
"./selector" import "./selector.js";
], function( jQuery, document, documentElement, rnothtmlwhite,
rcheckableType, slice, dataPriv, nodeName ) {
"use strict";
var var
rkeyEvent = /^key/, rkeyEvent = /^key/,
@ -857,5 +852,4 @@ jQuery.fn.extend( {
} }
} ); } );
return jQuery; export default jQuery;
} );

View File

@ -1,9 +1,6 @@
define( [ import jQuery from "../core.js";
"../core",
"../event"
], function( jQuery ) {
"use strict"; import "../event.js";
// Attach a bunch of functions for handling common AJAX events // Attach a bunch of functions for handling common AJAX events
jQuery.each( [ jQuery.each( [
@ -18,5 +15,3 @@ jQuery.each( [
return this.on( type, fn ); return this.on( type, fn );
}; };
} ); } );
} );

View File

@ -1,11 +1,7 @@
define( [ import jQuery from "../core.js";
"../core",
"../event", import "../event.js";
"./trigger" import "./trigger.js";
], function( jQuery ) {
"use strict";
jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
@ -25,5 +21,3 @@ jQuery.fn.extend( {
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
} }
} ); } );
} );

View File

@ -1,14 +1,11 @@
define( [ import jQuery from "../core.js";
"../core", import document from "../var/document.js";
"../var/document", import dataPriv from "../data/var/dataPriv.js";
"../data/var/dataPriv", import acceptData from "../data/var/acceptData.js";
"../data/var/acceptData", import hasOwn from "../var/hasOwn.js";
"../var/hasOwn", import isWindow from "../var/isWindow.js";
"../var/isWindow",
"../event"
], function( jQuery, document, dataPriv, acceptData, hasOwn, isWindow ) {
"use strict"; import "../event.js";
var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
stopPropagationCallback = function( e ) { stopPropagationCallback = function( e ) {
@ -194,5 +191,4 @@ jQuery.fn.extend( {
} }
} ); } );
return jQuery; export default jQuery;
} );

View File

@ -1,8 +1,4 @@
define( [ import jQuery from "../core.js";
"../core"
], function( jQuery ) {
"use strict";
// Register as a named AMD module, since jQuery can be concatenated with other // Register as a named AMD module, since jQuery can be concatenated with other
// files that may use define, but not via a proper concatenation script that // files that may use define, but not via a proper concatenation script that
@ -22,5 +18,3 @@ if ( typeof define === "function" && define.amd ) {
return jQuery; return jQuery;
} ); } );
} }
} );

View File

@ -1,8 +1,4 @@
define( [ import jQuery from "../core.js";
"../core"
], function( jQuery, noGlobal ) {
"use strict";
var var
@ -27,8 +23,6 @@ jQuery.noConflict = function( deep ) {
// Expose jQuery and $ identifiers, even in AMD // Expose jQuery and $ identifiers, even in AMD
// (#7102#comment:10, https://github.com/jquery/jquery/pull/557) // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
// and CommonJS for browser emulators (#13566) // and CommonJS for browser emulators (#13566)
if ( !noGlobal ) { if ( typeof noGlobal === "undefined" ) {
window.jQuery = window.$ = jQuery; window.jQuery = window.$ = jQuery;
} }
} );

70
src/jquery.js vendored
View File

@ -1,39 +1,35 @@
define( [ import jQuery from "./core.js";
"./core",
"./selector",
"./traversing",
"./callbacks",
"./deferred",
"./deferred/exceptionHook",
"./core/ready",
"./data",
"./queue",
"./queue/delay",
"./attributes",
"./event",
"./manipulation",
"./manipulation/_evalUrl",
"./wrap",
"./css",
"./css/hiddenVisibleSelectors",
"./serialize",
"./ajax",
"./ajax/xhr",
"./ajax/script",
"./ajax/jsonp",
"./ajax/load",
"./event/ajax",
"./effects",
"./effects/animatedSelector",
"./offset",
"./dimensions",
"./deprecated",
"./exports/amd",
"./exports/global"
], function( jQuery ) {
"use strict"; import "./selector.js";
import "./traversing.js";
import "./callbacks.js";
import "./deferred.js";
import "./deferred/exceptionHook.js";
import "./core/ready.js";
import "./data.js";
import "./queue.js";
import "./queue/delay.js";
import "./attributes.js";
import "./event.js";
import "./manipulation.js";
import "./manipulation/_evalUrl.js";
import "./wrap.js";
import "./css.js";
import "./css/hiddenVisibleSelectors.js";
import "./serialize.js";
import "./ajax.js";
import "./ajax/xhr.js";
import "./ajax/script.js";
import "./ajax/jsonp.js";
import "./core/parseHTML.js";
import "./ajax/load.js";
import "./event/ajax.js";
import "./effects.js";
import "./effects/animatedSelector.js";
import "./offset.js";
import "./dimensions.js";
import "./deprecated.js";
import "./exports/amd.js";
import "./exports/global.js";
return jQuery; export default jQuery;
} );

View File

@ -1,32 +1,25 @@
define( [ import jQuery from "./core.js";
"./core", import isAttached from "./core/isAttached.js";
"./core/isAttached", import flat from "./var/flat.js";
"./var/flat", import isIE from "./var/isIE.js";
"./var/isIE", import push from "./var/push.js";
"./var/push", import access from "./core/access.js";
"./core/access", import rtagName from "./manipulation/var/rtagName.js";
"./manipulation/var/rtagName", import rscriptType from "./manipulation/var/rscriptType.js";
"./manipulation/var/rscriptType", import wrapMap from "./manipulation/wrapMap.js";
"./manipulation/wrapMap", import getAll from "./manipulation/getAll.js";
"./manipulation/getAll", import setGlobalEval from "./manipulation/setGlobalEval.js";
"./manipulation/setGlobalEval", import buildFragment from "./manipulation/buildFragment.js";
"./manipulation/buildFragment", import dataPriv from "./data/var/dataPriv.js";
import dataUser from "./data/var/dataUser.js";
import acceptData from "./data/var/acceptData.js";
import DOMEval from "./core/DOMEval.js";
import nodeName from "./core/nodeName.js";
"./data/var/dataPriv", import "./core/init.js";
"./data/var/dataUser", import "./traversing.js";
"./data/var/acceptData", import "./selector.js";
"./core/DOMEval", import "./event.js";
"./core/nodeName",
"./core/init",
"./traversing",
"./selector",
"./event"
], function( jQuery, isAttached, flat, isIE, push, access, rtagName,
rscriptType, wrapMap, getAll, setGlobalEval, buildFragment,
dataPriv, dataUser, acceptData, DOMEval, nodeName ) {
"use strict";
var var
@ -458,5 +451,4 @@ jQuery.each( {
}; };
} ); } );
return jQuery; export default jQuery;
} );

View File

@ -1,8 +1,4 @@
define( [ import jQuery from "../ajax.js";
"../ajax"
], function( jQuery ) {
"use strict";
jQuery._evalUrl = function( url, options ) { jQuery._evalUrl = function( url, options ) {
return jQuery.ajax( { return jQuery.ajax( {
@ -27,6 +23,4 @@ jQuery._evalUrl = function( url, options ) {
} ); } );
}; };
return jQuery._evalUrl; export default jQuery._evalUrl;
} );

View File

@ -1,15 +1,11 @@
define( [ import jQuery from "../core.js";
"../core", import toType from "../core/toType.js";
"../core/toType", import isAttached from "../core/isAttached.js";
"../core/isAttached", import rtagName from "./var/rtagName.js";
"./var/rtagName", import rscriptType from "./var/rscriptType.js";
"./var/rscriptType", import wrapMap from "./wrapMap.js";
"./wrapMap", import getAll from "./getAll.js";
"./getAll", import setGlobalEval from "./setGlobalEval.js";
"./setGlobalEval"
], function( jQuery, toType, isAttached, rtagName, rscriptType, wrapMap, getAll, setGlobalEval ) {
"use strict";
var rhtml = /<|&#?\w+;/; var rhtml = /<|&#?\w+;/;
@ -97,5 +93,4 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
return fragment; return fragment;
} }
return buildFragment; export default buildFragment;
} );

View File

@ -1,9 +1,5 @@
define( [ import jQuery from "../core.js";
"../core", import nodeName from "../core/nodeName.js";
"../core/nodeName"
], function( jQuery, nodeName ) {
"use strict";
function getAll( context, tag ) { function getAll( context, tag ) {
@ -28,5 +24,4 @@ function getAll( context, tag ) {
return ret; return ret;
} }
return getAll; export default getAll;
} );

View File

@ -1,8 +1,4 @@
define( [ import dataPriv from "../data/var/dataPriv.js";
"../data/var/dataPriv"
], function( dataPriv ) {
"use strict";
// Mark scripts as having already been evaluated // Mark scripts as having already been evaluated
function setGlobalEval( elems, refElements ) { function setGlobalEval( elems, refElements ) {
@ -18,5 +14,4 @@ function setGlobalEval( elems, refElements ) {
} }
} }
return setGlobalEval; export default setGlobalEval;
} );

View File

@ -1,5 +1 @@
define( function() { export default ( /^$|^module$|\/(?:java|ecma)script/i );
"use strict";
return ( /^$|^module$|\/(?:java|ecma)script/i );
} );

View File

@ -1,8 +1,4 @@
define( function() { // rtagName captures the name from the first start tag in a string of HTML
"use strict"; // https://html.spec.whatwg.org/multipage/syntax.html#tag-open-state
// https://html.spec.whatwg.org/multipage/syntax.html#tag-name-state
// rtagName captures the name from the first start tag in a string of HTML export default ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
// https://html.spec.whatwg.org/multipage/syntax.html#tag-open-state
// https://html.spec.whatwg.org/multipage/syntax.html#tag-name-state
return ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
} );

View File

@ -1,7 +1,3 @@
define( function() {
"use strict";
// We have to close these tags to support XHTML (#13200) // We have to close these tags to support XHTML (#13200)
var wrapMap = { var wrapMap = {
@ -21,5 +17,4 @@ var wrapMap = {
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
wrapMap.th = wrapMap.td; wrapMap.th = wrapMap.td;
return wrapMap; export default wrapMap;
} );

View File

@ -1,14 +1,11 @@
define( [ import jQuery from "./core.js";
"./core", import access from "./core/access.js";
"./core/access", import documentElement from "./var/documentElement.js";
"./var/documentElement", import isWindow from "./var/isWindow.js";
"./var/isWindow",
"./core/init",
"./css",
"./selector" // contains
], function( jQuery, access, documentElement, isWindow ) {
"use strict"; import "./core/init.js";
import "./css.js";
import "./selector.js"; // contains
jQuery.offset = { jQuery.offset = {
setOffset: function( elem, options, i ) { setOffset: function( elem, options, i ) {
@ -201,5 +198,4 @@ jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function(
}; };
} ); } );
return jQuery; export default jQuery;
} );

View File

@ -1,11 +1,8 @@
define( [ import jQuery from "./core.js";
"./core", import dataPriv from "./data/var/dataPriv.js";
"./data/var/dataPriv",
"./deferred",
"./callbacks"
], function( jQuery, dataPriv ) {
"use strict"; import "./deferred.js";
import "./callbacks.js";
jQuery.extend( { jQuery.extend( {
queue: function( elem, type, data ) { queue: function( elem, type, data ) {
@ -141,5 +138,4 @@ jQuery.fn.extend( {
} }
} ); } );
return jQuery; export default jQuery;
} );

View File

@ -1,10 +1,7 @@
define( [ import jQuery from "../core.js";
"../core",
"../queue",
"../effects" // Delay is optional because of this dependency
], function( jQuery ) {
"use strict"; import "../queue.js";
import "../effects.js"; // Delay is optional because of this dependency
// Based off of the plugin by Clint Helfers, with permission. // Based off of the plugin by Clint Helfers, with permission.
// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
@ -19,6 +16,3 @@ jQuery.fn.delay = function( time, type ) {
}; };
} ); } );
}; };
return jQuery.fn.delay;
} );

View File

@ -1,22 +1,17 @@
define( [ import jQuery from "./core.js";
"./core", import nodeName from "./core/nodeName.js";
"./core/nodeName", import document from "./var/document.js";
"./var/document", import documentElement from "./var/documentElement.js";
"./var/documentElement", import indexOf from "./var/indexOf.js";
"./var/indexOf", import pop from "./var/pop.js";
"./var/pop", import push from "./var/push.js";
"./var/push", import rbuggyQSA from "./selector/rbuggyQSA.js";
"./selector/rbuggyQSA", import support from "./selector/support.js";
"./selector/support",
// The following utils are attached directly to the jQuery object. // The following utils are attached directly to the jQuery object.
"./selector/contains", import "./selector/contains.js";
"./selector/escapeSelector", import "./selector/escapeSelector.js";
"./selector/uniqueSort" import "./selector/uniqueSort.js";
], function( jQuery, nodeName, document, documentElement, indexOf, pop, push,
rbuggyQSA, support ) {
"use strict";
var preferredDoc = document, var preferredDoc = document,
matches = documentElement.matches || documentElement.msMatchesSelector; matches = documentElement.matches || documentElement.msMatchesSelector;
@ -1642,5 +1637,3 @@ setDocument();
jQuery.find = find; jQuery.find = find;
} )(); } )();
} );

View File

@ -1,8 +1,4 @@
define( [ import jQuery from "../core.js";
"../core"
], function( jQuery ) {
"use strict";
// Note: an element does not contain itself // Note: an element does not contain itself
jQuery.contains = function( a, b ) { jQuery.contains = function( a, b ) {
@ -18,5 +14,3 @@ jQuery.contains = function( a, b ) {
a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
) ); ) );
}; };
} );

View File

@ -1,8 +1,4 @@
define( [ import jQuery from "../core.js";
"../core"
], function( jQuery ) {
"use strict";
// CSS string/identifier serialization // CSS string/identifier serialization
// https://drafts.csswg.org/cssom/#common-serializing-idioms // https://drafts.csswg.org/cssom/#common-serializing-idioms
@ -27,5 +23,3 @@ function fcssescape( ch, asCodePoint ) {
jQuery.escapeSelector = function( sel ) { jQuery.escapeSelector = function( sel ) {
return ( sel + "" ).replace( rcssescape, fcssescape ); return ( sel + "" ).replace( rcssescape, fcssescape );
}; };
} );

View File

@ -1,9 +1,5 @@
define( [ import document from "../var/document.js";
"../var/document", import isIE from "../var/isIE.js";
"../var/isIE"
], function( document, isIE ) {
"use strict";
var rbuggyQSA = [], var rbuggyQSA = [],
testEl = document.createElement( "div" ); testEl = document.createElement( "div" );
@ -25,6 +21,4 @@ if ( isIE ) {
rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
return rbuggyQSA; export default rbuggyQSA;
} );

View File

@ -1,9 +1,5 @@
define( [ import document from "../var/document.js";
"../var/document", import support from "../var/support.js";
"../var/support"
], function( document, support ) {
"use strict";
// Support: IE 9 - 11+, Edge 12 - 18+ // Support: IE 9 - 11+, Edge 12 - 18+
// IE/Edge don't support the :scope pseudo-class. // IE/Edge don't support the :scope pseudo-class.
@ -12,6 +8,4 @@ try {
support.scope = true; support.scope = true;
} catch ( e ) {} } catch ( e ) {}
return support; export default support;
} );

View File

@ -1,10 +1,6 @@
define( [ import jQuery from "../core.js";
"../core", import document from "../var/document.js";
"../var/document", import sort from "../var/sort.js";
"../var/sort"
], function( jQuery, document, sort ) {
"use strict";
var hasDuplicate; var hasDuplicate;
@ -90,5 +86,3 @@ jQuery.uniqueSort = function( results ) {
return results; return results;
}; };
} );

View File

@ -1,13 +1,10 @@
define( [ import jQuery from "./core.js";
"./core", import toType from "./core/toType.js";
"./core/toType", import rcheckableType from "./var/rcheckableType.js";
"./var/rcheckableType",
"./core/init",
"./traversing", // filter
"./attributes/prop"
], function( jQuery, toType, rcheckableType ) {
"use strict"; import "./core/init.js";
import "./traversing.js"; // filter
import "./attributes/prop.js";
var var
rbracket = /\[\]$/, rbracket = /\[\]$/,
@ -131,5 +128,4 @@ jQuery.fn.extend( {
} }
} ); } );
return jQuery; export default jQuery;
} );

View File

@ -1,18 +1,14 @@
define( [ import jQuery from "./core.js";
"./core", import getProto from "./var/getProto.js";
"./var/getProto", import indexOf from "./var/indexOf.js";
"./var/indexOf", import dir from "./traversing/var/dir.js";
"./traversing/var/dir", import siblings from "./traversing/var/siblings.js";
"./traversing/var/siblings", import rneedsContext from "./traversing/var/rneedsContext.js";
"./traversing/var/rneedsContext", import nodeName from "./core/nodeName.js";
"./core/nodeName",
"./core/init", import "./core/init.js";
"./traversing/findFilter", import "./traversing/findFilter.js";
"./selector" import "./selector.js";
], function( jQuery, getProto, indexOf, dir, siblings, rneedsContext, nodeName ) {
"use strict";
var rparentsprev = /^(?:parents|prev(?:Until|All))/, var rparentsprev = /^(?:parents|prev(?:Until|All))/,
@ -194,5 +190,4 @@ jQuery.each( {
}; };
} ); } );
return jQuery; export default jQuery;
} );

View File

@ -1,11 +1,8 @@
define( [ import jQuery from "../core.js";
"../core", import indexOf from "../var/indexOf.js";
"../var/indexOf", import rneedsContext from "./var/rneedsContext.js";
"./var/rneedsContext",
"../selector"
], function( jQuery, indexOf, rneedsContext ) {
"use strict"; import "../selector.js";
// Implement the identical functionality for filter and not // Implement the identical functionality for filter and not
function winnow( elements, qualifier, not ) { function winnow( elements, qualifier, not ) {
@ -92,5 +89,3 @@ jQuery.fn.extend( {
).length; ).length;
} }
} ); } );
} );

View File

@ -1,10 +1,6 @@
define( [ import jQuery from "../../core.js";
"../../core"
], function( jQuery ) {
"use strict"; export default function( elem, dir, until ) {
return function( elem, dir, until ) {
var matched = [], var matched = [],
truncate = until !== undefined; truncate = until !== undefined;
@ -18,5 +14,3 @@ return function( elem, dir, until ) {
} }
return matched; return matched;
}; };
} );

View File

@ -1,8 +1,5 @@
define( [ import jQuery from "../../core.js";
"../../core",
"../../selector"
], function( jQuery ) {
"use strict";
return jQuery.expr.match.needsContext; import "../../selector.js";
} );
export default jQuery.expr.match.needsContext;

View File

@ -1,8 +1,4 @@
define( function() { export default function( n, elem ) {
"use strict";
return function( n, elem ) {
var matched = []; var matched = [];
for ( ; n; n = n.nextSibling ) { for ( ; n; n = n.nextSibling ) {
@ -13,5 +9,3 @@ return function( n, elem ) {
return matched; return matched;
}; };
} );

View File

@ -1,7 +1,3 @@
define( [ import fnToString from "./fnToString.js";
"./fnToString"
], function( fnToString ) {
"use strict";
return fnToString.call( Object ); export default fnToString.call( Object );
} );

View File

@ -1,5 +1 @@
define( function() { export default [];
"use strict";
return [];
} );

View File

@ -1,6 +1,2 @@
define( function() { // [[Class]] -> type pairs
"use strict"; export default {};
// [[Class]] -> type pairs
return {};
} );

View File

@ -1,5 +1 @@
define( function() { export default window.document;
"use strict";
return window.document;
} );

View File

@ -1,7 +1,3 @@
define( [ import document from "./document.js";
"./document"
], function( document ) {
"use strict";
return document.documentElement; export default document.documentElement;
} );

Some files were not shown because too many files have changed in this diff Show More