diff --git a/build/tasks/build.js b/build/tasks/build.js index 79498d012..3fc37da8a 100644 --- a/build/tasks/build.js +++ b/build/tasks/build.js @@ -221,7 +221,7 @@ module.exports = function( grunt ) { // Remove the jQuery export from the entry file, we'll use our own // custom wrapper. setOverride( inputRollupOptions.input, - read( inputFileName ).replace( /\n*export default jQuery;\n*/, "\n" ) ); + read( inputFileName ).replace( /\n*export \{ jQuery, jQuery as \$ };\n*/, "\n" ) ); // Replace exports/global with a noop noConflict if ( excluded.includes( "exports/global" ) ) { diff --git a/src/ajax.js b/src/ajax.js index db4e30195..ab96c3625 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -1,9 +1,9 @@ -import jQuery from "./core.js"; -import document from "./var/document.js"; -import rnothtmlwhite from "./var/rnothtmlwhite.js"; -import location from "./ajax/var/location.js"; -import nonce from "./ajax/var/nonce.js"; -import rquery from "./ajax/var/rquery.js"; +import { jQuery } from "./core.js"; +import { document } from "./var/document.js"; +import { rnothtmlwhite } from "./var/rnothtmlwhite.js"; +import { location } from "./ajax/var/location.js"; +import { nonce } from "./ajax/var/nonce.js"; +import { rquery } from "./ajax/var/rquery.js"; import "./core/init.js"; import "./core/parseXML.js"; @@ -874,4 +874,4 @@ jQuery.ajaxPrefilter( function( s ) { } } ); -export default jQuery; +export { jQuery, jQuery as $ }; diff --git a/src/ajax/binary.js b/src/ajax/binary.js index f629c52f7..96fc5a469 100644 --- a/src/ajax/binary.js +++ b/src/ajax/binary.js @@ -1,4 +1,4 @@ -import jQuery from "../core.js"; +import { jQuery } from "../core.js"; import "../ajax.js"; diff --git a/src/ajax/jsonp.js b/src/ajax/jsonp.js index e115fdafc..add5a5c9c 100644 --- a/src/ajax/jsonp.js +++ b/src/ajax/jsonp.js @@ -1,6 +1,6 @@ -import jQuery from "../core.js"; -import nonce from "./var/nonce.js"; -import rquery from "./var/rquery.js"; +import { jQuery } from "../core.js"; +import { nonce } from "./var/nonce.js"; +import { rquery } from "./var/rquery.js"; import "../ajax.js"; diff --git a/src/ajax/load.js b/src/ajax/load.js index 9a91b990b..044dc09dd 100644 --- a/src/ajax/load.js +++ b/src/ajax/load.js @@ -1,5 +1,5 @@ -import jQuery from "../core.js"; -import stripAndCollapse from "../core/stripAndCollapse.js"; +import { jQuery } from "../core.js"; +import { stripAndCollapse } from "../core/stripAndCollapse.js"; import "../core/parseHTML.js"; import "../ajax.js"; diff --git a/src/ajax/script.js b/src/ajax/script.js index aa8ddb4c5..3c88c1af3 100644 --- a/src/ajax/script.js +++ b/src/ajax/script.js @@ -1,5 +1,5 @@ -import jQuery from "../core.js"; -import document from "../var/document.js"; +import { jQuery } from "../core.js"; +import { document } from "../var/document.js"; import "../ajax.js"; diff --git a/src/ajax/var/location.js b/src/ajax/var/location.js index 78e6f07b3..316b19845 100644 --- a/src/ajax/var/location.js +++ b/src/ajax/var/location.js @@ -1 +1 @@ -export default window.location; +export var location = window.location; diff --git a/src/ajax/var/nonce.js b/src/ajax/var/nonce.js index b0070c699..9b3d3e83a 100644 --- a/src/ajax/var/nonce.js +++ b/src/ajax/var/nonce.js @@ -1 +1 @@ -export default { guid: Date.now() }; +export var nonce = { guid: Date.now() }; diff --git a/src/ajax/var/rquery.js b/src/ajax/var/rquery.js index f18f87661..e694e8255 100644 --- a/src/ajax/var/rquery.js +++ b/src/ajax/var/rquery.js @@ -1 +1 @@ -export default ( /\?/ ); +export var rquery = /\?/; diff --git a/src/ajax/xhr.js b/src/ajax/xhr.js index 528a5c748..c7b057a6e 100644 --- a/src/ajax/xhr.js +++ b/src/ajax/xhr.js @@ -1,4 +1,4 @@ -import jQuery from "../core.js"; +import { jQuery } from "../core.js"; import "../ajax.js"; diff --git a/src/attributes.js b/src/attributes.js index 646107adc..278d51306 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -1,4 +1,4 @@ -import jQuery from "./core.js"; +import { jQuery } from "./core.js"; import "./attributes/attr.js"; import "./attributes/prop.js"; @@ -6,4 +6,4 @@ import "./attributes/classes.js"; import "./attributes/val.js"; // Return jQuery for attributes-only inclusion -export default jQuery; +export { jQuery, jQuery as $ }; diff --git a/src/attributes/attr.js b/src/attributes/attr.js index d6d497735..fb6c3bd7b 100644 --- a/src/attributes/attr.js +++ b/src/attributes/attr.js @@ -1,8 +1,8 @@ -import jQuery from "../core.js"; -import access from "../core/access.js"; -import nodeName from "../core/nodeName.js"; -import rnothtmlwhite from "../var/rnothtmlwhite.js"; -import isIE from "../var/isIE.js"; +import { jQuery } from "../core.js"; +import { access } from "../core/access.js"; +import { nodeName } from "../core/nodeName.js"; +import { rnothtmlwhite } from "../var/rnothtmlwhite.js"; +import { isIE } from "../var/isIE.js"; import "../selector.js"; diff --git a/src/attributes/classes.js b/src/attributes/classes.js index 5e64ea2ae..fa2b7d9cd 100644 --- a/src/attributes/classes.js +++ b/src/attributes/classes.js @@ -1,6 +1,6 @@ -import jQuery from "../core.js"; -import stripAndCollapse from "../core/stripAndCollapse.js"; -import rnothtmlwhite from "../var/rnothtmlwhite.js"; +import { jQuery } from "../core.js"; +import { stripAndCollapse } from "../core/stripAndCollapse.js"; +import { rnothtmlwhite } from "../var/rnothtmlwhite.js"; import "../core/init.js"; diff --git a/src/attributes/prop.js b/src/attributes/prop.js index 3c180593f..f889e5373 100644 --- a/src/attributes/prop.js +++ b/src/attributes/prop.js @@ -1,6 +1,6 @@ -import jQuery from "../core.js"; -import access from "../core/access.js"; -import isIE from "../var/isIE.js"; +import { jQuery } from "../core.js"; +import { access } from "../core/access.js"; +import { isIE } from "../var/isIE.js"; import "../selector.js"; diff --git a/src/attributes/val.js b/src/attributes/val.js index 536ed88a4..34d1669fc 100644 --- a/src/attributes/val.js +++ b/src/attributes/val.js @@ -1,7 +1,7 @@ -import jQuery from "../core.js"; -import isIE from "../var/isIE.js"; -import stripAndCollapse from "../core/stripAndCollapse.js"; -import nodeName from "../core/nodeName.js"; +import { jQuery } from "../core.js"; +import { isIE } from "../var/isIE.js"; +import { stripAndCollapse } from "../core/stripAndCollapse.js"; +import { nodeName } from "../core/nodeName.js"; import "../core/init.js"; diff --git a/src/callbacks.js b/src/callbacks.js index 19b3d7c1c..e4f05e798 100644 --- a/src/callbacks.js +++ b/src/callbacks.js @@ -1,6 +1,6 @@ -import jQuery from "./core.js"; -import toType from "./core/toType.js"; -import rnothtmlwhite from "./var/rnothtmlwhite.js"; +import { jQuery } from "./core.js"; +import { toType } from "./core/toType.js"; +import { rnothtmlwhite } from "./var/rnothtmlwhite.js"; // Convert String-formatted options into Object-formatted ones function createOptions( options ) { @@ -227,4 +227,4 @@ jQuery.Callbacks = function( options ) { return self; }; -export default jQuery; +export { jQuery, jQuery as $ }; diff --git a/src/core.js b/src/core.js index 8ed56b7e8..c79455507 100644 --- a/src/core.js +++ b/src/core.js @@ -1,17 +1,17 @@ -import arr from "./var/arr.js"; -import getProto from "./var/getProto.js"; -import slice from "./var/slice.js"; -import flat from "./var/flat.js"; -import push from "./var/push.js"; -import indexOf from "./var/indexOf.js"; -import class2type from "./var/class2type.js"; -import toString from "./var/toString.js"; -import hasOwn from "./var/hasOwn.js"; -import fnToString from "./var/fnToString.js"; -import ObjectFunctionString from "./var/ObjectFunctionString.js"; -import support from "./var/support.js"; -import isArrayLike from "./core/isArrayLike.js"; -import DOMEval from "./core/DOMEval.js"; +import { arr } from "./var/arr.js"; +import { getProto } from "./var/getProto.js"; +import { slice } from "./var/slice.js"; +import { flat } from "./var/flat.js"; +import { push } from "./var/push.js"; +import { indexOf } from "./var/indexOf.js"; +import { class2type } from "./var/class2type.js"; +import { toString } from "./var/toString.js"; +import { hasOwn } from "./var/hasOwn.js"; +import { fnToString } from "./var/fnToString.js"; +import { ObjectFunctionString } from "./var/ObjectFunctionString.js"; +import { support } from "./var/support.js"; +import { isArrayLike } from "./core/isArrayLike.js"; +import { DOMEval } from "./core/DOMEval.js"; var version = "@VERSION", @@ -416,4 +416,4 @@ jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symb class2type[ "[object " + name + "]" ] = name.toLowerCase(); } ); -export default jQuery; +export { jQuery, jQuery as $ }; diff --git a/src/core/DOMEval.js b/src/core/DOMEval.js index 059464188..806f29ebe 100644 --- a/src/core/DOMEval.js +++ b/src/core/DOMEval.js @@ -1,4 +1,4 @@ -import document from "../var/document.js"; +import { document } from "../var/document.js"; var preservedScriptAttributes = { type: true, @@ -7,7 +7,7 @@ var preservedScriptAttributes = { noModule: true }; -function DOMEval( code, node, doc ) { +export function DOMEval( code, node, doc ) { doc = doc || document; var i, @@ -23,5 +23,3 @@ function DOMEval( code, node, doc ) { } doc.head.appendChild( script ).parentNode.removeChild( script ); } - -export default DOMEval; diff --git a/src/core/access.js b/src/core/access.js index 6b717b9ba..86bac126c 100644 --- a/src/core/access.js +++ b/src/core/access.js @@ -1,9 +1,9 @@ -import jQuery from "../core.js"; -import toType from "../core/toType.js"; +import { jQuery } from "../core.js"; +import { toType } from "../core/toType.js"; // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function -var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { +export function access( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, len = elems.length, bulk = key == null; @@ -60,6 +60,4 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { } return len ? fn( elems[ 0 ], key ) : emptyGet; -}; - -export default access; +} diff --git a/src/core/camelCase.js b/src/core/camelCase.js index f12a2c67d..dca86fc33 100644 --- a/src/core/camelCase.js +++ b/src/core/camelCase.js @@ -7,8 +7,6 @@ function fcamelCase( _all, letter ) { } // Convert dashed to camelCase -function camelCase( string ) { +export function camelCase( string ) { return string.replace( rdashAlpha, fcamelCase ); } - -export default camelCase; diff --git a/src/core/init.js b/src/core/init.js index 4ac091054..9c9454726 100644 --- a/src/core/init.js +++ b/src/core/init.js @@ -1,8 +1,8 @@ // Initialize a jQuery object -import jQuery from "../core.js"; -import document from "../var/document.js"; -import rsingleTag from "./var/rsingleTag.js"; -import isObviousHtml from "./isObviousHtml.js"; +import { jQuery } from "../core.js"; +import { document } from "../var/document.js"; +import { rsingleTag } from "./var/rsingleTag.js"; +import { isObviousHtml } from "./isObviousHtml.js"; import "../traversing/findFilter.js"; diff --git a/src/core/isArrayLike.js b/src/core/isArrayLike.js index 988c483d3..bc24b32f4 100644 --- a/src/core/isArrayLike.js +++ b/src/core/isArrayLike.js @@ -1,7 +1,7 @@ -import toType from "./toType.js"; -import isWindow from "../var/isWindow.js"; +import { toType } from "./toType.js"; +import { isWindow } from "../var/isWindow.js"; -function isArrayLike( obj ) { +export function isArrayLike( obj ) { var length = !!obj && obj.length, type = toType( obj ); @@ -13,5 +13,3 @@ function isArrayLike( obj ) { return type === "array" || length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj; } - -export default isArrayLike; diff --git a/src/core/isAttached.js b/src/core/isAttached.js index 72c7bbda4..12a60ee92 100644 --- a/src/core/isAttached.js +++ b/src/core/isAttached.js @@ -1,5 +1,5 @@ -import jQuery from "../core.js"; -import documentElement from "../var/documentElement.js"; +import { jQuery } from "../core.js"; +import { documentElement } from "../var/documentElement.js"; var isAttached = function( elem ) { return jQuery.contains( elem.ownerDocument, elem ) || @@ -16,4 +16,4 @@ if ( !documentElement.getRootNode ) { }; } -export default isAttached; +export { isAttached }; diff --git a/src/core/isObviousHtml.js b/src/core/isObviousHtml.js index 976f81219..715b47c1b 100644 --- a/src/core/isObviousHtml.js +++ b/src/core/isObviousHtml.js @@ -1,7 +1,5 @@ -function isObviousHtml( input ) { +export function isObviousHtml( input ) { return input[ 0 ] === "<" && input[ input.length - 1 ] === ">" && input.length >= 3; } - -export default isObviousHtml; diff --git a/src/core/nodeName.js b/src/core/nodeName.js index ac90c6075..014672b87 100644 --- a/src/core/nodeName.js +++ b/src/core/nodeName.js @@ -1,7 +1,3 @@ -function nodeName( elem, name ) { - +export function nodeName( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - } - -export default nodeName; diff --git a/src/core/parseHTML.js b/src/core/parseHTML.js index b522a5f7b..6de02e8b6 100644 --- a/src/core/parseHTML.js +++ b/src/core/parseHTML.js @@ -1,8 +1,8 @@ -import jQuery from "../core.js"; -import document from "../var/document.js"; -import rsingleTag from "./var/rsingleTag.js"; -import buildFragment from "../manipulation/buildFragment.js"; -import isObviousHtml from "./isObviousHtml.js"; +import { jQuery } from "../core.js"; +import { document } from "../var/document.js"; +import { rsingleTag } from "./var/rsingleTag.js"; +import { buildFragment } from "../manipulation/buildFragment.js"; +import { isObviousHtml } from "./isObviousHtml.js"; // Argument "data" should be string of html or a TrustedHTML wrapper of obvious HTML // context (optional): If specified, the fragment will be created in this context, diff --git a/src/core/parseXML.js b/src/core/parseXML.js index 482545aaf..fa1b94c00 100644 --- a/src/core/parseXML.js +++ b/src/core/parseXML.js @@ -1,4 +1,4 @@ -import jQuery from "../core.js"; +import { jQuery } from "../core.js"; // Cross-browser xml parsing jQuery.parseXML = function( data ) { diff --git a/src/core/ready-no-deferred.js b/src/core/ready-no-deferred.js index 17aaf5bcd..e46ecacd1 100644 --- a/src/core/ready-no-deferred.js +++ b/src/core/ready-no-deferred.js @@ -1,5 +1,5 @@ -import jQuery from "../core.js"; -import document from "../var/document.js"; +import { jQuery } from "../core.js"; +import { document } from "../var/document.js"; var readyCallbacks = [], whenReady = function( fn ) { diff --git a/src/core/ready.js b/src/core/ready.js index 88dcc3433..5265a52b0 100644 --- a/src/core/ready.js +++ b/src/core/ready.js @@ -1,5 +1,5 @@ -import jQuery from "../core.js"; -import document from "../var/document.js"; +import { jQuery } from "../core.js"; +import { document } from "../var/document.js"; import "../core/readyException.js"; import "../deferred.js"; diff --git a/src/core/readyException.js b/src/core/readyException.js index 1b5512c15..ff5296a3c 100644 --- a/src/core/readyException.js +++ b/src/core/readyException.js @@ -1,4 +1,4 @@ -import jQuery from "../core.js"; +import { jQuery } from "../core.js"; jQuery.readyException = function( error ) { window.setTimeout( function() { diff --git a/src/core/stripAndCollapse.js b/src/core/stripAndCollapse.js index 944a79362..c9a73c6fa 100644 --- a/src/core/stripAndCollapse.js +++ b/src/core/stripAndCollapse.js @@ -1,10 +1,8 @@ -import rnothtmlwhite from "../var/rnothtmlwhite.js"; +import { rnothtmlwhite } from "../var/rnothtmlwhite.js"; // Strip and collapse whitespace according to HTML spec // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace -function stripAndCollapse( value ) { +export function stripAndCollapse( value ) { var tokens = value.match( rnothtmlwhite ) || []; return tokens.join( " " ); } - -export default stripAndCollapse; diff --git a/src/core/toType.js b/src/core/toType.js index 67af8a67f..9df6c02a4 100644 --- a/src/core/toType.js +++ b/src/core/toType.js @@ -1,7 +1,7 @@ -import class2type from "../var/class2type.js"; -import toString from "../var/toString.js"; +import { class2type } from "../var/class2type.js"; +import { toString } from "../var/toString.js"; -function toType( obj ) { +export function toType( obj ) { if ( obj == null ) { return obj + ""; } @@ -10,5 +10,3 @@ function toType( obj ) { class2type[ toString.call( obj ) ] || "object" : typeof obj; } - -export default toType; diff --git a/src/core/var/rsingleTag.js b/src/core/var/rsingleTag.js index 5bf52d568..8cead250f 100644 --- a/src/core/var/rsingleTag.js +++ b/src/core/var/rsingleTag.js @@ -1,3 +1,3 @@ // rsingleTag matches a string consisting of a single HTML element with no attributes // and captures the element's name -export default ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); +export var rsingleTag = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i; diff --git a/src/css.js b/src/css.js index a69ad1730..f5407470f 100644 --- a/src/css.js +++ b/src/css.js @@ -1,19 +1,19 @@ -import jQuery from "./core.js"; -import access from "./core/access.js"; -import nodeName from "./core/nodeName.js"; -import rcssNum from "./var/rcssNum.js"; -import isIE from "./var/isIE.js"; -import rnumnonpx from "./css/var/rnumnonpx.js"; -import rcustomProp from "./css/var/rcustomProp.js"; -import cssExpand from "./css/var/cssExpand.js"; -import isAutoPx from "./css/isAutoPx.js"; -import cssCamelCase from "./css/cssCamelCase.js"; -import getStyles from "./css/var/getStyles.js"; -import swap from "./css/var/swap.js"; -import curCSS from "./css/curCSS.js"; -import adjustCSS from "./css/adjustCSS.js"; -import finalPropName from "./css/finalPropName.js"; -import support from "./css/support.js"; +import { jQuery } from "./core.js"; +import { access } from "./core/access.js"; +import { nodeName } from "./core/nodeName.js"; +import { rcssNum } from "./var/rcssNum.js"; +import { isIE } from "./var/isIE.js"; +import { rnumnonpx } from "./css/var/rnumnonpx.js"; +import { rcustomProp } from "./css/var/rcustomProp.js"; +import { cssExpand } from "./css/var/cssExpand.js"; +import { isAutoPx } from "./css/isAutoPx.js"; +import { cssCamelCase } from "./css/cssCamelCase.js"; +import { getStyles } from "./css/var/getStyles.js"; +import { swap } from "./css/var/swap.js"; +import { curCSS } from "./css/curCSS.js"; +import { adjustCSS } from "./css/adjustCSS.js"; +import { finalPropName } from "./css/finalPropName.js"; +import { support } from "./css/support.js"; import "./core/init.js"; import "./core/ready.js"; @@ -418,4 +418,4 @@ jQuery.fn.extend( { } } ); -export default jQuery; +export { jQuery, jQuery as $ }; diff --git a/src/css/adjustCSS.js b/src/css/adjustCSS.js index d973ff386..a5263f099 100644 --- a/src/css/adjustCSS.js +++ b/src/css/adjustCSS.js @@ -1,8 +1,8 @@ -import jQuery from "../core.js"; -import isAutoPx from "./isAutoPx.js"; -import rcssNum from "../var/rcssNum.js"; +import { jQuery } from "../core.js"; +import { isAutoPx } from "./isAutoPx.js"; +import { rcssNum } from "../var/rcssNum.js"; -function adjustCSS( elem, prop, valueParts, tween ) { +export function adjustCSS( elem, prop, valueParts, tween ) { var adjusted, scale, maxIterations = 20, currentValue = tween ? @@ -66,5 +66,3 @@ function adjustCSS( elem, prop, valueParts, tween ) { } return adjusted; } - -export default adjustCSS; diff --git a/src/css/cssCamelCase.js b/src/css/cssCamelCase.js index c75dcd950..a87897989 100644 --- a/src/css/cssCamelCase.js +++ b/src/css/cssCamelCase.js @@ -1,4 +1,4 @@ -import camelCase from "../core/camelCase.js"; +import { camelCase } from "../core/camelCase.js"; // Matches dashed string for camelizing var rmsPrefix = /^-ms-/; @@ -7,8 +7,6 @@ var rmsPrefix = /^-ms-/; // Used by the css & effects modules. // Support: IE <=9 - 11+ // Microsoft forgot to hump their vendor prefix (trac-9572) -function cssCamelCase( string ) { +export function cssCamelCase( string ) { return camelCase( string.replace( rmsPrefix, "ms-" ) ); } - -export default cssCamelCase; diff --git a/src/css/curCSS.js b/src/css/curCSS.js index 72c3db9f5..06394f315 100644 --- a/src/css/curCSS.js +++ b/src/css/curCSS.js @@ -1,10 +1,10 @@ -import jQuery from "../core.js"; -import isAttached from "../core/isAttached.js"; -import getStyles from "./var/getStyles.js"; -import rcustomProp from "./var/rcustomProp.js"; -import rtrim from "../var/rtrim.js"; +import { jQuery } from "../core.js"; +import { isAttached } from "../core/isAttached.js"; +import { getStyles } from "./var/getStyles.js"; +import { rcustomProp } from "./var/rcustomProp.js"; +import { rtrim } from "../var/rtrim.js"; -function curCSS( elem, name, computed ) { +export function curCSS( elem, name, computed ) { var ret, isCustomProp = rcustomProp.test( name ); @@ -57,5 +57,3 @@ function curCSS( elem, name, computed ) { ret + "" : ret; } - -export default curCSS; diff --git a/src/css/finalPropName.js b/src/css/finalPropName.js index 40d2fb193..b11e92394 100644 --- a/src/css/finalPropName.js +++ b/src/css/finalPropName.js @@ -1,4 +1,4 @@ -import document from "../var/document.js"; +import { document } from "../var/document.js"; var cssPrefixes = [ "Webkit", "Moz", "ms" ], emptyStyle = document.createElement( "div" ).style, @@ -20,7 +20,7 @@ function vendorPropName( name ) { } // Return a potentially-mapped vendor prefixed property -function finalPropName( name ) { +export function finalPropName( name ) { var final = vendorProps[ name ]; if ( final ) { @@ -31,5 +31,3 @@ function finalPropName( name ) { } return vendorProps[ name ] = vendorPropName( name ) || name; } - -export default finalPropName; diff --git a/src/css/hiddenVisibleSelectors.js b/src/css/hiddenVisibleSelectors.js index 1f892dfe0..5e0709481 100644 --- a/src/css/hiddenVisibleSelectors.js +++ b/src/css/hiddenVisibleSelectors.js @@ -1,4 +1,4 @@ -import jQuery from "../core.js"; +import { jQuery } from "../core.js"; import "../selector.js"; diff --git a/src/css/isAutoPx.js b/src/css/isAutoPx.js index ca9b35aca..96501be01 100644 --- a/src/css/isAutoPx.js +++ b/src/css/isAutoPx.js @@ -23,7 +23,7 @@ var ralphaStart = /^[a-z]/, // \ Max / \ Height / rautoPx = /^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/; -function isAutoPx( prop ) { +export function isAutoPx( prop ) { // The first test is used to ensure that: // 1. The prop starts with a lowercase letter (as we uppercase it for the second regex). @@ -31,5 +31,3 @@ function isAutoPx( prop ) { return ralphaStart.test( prop ) && rautoPx.test( prop[ 0 ].toUpperCase() + prop.slice( 1 ) ); } - -export default isAutoPx; diff --git a/src/css/showHide.js b/src/css/showHide.js index dc273f98c..77ddc5bdb 100644 --- a/src/css/showHide.js +++ b/src/css/showHide.js @@ -1,6 +1,6 @@ -import jQuery from "../core.js"; -import dataPriv from "../data/var/dataPriv.js"; -import isHiddenWithinTree from "../css/var/isHiddenWithinTree.js"; +import { jQuery } from "../core.js"; +import { dataPriv } from "../data/var/dataPriv.js"; +import { isHiddenWithinTree } from "../css/var/isHiddenWithinTree.js"; var defaultDisplayMap = {}; @@ -27,7 +27,7 @@ function getDefaultDisplay( elem ) { return display; } -function showHide( elements, show ) { +export function showHide( elements, show ) { var display, elem, values = [], index = 0, @@ -96,5 +96,3 @@ jQuery.fn.extend( { } ); } } ); - -export default showHide; diff --git a/src/css/support.js b/src/css/support.js index cf9f0cfcd..5f9b37d7f 100644 --- a/src/css/support.js +++ b/src/css/support.js @@ -1,6 +1,6 @@ -import document from "../var/document.js"; -import documentElement from "../var/documentElement.js"; -import support from "../var/support.js"; +import { document } from "../var/document.js"; +import { documentElement } from "../var/documentElement.js"; +import { support } from "../var/support.js"; ( function() { @@ -58,4 +58,4 @@ support.reliableTrDimensions = function() { }; } )(); -export default support; +export { support }; diff --git a/src/css/var/cssExpand.js b/src/css/var/cssExpand.js index 66062e2ee..10f4e89d2 100644 --- a/src/css/var/cssExpand.js +++ b/src/css/var/cssExpand.js @@ -1 +1 @@ -export default [ "Top", "Right", "Bottom", "Left" ]; +export var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; diff --git a/src/css/var/getStyles.js b/src/css/var/getStyles.js index d25af6752..9dc4298d5 100644 --- a/src/css/var/getStyles.js +++ b/src/css/var/getStyles.js @@ -1,4 +1,4 @@ -export default function( elem ) { +export function getStyles( elem ) { // Support: IE <=11+ (trac-14150) // In IE popup's `window` is the opener window which makes `window.getComputedStyle( elem )` diff --git a/src/css/var/isHiddenWithinTree.js b/src/css/var/isHiddenWithinTree.js index c88747827..22b8221f9 100644 --- a/src/css/var/isHiddenWithinTree.js +++ b/src/css/var/isHiddenWithinTree.js @@ -1,4 +1,4 @@ -import jQuery from "../../core.js"; +import { jQuery } from "../../core.js"; // isHiddenWithinTree reports if an element has a non-"none" display style (inline and/or // through the CSS cascade), which is useful in deciding whether or not to make it visible. @@ -7,7 +7,7 @@ import jQuery from "../../core.js"; // * 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). -export default function( elem, el ) { +export function isHiddenWithinTree( elem, el ) { // isHiddenWithinTree might be called from jQuery#filter function; // in that case, element will be second argument diff --git a/src/css/var/rcustomProp.js b/src/css/var/rcustomProp.js index f435e7cd7..18b8686c4 100644 --- a/src/css/var/rcustomProp.js +++ b/src/css/var/rcustomProp.js @@ -1 +1 @@ -export default ( /^--/ ); +export var rcustomProp = /^--/; diff --git a/src/css/var/rnumnonpx.js b/src/css/var/rnumnonpx.js index 18a9dad6c..0386b0054 100644 --- a/src/css/var/rnumnonpx.js +++ b/src/css/var/rnumnonpx.js @@ -1,3 +1,3 @@ -import pnum from "../../var/pnum.js"; +import { pnum } from "../../var/pnum.js"; -export default new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); +export var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); diff --git a/src/css/var/swap.js b/src/css/var/swap.js index f5d8f23ab..90b31d584 100644 --- a/src/css/var/swap.js +++ b/src/css/var/swap.js @@ -1,5 +1,5 @@ // A method for quickly swapping in/out CSS properties to get correct calculations. -export default function( elem, options, callback ) { +export function swap( elem, options, callback ) { var ret, name, old = {}; diff --git a/src/data.js b/src/data.js index e3e8eabe1..ce2813e97 100644 --- a/src/data.js +++ b/src/data.js @@ -1,8 +1,8 @@ -import jQuery from "./core.js"; -import access from "./core/access.js"; -import camelCase from "./core/camelCase.js"; -import dataPriv from "./data/var/dataPriv.js"; -import dataUser from "./data/var/dataUser.js"; +import { jQuery } from "./core.js"; +import { access } from "./core/access.js"; +import { camelCase } from "./core/camelCase.js"; +import { dataPriv } from "./data/var/dataPriv.js"; +import { dataUser } from "./data/var/dataUser.js"; // Implementation Summary // @@ -172,4 +172,4 @@ jQuery.fn.extend( { } } ); -export default jQuery; +export { jQuery, jQuery as $ }; diff --git a/src/data/Data.js b/src/data/Data.js index 8c9e1f9f8..2a3ccbd14 100644 --- a/src/data/Data.js +++ b/src/data/Data.js @@ -1,9 +1,9 @@ -import jQuery from "../core.js"; -import camelCase from "../core/camelCase.js"; -import rnothtmlwhite from "../var/rnothtmlwhite.js"; -import acceptData from "./var/acceptData.js"; +import { jQuery } from "../core.js"; +import { camelCase } from "../core/camelCase.js"; +import { rnothtmlwhite } from "../var/rnothtmlwhite.js"; +import { acceptData } from "./var/acceptData.js"; -function Data() { +export function Data() { this.expando = jQuery.expando + Data.uid++; } @@ -153,5 +153,3 @@ Data.prototype = { return cache !== undefined && !jQuery.isEmptyObject( cache ); } }; - -export default Data; diff --git a/src/data/var/acceptData.js b/src/data/var/acceptData.js index 6b154c5b3..dbb93ee92 100644 --- a/src/data/var/acceptData.js +++ b/src/data/var/acceptData.js @@ -1,7 +1,7 @@ /** * Determines whether an object can have data */ -export default function( owner ) { +export function acceptData( owner ) { // Accepts only: // - Node diff --git a/src/data/var/dataPriv.js b/src/data/var/dataPriv.js index 94ea1190e..aaa43bd4e 100644 --- a/src/data/var/dataPriv.js +++ b/src/data/var/dataPriv.js @@ -1,3 +1,3 @@ -import Data from "../Data.js"; +import { Data } from "../Data.js"; -export default new Data(); +export var dataPriv = new Data(); diff --git a/src/data/var/dataUser.js b/src/data/var/dataUser.js index 94ea1190e..a0504b628 100644 --- a/src/data/var/dataUser.js +++ b/src/data/var/dataUser.js @@ -1,3 +1,3 @@ -import Data from "../Data.js"; +import { Data } from "../Data.js"; -export default new Data(); +export var dataUser = new Data(); diff --git a/src/deferred.js b/src/deferred.js index 0d77ac9d6..5817ddbc6 100644 --- a/src/deferred.js +++ b/src/deferred.js @@ -1,5 +1,5 @@ -import jQuery from "./core.js"; -import slice from "./var/slice.js"; +import { jQuery } from "./core.js"; +import { slice } from "./var/slice.js"; import "./callbacks.js"; @@ -389,4 +389,4 @@ jQuery.extend( { } } ); -export default jQuery; +export { jQuery, jQuery as $ }; diff --git a/src/deferred/exceptionHook.js b/src/deferred/exceptionHook.js index a5e7b5d3c..4967a273d 100644 --- a/src/deferred/exceptionHook.js +++ b/src/deferred/exceptionHook.js @@ -1,4 +1,4 @@ -import jQuery from "../core.js"; +import { jQuery } from "../core.js"; import "../deferred.js"; diff --git a/src/deprecated.js b/src/deprecated.js index e58156f9e..b2f767cdf 100644 --- a/src/deprecated.js +++ b/src/deprecated.js @@ -1,5 +1,5 @@ -import jQuery from "./core.js"; -import slice from "./var/slice.js"; +import { jQuery } from "./core.js"; +import { slice } from "./var/slice.js"; import "./deprecated/ajax-event-alias.js"; import "./deprecated/event.js"; @@ -42,3 +42,5 @@ jQuery.holdReady = function( hold ) { jQuery.ready( true ); } }; + +export { jQuery, jQuery as $ }; diff --git a/src/deprecated/ajax-event-alias.js b/src/deprecated/ajax-event-alias.js index e4fe11525..134b4f63d 100644 --- a/src/deprecated/ajax-event-alias.js +++ b/src/deprecated/ajax-event-alias.js @@ -1,4 +1,4 @@ -import jQuery from "../core.js"; +import { jQuery } from "../core.js"; import "../ajax.js"; import "../event.js"; diff --git a/src/deprecated/event.js b/src/deprecated/event.js index 4f5c59c0a..f481a9c1f 100644 --- a/src/deprecated/event.js +++ b/src/deprecated/event.js @@ -1,4 +1,4 @@ -import jQuery from "../core.js"; +import { jQuery } from "../core.js"; import "../event.js"; import "../event/trigger.js"; diff --git a/src/dimensions.js b/src/dimensions.js index 42e445362..a5e1a6126 100644 --- a/src/dimensions.js +++ b/src/dimensions.js @@ -1,6 +1,6 @@ -import jQuery from "./core.js"; -import access from "./core/access.js"; -import isWindow from "./var/isWindow.js"; +import { jQuery } from "./core.js"; +import { access } from "./core/access.js"; +import { isWindow } from "./var/isWindow.js"; import "./css.js"; @@ -53,4 +53,4 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { } ); } ); -export default jQuery; +export { jQuery, jQuery as $ }; diff --git a/src/effects.js b/src/effects.js index 49b0bf67d..99dbad7bc 100644 --- a/src/effects.js +++ b/src/effects.js @@ -1,13 +1,13 @@ -import jQuery from "./core.js"; -import document from "./var/document.js"; -import rcssNum from "./var/rcssNum.js"; -import rnothtmlwhite from "./var/rnothtmlwhite.js"; -import cssExpand from "./css/var/cssExpand.js"; -import isHiddenWithinTree from "./css/var/isHiddenWithinTree.js"; -import adjustCSS from "./css/adjustCSS.js"; -import cssCamelCase from "./css/cssCamelCase.js"; -import dataPriv from "./data/var/dataPriv.js"; -import showHide from "./css/showHide.js"; +import { jQuery } from "./core.js"; +import { document } from "./var/document.js"; +import { rcssNum } from "./var/rcssNum.js"; +import { rnothtmlwhite } from "./var/rnothtmlwhite.js"; +import { cssExpand } from "./css/var/cssExpand.js"; +import { isHiddenWithinTree } from "./css/var/isHiddenWithinTree.js"; +import { adjustCSS } from "./css/adjustCSS.js"; +import { cssCamelCase } from "./css/cssCamelCase.js"; +import { dataPriv } from "./data/var/dataPriv.js"; +import { showHide } from "./css/showHide.js"; import "./core/init.js"; import "./queue.js"; @@ -684,4 +684,4 @@ jQuery.fx.speeds = { _default: 400 }; -export default jQuery; +export { jQuery, jQuery as $ }; diff --git a/src/effects/Tween.js b/src/effects/Tween.js index c0220bd10..7acd2792c 100644 --- a/src/effects/Tween.js +++ b/src/effects/Tween.js @@ -1,6 +1,6 @@ -import jQuery from "../core.js"; -import isAutoPx from "../css/isAutoPx.js"; -import finalPropName from "../css/finalPropName.js"; +import { jQuery } from "../core.js"; +import { isAutoPx } from "../css/isAutoPx.js"; +import { finalPropName } from "../css/finalPropName.js"; import "../css.js"; diff --git a/src/effects/animatedSelector.js b/src/effects/animatedSelector.js index 327956f72..0e0b377f1 100644 --- a/src/effects/animatedSelector.js +++ b/src/effects/animatedSelector.js @@ -1,4 +1,4 @@ -import jQuery from "../core.js"; +import { jQuery } from "../core.js"; import "../selector.js"; import "../effects.js"; diff --git a/src/event.js b/src/event.js index 5d2c8c1c3..0112264a4 100644 --- a/src/event.js +++ b/src/event.js @@ -1,12 +1,12 @@ -import jQuery from "./core.js"; -import documentElement from "./var/documentElement.js"; -import rnothtmlwhite from "./var/rnothtmlwhite.js"; -import rcheckableType from "./var/rcheckableType.js"; -import slice from "./var/slice.js"; -import isIE from "./var/isIE.js"; -import acceptData from "./data/var/acceptData.js"; -import dataPriv from "./data/var/dataPriv.js"; -import nodeName from "./core/nodeName.js"; +import { jQuery } from "./core.js"; +import { documentElement } from "./var/documentElement.js"; +import { rnothtmlwhite } from "./var/rnothtmlwhite.js"; +import { rcheckableType } from "./var/rcheckableType.js"; +import { slice } from "./var/slice.js"; +import { isIE } from "./var/isIE.js"; +import { acceptData } from "./data/var/acceptData.js"; +import { dataPriv } from "./data/var/dataPriv.js"; +import { nodeName } from "./core/nodeName.js"; import "./core/init.js"; import "./selector.js"; @@ -851,4 +851,4 @@ jQuery.fn.extend( { } } ); -export default jQuery; +export { jQuery, jQuery as $ }; diff --git a/src/event/trigger.js b/src/event/trigger.js index 5fad460e1..2b1f52846 100644 --- a/src/event/trigger.js +++ b/src/event/trigger.js @@ -1,9 +1,9 @@ -import jQuery from "../core.js"; -import document from "../var/document.js"; -import dataPriv from "../data/var/dataPriv.js"; -import acceptData from "../data/var/acceptData.js"; -import hasOwn from "../var/hasOwn.js"; -import isWindow from "../var/isWindow.js"; +import { jQuery } from "../core.js"; +import { document } from "../var/document.js"; +import { dataPriv } from "../data/var/dataPriv.js"; +import { acceptData } from "../data/var/acceptData.js"; +import { hasOwn } from "../var/hasOwn.js"; +import { isWindow } from "../var/isWindow.js"; import "../event.js"; diff --git a/src/exports/amd.js b/src/exports/amd.js index 44587ab3a..85a66eeab 100644 --- a/src/exports/amd.js +++ b/src/exports/amd.js @@ -1,4 +1,4 @@ -import jQuery from "../core.js"; +import { jQuery } from "../core.js"; // 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 diff --git a/src/exports/global.js b/src/exports/global.js index 965a4b400..3adcb739e 100644 --- a/src/exports/global.js +++ b/src/exports/global.js @@ -1,4 +1,4 @@ -import jQuery from "../core.js"; +import { jQuery } from "../core.js"; var diff --git a/src/jquery.js b/src/jquery.js index d833516d4..e763d1b05 100644 --- a/src/jquery.js +++ b/src/jquery.js @@ -1,4 +1,4 @@ -import jQuery from "./core.js"; +import { jQuery } from "./core.js"; import "./selector.js"; import "./traversing.js"; @@ -35,4 +35,4 @@ import "./deprecated.js"; import "./exports/amd.js"; import "./exports/global.js"; -export default jQuery; +export { jQuery, jQuery as $ }; diff --git a/src/manipulation.js b/src/manipulation.js index d3ee1130f..0a7209412 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -1,17 +1,17 @@ -import jQuery from "./core.js"; -import isAttached from "./core/isAttached.js"; -import isIE from "./var/isIE.js"; -import push from "./var/push.js"; -import access from "./core/access.js"; -import rtagName from "./manipulation/var/rtagName.js"; -import wrapMap from "./manipulation/wrapMap.js"; -import getAll from "./manipulation/getAll.js"; -import domManip from "./manipulation/domManip.js"; -import setGlobalEval from "./manipulation/setGlobalEval.js"; -import dataPriv from "./data/var/dataPriv.js"; -import dataUser from "./data/var/dataUser.js"; -import acceptData from "./data/var/acceptData.js"; -import nodeName from "./core/nodeName.js"; +import { jQuery } from "./core.js"; +import { isAttached } from "./core/isAttached.js"; +import { isIE } from "./var/isIE.js"; +import { push } from "./var/push.js"; +import { access } from "./core/access.js"; +import { rtagName } from "./manipulation/var/rtagName.js"; +import { wrapMap } from "./manipulation/wrapMap.js"; +import { getAll } from "./manipulation/getAll.js"; +import { domManip } from "./manipulation/domManip.js"; +import { setGlobalEval } from "./manipulation/setGlobalEval.js"; +import { dataPriv } from "./data/var/dataPriv.js"; +import { dataUser } from "./data/var/dataUser.js"; +import { acceptData } from "./data/var/acceptData.js"; +import { nodeName } from "./core/nodeName.js"; import "./core/init.js"; import "./traversing.js"; @@ -341,4 +341,4 @@ jQuery.each( { }; } ); -export default jQuery; +export { jQuery, jQuery as $ }; diff --git a/src/manipulation/_evalUrl.js b/src/manipulation/_evalUrl.js index 1af889ddc..e07bb8d72 100644 --- a/src/manipulation/_evalUrl.js +++ b/src/manipulation/_evalUrl.js @@ -1,4 +1,4 @@ -import jQuery from "../ajax.js"; +import { jQuery } from "../ajax.js"; jQuery._evalUrl = function( url, options, doc ) { return jQuery.ajax( { diff --git a/src/manipulation/buildFragment.js b/src/manipulation/buildFragment.js index dd0d673e6..034ba89f4 100644 --- a/src/manipulation/buildFragment.js +++ b/src/manipulation/buildFragment.js @@ -1,17 +1,17 @@ -import jQuery from "../core.js"; -import toType from "../core/toType.js"; -import isAttached from "../core/isAttached.js"; -import arr from "../var/arr.js"; -import rtagName from "./var/rtagName.js"; -import rscriptType from "./var/rscriptType.js"; -import wrapMap from "./wrapMap.js"; -import getAll from "./getAll.js"; -import setGlobalEval from "./setGlobalEval.js"; -import isArrayLike from "../core/isArrayLike.js"; +import { jQuery } from "../core.js"; +import { toType } from "../core/toType.js"; +import { isAttached } from "../core/isAttached.js"; +import { arr } from "../var/arr.js"; +import { rtagName } from "./var/rtagName.js"; +import { rscriptType } from "./var/rscriptType.js"; +import { wrapMap } from "./wrapMap.js"; +import { getAll } from "./getAll.js"; +import { setGlobalEval } from "./setGlobalEval.js"; +import { isArrayLike } from "../core/isArrayLike.js"; var rhtml = /<|?\w+;/; -function buildFragment( elems, context, scripts, selection, ignored ) { +export function buildFragment( elems, context, scripts, selection, ignored ) { var elem, tmp, tag, wrap, attached, j, fragment = context.createDocumentFragment(), nodes = [], @@ -95,5 +95,3 @@ function buildFragment( elems, context, scripts, selection, ignored ) { return fragment; } - -export default buildFragment; diff --git a/src/manipulation/domManip.js b/src/manipulation/domManip.js index 65856a67d..39c146c89 100644 --- a/src/manipulation/domManip.js +++ b/src/manipulation/domManip.js @@ -1,10 +1,10 @@ -import jQuery from "../core.js"; -import flat from "../var/flat.js"; -import rscriptType from "./var/rscriptType.js"; -import getAll from "./getAll.js"; -import buildFragment from "./buildFragment.js"; -import dataPriv from "../data/var/dataPriv.js"; -import DOMEval from "../core/DOMEval.js"; +import { jQuery } from "../core.js"; +import { flat } from "../var/flat.js"; +import { rscriptType } from "./var/rscriptType.js"; +import { getAll } from "./getAll.js"; +import { buildFragment } from "./buildFragment.js"; +import { dataPriv } from "../data/var/dataPriv.js"; +import { DOMEval } from "../core/DOMEval.js"; // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { @@ -21,7 +21,7 @@ function restoreScript( elem ) { return elem; } -function domManip( collection, args, callback, ignored ) { +export function domManip( collection, args, callback, ignored ) { // Flatten any nested arrays args = flat( args ); @@ -105,5 +105,3 @@ function domManip( collection, args, callback, ignored ) { return collection; } - -export default domManip; diff --git a/src/manipulation/getAll.js b/src/manipulation/getAll.js index f4943dfe4..db876202d 100644 --- a/src/manipulation/getAll.js +++ b/src/manipulation/getAll.js @@ -1,7 +1,7 @@ -import jQuery from "../core.js"; -import nodeName from "../core/nodeName.js"; +import { jQuery } from "../core.js"; +import { nodeName } from "../core/nodeName.js"; -function getAll( context, tag ) { +export function getAll( context, tag ) { // Support: IE <=9 - 11+ // Use typeof to avoid zero-argument method invocation on host objects (trac-15151) @@ -23,5 +23,3 @@ function getAll( context, tag ) { return ret; } - -export default getAll; diff --git a/src/manipulation/setGlobalEval.js b/src/manipulation/setGlobalEval.js index c6f7ee9ab..9571bdcfa 100644 --- a/src/manipulation/setGlobalEval.js +++ b/src/manipulation/setGlobalEval.js @@ -1,7 +1,7 @@ -import dataPriv from "../data/var/dataPriv.js"; +import { dataPriv } from "../data/var/dataPriv.js"; // Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { +export function setGlobalEval( elems, refElements ) { var i = 0, l = elems.length; @@ -13,5 +13,3 @@ function setGlobalEval( elems, refElements ) { ); } } - -export default setGlobalEval; diff --git a/src/manipulation/var/rscriptType.js b/src/manipulation/var/rscriptType.js index 879651c7c..e3977e94e 100644 --- a/src/manipulation/var/rscriptType.js +++ b/src/manipulation/var/rscriptType.js @@ -1 +1 @@ -export default ( /^$|^module$|\/(?:java|ecma)script/i ); +export var rscriptType = /^$|^module$|\/(?:java|ecma)script/i; diff --git a/src/manipulation/var/rtagName.js b/src/manipulation/var/rtagName.js index b35acc999..fceba6720 100644 --- a/src/manipulation/var/rtagName.js +++ b/src/manipulation/var/rtagName.js @@ -1,4 +1,4 @@ // rtagName captures the name from the first start tag in a string of HTML // https://html.spec.whatwg.org/multipage/syntax.html#tag-open-state // https://html.spec.whatwg.org/multipage/syntax.html#tag-name-state -export default ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); +export var rtagName = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i; diff --git a/src/manipulation/wrapMap.js b/src/manipulation/wrapMap.js index 457902595..a69bcec86 100644 --- a/src/manipulation/wrapMap.js +++ b/src/manipulation/wrapMap.js @@ -1,4 +1,4 @@ -var wrapMap = { +export var wrapMap = { // Table parts need to be wrapped with `