From d0ce00cdfa680f1f0c38460bc51ea14079ae8b07 Mon Sep 17 00:00:00 2001 From: Michał Gołębiowski-Owczarek Date: Mon, 18 Nov 2019 21:15:03 +0100 Subject: Core: Migrate from AMD to ES modules 🎉 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/var/flat.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/var/flat.js') diff --git a/src/var/flat.js b/src/var/flat.js index 6c7a27169..172420552 100644 --- a/src/var/flat.js +++ b/src/var/flat.js @@ -1,15 +1,9 @@ -define( [ - "./arr" -], function( arr ) { - -"use strict"; +import arr from "./arr.js"; // Support: IE 11+, Edge 18+ // Provide fallback for browsers without Array#flat. -return arr.flat ? function( array ) { +export default arr.flat ? function( array ) { return arr.flat.call( array ); } : function( array ) { return arr.concat.apply( [], array ); }; - -} ); -- cgit v1.2.3