diff --git a/lib/lbt/bundle/Builder.js b/lib/lbt/bundle/Builder.js index cd68b2a24..687c2d3b8 100644 --- a/lib/lbt/bundle/Builder.js +++ b/lib/lbt/bundle/Builder.js @@ -40,38 +40,6 @@ function isEmptyBundle(resolvedBundle) { return resolvedBundle.sections.every((section) => section.modules.length === 0); } -const UI5BundleFormat = { - beforePreloads(section) { - let str = `jQuery.sap.registerPreloadedModules({\n`; - if ( section.name ) { - str += `"name":"${section.name}",\n`; - } - str += `"version":"2.0",\n`; - str += `"modules":{\n`; - return str; - }, - - afterPreloads(section) { - return `}});\n`; - }, - - beforeBundleInfo() { - return `"unsupported"; /* 'bundleInfo' section mode not supported (requires ui5loader)\n`; - }, - - afterBundleInfo() { - return "*/\n"; - }, - - requireSync(moduleName) { - return `sap.ui.requireSync("${ModuleName.toRequireJSName(moduleName)}");\n`; - }, - - shouldDecorate(resolvedModule) { - return resolvedModule.executes(UI5ClientConstants.MODULE__JQUERY_SAP_GLOBAL); - } -}; - const EVOBundleFormat = { beforePreloads(section) { return `sap.ui.require.preload({\n`; @@ -115,7 +83,6 @@ class BundleBuilder { } async createBundle(module, options) { - await this._prepare(); if ( options.numberOfParts > 1 ) { const bundleInfos = []; const submodules = await this.splitter.run( module, options ); @@ -128,17 +95,6 @@ class BundleBuilder { } } - _prepare() { - return Promise.all([ - // check whether the resource pool contains debug and optimized sources - this.pool.findResource( ModuleName.getDebugName(UI5ClientConstants.MODULE__JQUERY_SAP_GLOBAL) ). - then( () => this.optimizedSources = true, () => this.optimizedSources = false ), - // check whether EVO modules are available. If so, use EVO APIs, else use old UI5 APIs. - this.pool.findResource(UI5ClientConstants.EVO_MARKER_RESOURCE). - then( () => this.targetBundleFormat = EVOBundleFormat, () => this.targetBundleFormat = UI5BundleFormat ) - ]); - } - async _createBundle(module, options) { const resolvedModule = await this.resolver.resolve(module); if ( options.skipIfEmpty && isEmptyBundle(resolvedModule) ) { @@ -153,11 +109,13 @@ class BundleBuilder { this.options.sourceMap = true; } - // when decorateBootstrapModule is set to false, we don't write the optimized flag - // and don't write the try catch wrapper + // Since UI5 Tooling 3.0: Always use modern API + this.targetBundleFormat = EVOBundleFormat; + + // when decorateBootstrapModule is false, + // we don't write the optimized flag and don't write the try catch wrapper this.shouldDecorate = this.options.decorateBootstrapModule && - (((this.optimizedSources && !this.options.debugMode) || this.optimize) && - this.targetBundleFormat.shouldDecorate(resolvedModule)); + this.targetBundleFormat.shouldDecorate(resolvedModule); // TODO is the following condition ok or should the availability of jquery.sap.global.js be configurable? this.jqglobalAvailable = !resolvedModule.containsGlobal; this.openModule(resolvedModule.name); diff --git a/lib/processors/bundlers/moduleBundler.js b/lib/processors/bundlers/moduleBundler.js index b9edca580..ff643cd8b 100644 --- a/lib/processors/bundlers/moduleBundler.js +++ b/lib/processors/bundlers/moduleBundler.js @@ -91,9 +91,9 @@ const log = require("@ui5/logger").getLogger("builder:processors:bundlers:module * @typedef {object} ModuleBundleOptions * @property {boolean} [optimize=true] Whether the module bundle gets minified * @property {boolean} [sourceMap=true] Whether to generate a source map file for the bundle - * @property {boolean} [decorateBootstrapModule=false] If set to 'false', the module won't be decorated + * @property {boolean} [decorateBootstrapModule=false] If set to 'false', bootable bundles won't be decorated * with an optimization marker - * @property {boolean} [addTryCatchRestartWrapper=false] Whether to wrap bootable module bundles with + * @property {boolean} [addTryCatchRestartWrapper=false] Whether to wrap bootable bundles with * a try/catch to filter out "Restart" errors * @property {boolean} [usePredefineCalls=false] If set to 'true', sap.ui.predefine is used for UI5 modules * @property {number} [numberOfParts=1] The number of parts the module bundle should be splitted diff --git a/lib/tasks/bundlers/generateComponentPreload.js b/lib/tasks/bundlers/generateComponentPreload.js index 0bae96d79..d76e81d87 100644 --- a/lib/tasks/bundlers/generateComponentPreload.js +++ b/lib/tasks/bundlers/generateComponentPreload.js @@ -1,7 +1,6 @@ const path = require("path"); const moduleBundler = require("../../processors/bundlers/moduleBundler"); const log = require("@ui5/logger").getLogger("builder:tasks:bundlers:generateComponentPreload"); -const ReaderCollectionPrioritized = require("@ui5/fs").ReaderCollectionPrioritized; const {negateFilters} = require("../../lbt/resources/ResourceFilterList"); /** @@ -11,7 +10,6 @@ const {negateFilters} = require("../../lbt/resources/ResourceFilterList"); * @alias module:@ui5/builder.tasks.generateComponentPreload * @param {object} parameters Parameters * @param {module:@ui5/fs.DuplexCollection} parameters.workspace DuplexCollection to read and write files - * @param {module:@ui5/fs.AbstractReader} parameters.dependencies Reader or Collection to read dependency files * @param {module:@ui5/builder.tasks.TaskUtil|object} [parameters.taskUtil] TaskUtil * @param {object} parameters.options Options * @param {string} parameters.options.projectName Project name @@ -26,29 +24,24 @@ const {negateFilters} = require("../../lbt/resources/ResourceFilterList"); * @returns {Promise} Promise resolving with undefined once data has been written */ module.exports = function({ - workspace, dependencies, taskUtil, options: {projectName, paths, namespaces, excludes = []} + workspace, taskUtil, options: {projectName, paths, namespaces, excludes = []} }) { - let combo = new ReaderCollectionPrioritized({ - name: `generateComponentPreload - prioritize workspace over dependencies: ${projectName}`, - readers: [workspace, dependencies] - }); - + let nonDbgWorkspace = workspace; if (taskUtil) { - combo = combo.filter(function(resource) { + nonDbgWorkspace = workspace.filter(function(resource) { // Remove any debug variants return !taskUtil.getTag(resource, taskUtil.STANDARD_TAGS.IsDebugVariant); }); } - // TODO 3.0: Limit to workspace resources? - return combo.byGlob("/resources/**/*.{js,json,xml,html,properties,library,js.map}") + return nonDbgWorkspace.byGlob("/resources/**/*.{js,json,xml,html,properties,library,js.map}") .then(async (resources) => { let allNamespaces = []; if (paths) { allNamespaces = await Promise.all(paths.map(async (componentPath) => { const globPath = "/resources/" + componentPath; log.verbose(`Globbing for Components directories with configured path ${globPath}...`); - const components = await combo.byGlob(globPath); // TODO 3.0: Limit to workspace resources? + const components = await nonDbgWorkspace.byGlob(globPath); return components.map((component) => { const compDir = path.dirname(component.getPath()).replace(/^\/resources\//i, ""); log.verbose(`Found component namespace ${compDir}`); diff --git a/lib/tasks/bundlers/generateLibraryPreload.js b/lib/tasks/bundlers/generateLibraryPreload.js index 0a027620a..c12a8973f 100644 --- a/lib/tasks/bundlers/generateLibraryPreload.js +++ b/lib/tasks/bundlers/generateLibraryPreload.js @@ -1,6 +1,5 @@ const log = require("@ui5/logger").getLogger("builder:tasks:bundlers:generateLibraryPreload"); const moduleBundler = require("../../processors/bundlers/moduleBundler"); -const ReaderCollectionPrioritized = require("@ui5/fs").ReaderCollectionPrioritized; const {negateFilters} = require("../../lbt/resources/ResourceFilterList"); const createModuleNameMapping = require("./utils/createModuleNameMapping"); @@ -266,7 +265,6 @@ function getSapUiCoreBunDef(name, filters, preload) { * @alias module:@ui5/builder.tasks.generateLibraryPreload * @param {object} parameters Parameters * @param {module:@ui5/fs.DuplexCollection} parameters.workspace DuplexCollection to read and write files - * @param {module:@ui5/fs.AbstractReader} parameters.dependencies Reader or Collection to read dependency files * @param {module:@ui5/builder.tasks.TaskUtil|object} [parameters.taskUtil] TaskUtil * @param {string[]} [parameters.options.excludes=[]] List of modules declared as glob patterns (resource name patterns) * that should be excluded from the library-preload.js bundle. @@ -278,20 +276,16 @@ function getSapUiCoreBunDef(name, filters, preload) { * @param {string} parameters.options.projectName Project name * @returns {Promise} Promise resolving with undefined once data has been written */ -module.exports = function({workspace, dependencies, taskUtil, options: {projectName, excludes = []}}) { - let combo = new ReaderCollectionPrioritized({ - name: `libraryBundler - prioritize workspace over dependencies: ${projectName}`, - readers: [workspace, dependencies] - }); - +module.exports = function({workspace, taskUtil, options: {projectName, excludes = []}}) { + let nonDbgWorkspace = workspace; if (taskUtil) { - combo = combo.filter(function(resource) { + nonDbgWorkspace = workspace.filter(function(resource) { // Remove any debug variants return !taskUtil.getTag(resource, taskUtil.STANDARD_TAGS.IsDebugVariant); }); } - return combo.byGlob("/**/*.{js,json,xml,html,properties,library,js.map}").then(async (resources) => { + return nonDbgWorkspace.byGlob("/**/*.{js,json,xml,html,properties,library,js.map}").then(async (resources) => { // Find all libraries and create a library-preload.js bundle let p = Promise.resolve(); @@ -314,10 +308,7 @@ module.exports = function({workspace, dependencies, taskUtil, options: {projectN let unoptimizedModuleNameMapping; let unoptimizedResources = resources; if (taskUtil) { - unoptimizedResources = await new ReaderCollectionPrioritized({ - name: `libraryBundler - prioritize workspace over dependencies: ${projectName}`, - readers: [workspace, dependencies] - }).filter(function(resource) { + unoptimizedResources = await workspace.filter(function(resource) { // Remove any non-debug variants return !taskUtil.getTag(resource, taskUtil.STANDARD_TAGS.HasDebugVariant); }).byGlob("/**/*.{js,json,xml,html,properties,library,js.map}"); diff --git a/lib/types/application/ApplicationBuilder.js b/lib/types/application/ApplicationBuilder.js index debd7fb01..a8ff35da4 100644 --- a/lib/types/application/ApplicationBuilder.js +++ b/lib/types/application/ApplicationBuilder.js @@ -93,7 +93,6 @@ class ApplicationBuilder extends AbstractBuilder { this.addTask("generateComponentPreload", async () => { return getTask("generateComponentPreload").task({ workspace: resourceCollections.workspace, - dependencies: resourceCollections.dependencies, taskUtil, options: { projectName: project.metadata.name, @@ -108,7 +107,6 @@ class ApplicationBuilder extends AbstractBuilder { this.addTask("generateComponentPreload", async () => { return getTask("generateComponentPreload").task({ workspace: resourceCollections.workspace, - dependencies: resourceCollections.dependencies, taskUtil, options: { projectName: project.metadata.name, diff --git a/lib/types/library/LibraryBuilder.js b/lib/types/library/LibraryBuilder.js index 31e2e1cb2..025682c03 100644 --- a/lib/types/library/LibraryBuilder.js +++ b/lib/types/library/LibraryBuilder.js @@ -137,7 +137,6 @@ class LibraryBuilder extends AbstractBuilder { this.addTask("generateComponentPreload", async () => { return getTask("generateComponentPreload").task({ workspace: resourceCollections.workspace, - dependencies: resourceCollections.dependencies, taskUtil, options: { projectName: project.metadata.name, @@ -152,7 +151,6 @@ class LibraryBuilder extends AbstractBuilder { this.addTask("generateLibraryPreload", async () => { return getTask("generateLibraryPreload").task({ workspace: resourceCollections.workspace, - dependencies: resourceCollections.dependencies, taskUtil, options: { projectName: project.metadata.name, diff --git a/test/expected/build/application.g/cachebuster/Component-preload.js b/test/expected/build/application.g/cachebuster/Component-preload.js index b1f089a2a..2834902bd 100644 --- a/test/expected/build/application.g/cachebuster/Component-preload.js +++ b/test/expected/build/application.g/cachebuster/Component-preload.js @@ -1,7 +1,5 @@ //@ui5-bundle application/g/Component-preload.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ +sap.ui.require.preload({ "application/g/Component.js":function(){ sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); }, @@ -14,5 +12,5 @@ sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.exte sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); }, "application/g/subcomponentB/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g.subcomponentB","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}' -}}); +}); //# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.g/cachebuster/Component-preload.js.map b/test/expected/build/application.g/cachebuster/Component-preload.js.map index 407e4420d..068ca7499 100644 --- a/test/expected/build/application.g/cachebuster/Component-preload.js.map +++ b/test/expected/build/application.g/cachebuster/Component-preload.js.map @@ -1 +1 @@ -{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}},{"offset":{"line":9,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":"subcomponentA"}},{"offset":{"line":13,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":"subcomponentB"}}]} \ No newline at end of file +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}},{"offset":{"line":7,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":"subcomponentA"}},{"offset":{"line":11,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":"subcomponentB"}}]} \ No newline at end of file diff --git a/test/expected/build/application.g/cachebuster_hash/Component-preload.js b/test/expected/build/application.g/cachebuster_hash/Component-preload.js index b1f089a2a..2834902bd 100644 --- a/test/expected/build/application.g/cachebuster_hash/Component-preload.js +++ b/test/expected/build/application.g/cachebuster_hash/Component-preload.js @@ -1,7 +1,5 @@ //@ui5-bundle application/g/Component-preload.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ +sap.ui.require.preload({ "application/g/Component.js":function(){ sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); }, @@ -14,5 +12,5 @@ sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.exte sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); }, "application/g/subcomponentB/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g.subcomponentB","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}' -}}); +}); //# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.g/cachebuster_hash/Component-preload.js.map b/test/expected/build/application.g/cachebuster_hash/Component-preload.js.map index 407e4420d..068ca7499 100644 --- a/test/expected/build/application.g/cachebuster_hash/Component-preload.js.map +++ b/test/expected/build/application.g/cachebuster_hash/Component-preload.js.map @@ -1 +1 @@ -{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}},{"offset":{"line":9,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":"subcomponentA"}},{"offset":{"line":13,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":"subcomponentB"}}]} \ No newline at end of file +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}},{"offset":{"line":7,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":"subcomponentA"}},{"offset":{"line":11,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":"subcomponentB"}}]} \ No newline at end of file diff --git a/test/expected/build/application.g/dest/Component-preload.js b/test/expected/build/application.g/dest/Component-preload.js index a186e8cc7..54dc2a0cb 100644 --- a/test/expected/build/application.g/dest/Component-preload.js +++ b/test/expected/build/application.g/dest/Component-preload.js @@ -1,10 +1,8 @@ //@ui5-bundle application/g/Component-preload.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ +sap.ui.require.preload({ "application/g/Component.js":function(){ sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); }, "application/g/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g","type":"application","applicationVersion":{"version":"1.0.0"},"embeds":["embedded"],"title":"{{title}}"},"customCopyrightString":"Some fancy copyright"}' -}}); +}); //# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.g/dest/Component-preload.js.map b/test/expected/build/application.g/dest/Component-preload.js.map index a7a60e6f3..cf93d8189 100644 --- a/test/expected/build/application.g/dest/Component-preload.js.map +++ b/test/expected/build/application.g/dest/Component-preload.js.map @@ -1 +1 @@ -{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.g/dest/subcomponentA/Component-preload.js b/test/expected/build/application.g/dest/subcomponentA/Component-preload.js index 63ae65bd3..d3064774c 100644 --- a/test/expected/build/application.g/dest/subcomponentA/Component-preload.js +++ b/test/expected/build/application.g/dest/subcomponentA/Component-preload.js @@ -1,10 +1,8 @@ //@ui5-bundle application/g/subcomponentA/Component-preload.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ +sap.ui.require.preload({ "application/g/subcomponentA/Component.js":function(){ sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); }, "application/g/subcomponentA/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g.subcomponentA","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}' -}}); +}); //# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.g/dest/subcomponentA/Component-preload.js.map b/test/expected/build/application.g/dest/subcomponentA/Component-preload.js.map index 86937b5b0..87321f7f7 100644 --- a/test/expected/build/application.g/dest/subcomponentA/Component-preload.js.map +++ b/test/expected/build/application.g/dest/subcomponentA/Component-preload.js.map @@ -1 +1 @@ -{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.g/dest/subcomponentB/Component-preload.js b/test/expected/build/application.g/dest/subcomponentB/Component-preload.js index ec2301f6d..058cabe75 100644 --- a/test/expected/build/application.g/dest/subcomponentB/Component-preload.js +++ b/test/expected/build/application.g/dest/subcomponentB/Component-preload.js @@ -1,10 +1,8 @@ //@ui5-bundle application/g/subcomponentB/Component-preload.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ +sap.ui.require.preload({ "application/g/subcomponentB/Component.js":function(){ sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); }, "application/g/subcomponentB/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g.subcomponentB","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}' -}}); +}); //# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.g/dest/subcomponentB/Component-preload.js.map b/test/expected/build/application.g/dest/subcomponentB/Component-preload.js.map index 86937b5b0..87321f7f7 100644 --- a/test/expected/build/application.g/dest/subcomponentB/Component-preload.js.map +++ b/test/expected/build/application.g/dest/subcomponentB/Component-preload.js.map @@ -1 +1 @@ -{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.g/dest2/Component-preload.js b/test/expected/build/application.g/dest2/Component-preload.js index a186e8cc7..54dc2a0cb 100644 --- a/test/expected/build/application.g/dest2/Component-preload.js +++ b/test/expected/build/application.g/dest2/Component-preload.js @@ -1,10 +1,8 @@ //@ui5-bundle application/g/Component-preload.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ +sap.ui.require.preload({ "application/g/Component.js":function(){ sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.Component",{metadata:{manifest:"json"}})}); }, "application/g/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g","type":"application","applicationVersion":{"version":"1.0.0"},"embeds":["embedded"],"title":"{{title}}"},"customCopyrightString":"Some fancy copyright"}' -}}); +}); //# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.g/dest2/Component-preload.js.map b/test/expected/build/application.g/dest2/Component-preload.js.map index a7a60e6f3..cf93d8189 100644 --- a/test/expected/build/application.g/dest2/Component-preload.js.map +++ b/test/expected/build/application.g/dest2/Component-preload.js.map @@ -1 +1 @@ -{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.g/dest2/subcomponentA/Component-preload.js b/test/expected/build/application.g/dest2/subcomponentA/Component-preload.js index 63ae65bd3..d3064774c 100644 --- a/test/expected/build/application.g/dest2/subcomponentA/Component-preload.js +++ b/test/expected/build/application.g/dest2/subcomponentA/Component-preload.js @@ -1,10 +1,8 @@ //@ui5-bundle application/g/subcomponentA/Component-preload.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ +sap.ui.require.preload({ "application/g/subcomponentA/Component.js":function(){ sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentA.Component",{metadata:{manifest:"json"}})}); }, "application/g/subcomponentA/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g.subcomponentA","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}' -}}); +}); //# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.g/dest2/subcomponentA/Component-preload.js.map b/test/expected/build/application.g/dest2/subcomponentA/Component-preload.js.map index 86937b5b0..87321f7f7 100644 --- a/test/expected/build/application.g/dest2/subcomponentA/Component-preload.js.map +++ b/test/expected/build/application.g/dest2/subcomponentA/Component-preload.js.map @@ -1 +1 @@ -{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.g/dest2/subcomponentB/Component-preload.js b/test/expected/build/application.g/dest2/subcomponentB/Component-preload.js index ec2301f6d..058cabe75 100644 --- a/test/expected/build/application.g/dest2/subcomponentB/Component-preload.js +++ b/test/expected/build/application.g/dest2/subcomponentB/Component-preload.js @@ -1,10 +1,8 @@ //@ui5-bundle application/g/subcomponentB/Component-preload.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ +sap.ui.require.preload({ "application/g/subcomponentB/Component.js":function(){ sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.g.subcomponentB.Component",{metadata:{manifest:"json"}})}); }, "application/g/subcomponentB/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.g.subcomponentB","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}' -}}); +}); //# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.g/dest2/subcomponentB/Component-preload.js.map b/test/expected/build/application.g/dest2/subcomponentB/Component-preload.js.map index 86937b5b0..87321f7f7 100644 --- a/test/expected/build/application.g/dest2/subcomponentB/Component-preload.js.map +++ b/test/expected/build/application.g/dest2/subcomponentB/Component-preload.js.map @@ -1 +1 @@ -{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,wCAAyC,CAClEC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.h/dest/sectionsA/customBundle.js b/test/expected/build/application.h/dest/sectionsA/customBundle.js index 50d9eba4b..8bac1d2ad 100644 --- a/test/expected/build/application.h/dest/sectionsA/customBundle.js +++ b/test/expected/build/application.h/dest/sectionsA/customBundle.js @@ -1,12 +1,10 @@ //@ui5-bundle application/h/sectionsA/customBundle.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ +sap.ui.require.preload({ "application/h/sectionsA/section1.js":function(){ sap.ui.define(["sap/m/Button"],function(n){console.log("Section 1 included")}); }, "application/h/sectionsA/section3.js":function(){ sap.ui.define(["sap/m/Button"],function(n){console.log("Section 3 included")}); } -}}); +}); //# sourceMappingURL=customBundle.js.map diff --git a/test/expected/build/application.h/dest/sectionsA/customBundle.js.map b/test/expected/build/application.h/dest/sectionsA/customBundle.js.map index d4d5782ad..0fcd3f3a5 100644 --- a/test/expected/build/application.h/dest/sectionsA/customBundle.js.map +++ b/test/expected/build/application.h/dest/sectionsA/customBundle.js.map @@ -1 +1 @@ -{"version":3,"file":"customBundle.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["customBundle.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["section1-dbg.js"],"names":["sap","ui","define","Button","console","log"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,gBAAiB,SAASC,GACxCC,QAAQC,IAAI","file":"section1.js","sourceRoot":""}},{"offset":{"line":8,"column":0},"map":{"version":3,"sources":["section3-dbg.js"],"names":["sap","ui","define","Button","console","log"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,gBAAiB,SAASC,GACxCC,QAAQC,IAAI","file":"section3.js","sourceRoot":""}}]} \ No newline at end of file +{"version":3,"file":"customBundle.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["customBundle.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["section1-dbg.js"],"names":["sap","ui","define","Button","console","log"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,gBAAiB,SAASC,GACxCC,QAAQC,IAAI","file":"section1.js","sourceRoot":""}},{"offset":{"line":6,"column":0},"map":{"version":3,"sources":["section3-dbg.js"],"names":["sap","ui","define","Button","console","log"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,gBAAiB,SAASC,GACxCC,QAAQC,IAAI","file":"section3.js","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.h/dest/sectionsB/customBundle.js b/test/expected/build/application.h/dest/sectionsB/customBundle.js index ab1c24af1..0966b8950 100644 --- a/test/expected/build/application.h/dest/sectionsB/customBundle.js +++ b/test/expected/build/application.h/dest/sectionsB/customBundle.js @@ -1,7 +1,5 @@ //@ui5-bundle application/h/sectionsB/customBundle.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ +sap.ui.require.preload({ "application/h/sectionsB/section1.js":function(){ sap.ui.define(["sap/m/Button"], function(Button) { console.log("Section 1 included"); @@ -17,5 +15,5 @@ sap.ui.define(["sap/m/Button"], function(Button) { console.log("Section 3 included"); }); } -}}); +}); //# sourceMappingURL=customBundle.js.map diff --git a/test/expected/build/application.h/dest/sectionsB/customBundle.js.map b/test/expected/build/application.h/dest/sectionsB/customBundle.js.map index a4a89d247..2971d0fc9 100644 --- a/test/expected/build/application.h/dest/sectionsB/customBundle.js.map +++ b/test/expected/build/application.h/dest/sectionsB/customBundle.js.map @@ -1 +1 @@ -{"version":3,"file":"customBundle.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["customBundle.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["section1-dbg.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":10,"column":0},"map":{"version":3,"sources":["section2-dbg.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":15,"column":0},"map":{"version":3,"sources":["section3-dbg.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file +{"version":3,"file":"customBundle.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["customBundle.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["section1-dbg.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":8,"column":0},"map":{"version":3,"sources":["section2-dbg.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":13,"column":0},"map":{"version":3,"sources":["section3-dbg.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.h/no-minify/sectionsA/customBundle.js b/test/expected/build/application.h/no-minify/sectionsA/customBundle.js index 3512dedd4..d2e9ee83a 100644 --- a/test/expected/build/application.h/no-minify/sectionsA/customBundle.js +++ b/test/expected/build/application.h/no-minify/sectionsA/customBundle.js @@ -1,7 +1,5 @@ //@ui5-bundle application/h/sectionsA/customBundle.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ +sap.ui.require.preload({ "application/h/sectionsA/section1.js":function(){ sap.ui.define(["sap/m/Button"], function(Button) { console.log("Section 1 included"); @@ -12,5 +10,5 @@ sap.ui.define(["sap/m/Button"], function(Button) { console.log("Section 3 included"); }); } -}}); +}); //# sourceMappingURL=customBundle.js.map diff --git a/test/expected/build/application.h/no-minify/sectionsA/customBundle.js.map b/test/expected/build/application.h/no-minify/sectionsA/customBundle.js.map index fb67f722e..9bc29a29f 100644 --- a/test/expected/build/application.h/no-minify/sectionsA/customBundle.js.map +++ b/test/expected/build/application.h/no-minify/sectionsA/customBundle.js.map @@ -1 +1 @@ -{"version":3,"file":"customBundle.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["customBundle.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["section1.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":10,"column":0},"map":{"version":3,"sources":["section3.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file +{"version":3,"file":"customBundle.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["customBundle.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["section1.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":8,"column":0},"map":{"version":3,"sources":["section3.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.h/no-minify/sectionsB/customBundle.js b/test/expected/build/application.h/no-minify/sectionsB/customBundle.js index ab1c24af1..0966b8950 100644 --- a/test/expected/build/application.h/no-minify/sectionsB/customBundle.js +++ b/test/expected/build/application.h/no-minify/sectionsB/customBundle.js @@ -1,7 +1,5 @@ //@ui5-bundle application/h/sectionsB/customBundle.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ +sap.ui.require.preload({ "application/h/sectionsB/section1.js":function(){ sap.ui.define(["sap/m/Button"], function(Button) { console.log("Section 1 included"); @@ -17,5 +15,5 @@ sap.ui.define(["sap/m/Button"], function(Button) { console.log("Section 3 included"); }); } -}}); +}); //# sourceMappingURL=customBundle.js.map diff --git a/test/expected/build/application.h/no-minify/sectionsB/customBundle.js.map b/test/expected/build/application.h/no-minify/sectionsB/customBundle.js.map index f42d1805c..bf32af899 100644 --- a/test/expected/build/application.h/no-minify/sectionsB/customBundle.js.map +++ b/test/expected/build/application.h/no-minify/sectionsB/customBundle.js.map @@ -1 +1 @@ -{"version":3,"file":"customBundle.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["customBundle.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["section1.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":10,"column":0},"map":{"version":3,"sources":["section2.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":15,"column":0},"map":{"version":3,"sources":["section3.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file +{"version":3,"file":"customBundle.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["customBundle.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["section1.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":8,"column":0},"map":{"version":3,"sources":["section2.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":13,"column":0},"map":{"version":3,"sources":["section3.js"],"mappings":"AAAA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.i/dest/Component-preload.js b/test/expected/build/application.i/dest/Component-preload.js index b974b8084..3faa565a4 100644 --- a/test/expected/build/application.i/dest/Component-preload.js +++ b/test/expected/build/application.i/dest/Component-preload.js @@ -1,7 +1,5 @@ //@ui5-bundle application/i/Component-preload.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ +sap.ui.require.preload({ "application/i/Component.js":function(){ sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.i.Component",{metadata:{manifest:"json"}})}); }, @@ -11,5 +9,5 @@ sap.ui.define([],function(){return{}}); }, "application/i/changes/fragments/MyFragment.fragment.xml":'', "application/i/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.i","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"},"sap.ui5":{"dependencies":{"minUI5Version":"1.72","libs":{"sap.ui.layout":{},"sap.ui.core":{},"sap.m":{},"sap.ui.fl":{}}}}}' -}}); +}); //# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.i/dest/Component-preload.js.map b/test/expected/build/application.i/dest/Component-preload.js.map index adda28edc..dd7d07098 100644 --- a/test/expected/build/application.i/dest/Component-preload.js.map +++ b/test/expected/build/application.i/dest/Component-preload.js.map @@ -1 +1 @@ -{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}},{"offset":{"line":9,"column":0},"map":{"version":3,"sources":["MyExtension-dbg.js"],"names":["sap","ui","define"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,GAAG,WAChB,MAAO","file":"MyExtension.js","sourceRoot":"changes/coding"}}]} \ No newline at end of file +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}},{"offset":{"line":7,"column":0},"map":{"version":3,"sources":["MyExtension-dbg.js"],"names":["sap","ui","define"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,GAAG,WAChB,MAAO","file":"MyExtension.js","sourceRoot":"changes/coding"}}]} \ No newline at end of file diff --git a/test/expected/build/application.j/dest-resources-json/Component-preload.js b/test/expected/build/application.j/dest-resources-json/Component-preload.js index 23cbb1b7d..7e4eadce0 100644 --- a/test/expected/build/application.j/dest-resources-json/Component-preload.js +++ b/test/expected/build/application.j/dest-resources-json/Component-preload.js @@ -1,7 +1,5 @@ //@ui5-bundle application/j/Component-preload.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ +sap.ui.require.preload({ "application/j/Component.js":function(){ sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.j.Component",{metadata:{manifest:"json"}})}); }, @@ -11,5 +9,5 @@ sap.ui.define([],function(){return{}}); "application/j/changes/flexibility-bundle.json":'{"changes":[{"fileName":"id_456_addField","fileType":"change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2023-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}},{"fileName":"id_123_addField","fileType":"change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"CUSTOMER","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"Max Mustermann"}}],"compVariants":[{"fileName":"id_111_compVariants","fileType":"variant","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"},"appDescriptorChange":false}],"variants":[{"fileName":"id_111_test","fileType":"ctrl_variant","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}}],"variantChanges":[{"fileName":"id_111_test","fileType":"ctrl_variant_change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}}],"variantDependentControlChanges":[{"fileName":"id_111_variantDependentControlChange","fileType":"change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"},"variantReference":"someting here"}],"variantManagementChanges":[{"fileName":"id_111_test","fileType":"ctrl_variant_management_change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}}]}', "application/j/changes/fragments/MyFragment.fragment.xml":'', "application/j/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.j","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"},"sap.ui5":{"dependencies":{"minUI5Version":"1.100.2","libs":{"sap.ui.layout":{},"sap.ui.core":{},"sap.m":{},"sap.ui.fl":{"lazy":false}}}}}' -}}); +}); //# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.j/dest-resources-json/Component-preload.js.map b/test/expected/build/application.j/dest-resources-json/Component-preload.js.map index a7bfb3e24..4697c6628 100644 --- a/test/expected/build/application.j/dest-resources-json/Component-preload.js.map +++ b/test/expected/build/application.j/dest-resources-json/Component-preload.js.map @@ -1 +1 @@ -{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}},{"offset":{"line":8,"column":0},"map":{"version":3,"sources":["MyExtension-dbg.js"],"names":["sap","ui","define"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,GAAG,WAChB,MAAO","file":"MyExtension.js","sourceRoot":"changes/coding"}}]} \ No newline at end of file +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}},{"offset":{"line":6,"column":0},"map":{"version":3,"sources":["MyExtension-dbg.js"],"names":["sap","ui","define"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,GAAG,WAChB,MAAO","file":"MyExtension.js","sourceRoot":"changes/coding"}}]} \ No newline at end of file diff --git a/test/expected/build/application.j/dest-resources-json/resources.json b/test/expected/build/application.j/dest-resources-json/resources.json index 268fb7365..1f0f18d89 100644 --- a/test/expected/build/application.j/dest-resources-json/resources.json +++ b/test/expected/build/application.j/dest-resources-json/resources.json @@ -17,7 +17,7 @@ { "name": "Component-preload.js", "module": "application/j/Component-preload.js", - "size": 3731, + "size": 3688, "merged": true, "required": [ "sap/m/library.js", @@ -36,7 +36,7 @@ }, { "name": "Component-preload.js.map", - "size": 836, + "size": 776, "isDebug": true }, { diff --git a/test/expected/build/application.j/dest/Component-preload.js b/test/expected/build/application.j/dest/Component-preload.js index 23cbb1b7d..7e4eadce0 100644 --- a/test/expected/build/application.j/dest/Component-preload.js +++ b/test/expected/build/application.j/dest/Component-preload.js @@ -1,7 +1,5 @@ //@ui5-bundle application/j/Component-preload.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ +sap.ui.require.preload({ "application/j/Component.js":function(){ sap.ui.define(["sap/ui/core/UIComponent"],function(n){"use strict";return n.extend("application.j.Component",{metadata:{manifest:"json"}})}); }, @@ -11,5 +9,5 @@ sap.ui.define([],function(){return{}}); "application/j/changes/flexibility-bundle.json":'{"changes":[{"fileName":"id_456_addField","fileType":"change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2023-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}},{"fileName":"id_123_addField","fileType":"change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"CUSTOMER","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"Max Mustermann"}}],"compVariants":[{"fileName":"id_111_compVariants","fileType":"variant","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"},"appDescriptorChange":false}],"variants":[{"fileName":"id_111_test","fileType":"ctrl_variant","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}}],"variantChanges":[{"fileName":"id_111_test","fileType":"ctrl_variant_change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}}],"variantDependentControlChanges":[{"fileName":"id_111_variantDependentControlChange","fileType":"change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"},"variantReference":"someting here"}],"variantManagementChanges":[{"fileName":"id_111_test","fileType":"ctrl_variant_management_change","changeType":"hideControl","component":"application.j.Component","content":{},"selector":{"id":"control1"},"layer":"VENDOR","texts":{},"namespace":"apps/application.j.Component/changes","creation":"2025-10-30T13:52:40.4754350Z","originalLanguage":"","conditions":{},"support":{"generator":"did it","user":"SAP"}}]}', "application/j/changes/fragments/MyFragment.fragment.xml":'', "application/j/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.j","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"},"sap.ui5":{"dependencies":{"minUI5Version":"1.100.2","libs":{"sap.ui.layout":{},"sap.ui.core":{},"sap.m":{},"sap.ui.fl":{"lazy":false}}}}}' -}}); +}); //# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.j/dest/Component-preload.js.map b/test/expected/build/application.j/dest/Component-preload.js.map index a7bfb3e24..4697c6628 100644 --- a/test/expected/build/application.j/dest/Component-preload.js.map +++ b/test/expected/build/application.j/dest/Component-preload.js.map @@ -1 +1 @@ -{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}},{"offset":{"line":8,"column":0},"map":{"version":3,"sources":["MyExtension-dbg.js"],"names":["sap","ui","define"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,GAAG,WAChB,MAAO","file":"MyExtension.js","sourceRoot":"changes/coding"}}]} \ No newline at end of file +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component-dbg.js"],"names":["sap","ui","define","UIComponent","extend","metadata","manifest"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,CAAC,2BAA4B,SAASC,GACnD,aACA,OAAOA,EAAYC,OAAO,0BAA2B,CACpDC,SAAU,CACTC,SAAU","file":"Component.js","sourceRoot":""}},{"offset":{"line":6,"column":0},"map":{"version":3,"sources":["MyExtension-dbg.js"],"names":["sap","ui","define"],"mappings":"AAAAA,IAAIC,GAAGC,OAAO,GAAG,WAChB,MAAO","file":"MyExtension.js","sourceRoot":"changes/coding"}}]} \ No newline at end of file diff --git a/test/expected/build/application.k/dest-package-subcomponents/Component-preload.js b/test/expected/build/application.k/dest-package-subcomponents/Component-preload.js index 07f1270d6..35422ab9a 100644 --- a/test/expected/build/application.k/dest-package-subcomponents/Component-preload.js +++ b/test/expected/build/application.k/dest-package-subcomponents/Component-preload.js @@ -1,7 +1,5 @@ //@ui5-bundle application/k/Component-preload.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ +sap.ui.require.preload({ "application/k/Component.js":function(){ sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ "use strict"; @@ -38,5 +36,5 @@ sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ "application/k/subcomponentB/thirdparty/lib.js":function(){ console.log("subcomponentB/thirdparty/lib.js"); } -}}); +}); //# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.k/dest-package-subcomponents/Component-preload.js.map b/test/expected/build/application.k/dest-package-subcomponents/Component-preload.js.map index 721564654..4931f0ded 100644 --- a/test/expected/build/application.k/dest-package-subcomponents/Component-preload.js.map +++ b/test/expected/build/application.k/dest-package-subcomponents/Component-preload.js.map @@ -1 +1 @@ -{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":16,"column":0},"map":{"version":3,"sources":["Component.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourceRoot":"subcomponentA"}},{"offset":{"line":27,"column":0},"map":{"version":3,"sources":["Component.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourceRoot":"subcomponentB"}},{"offset":{"line":38,"column":0},"map":{"version":3,"sources":["lib.js"],"mappings":"AAAA;AACA","sourceRoot":"subcomponentB/thirdparty"}}]} \ No newline at end of file +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":14,"column":0},"map":{"version":3,"sources":["Component.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourceRoot":"subcomponentA"}},{"offset":{"line":25,"column":0},"map":{"version":3,"sources":["Component.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourceRoot":"subcomponentB"}},{"offset":{"line":36,"column":0},"map":{"version":3,"sources":["lib.js"],"mappings":"AAAA;AACA","sourceRoot":"subcomponentB/thirdparty"}}]} \ No newline at end of file diff --git a/test/expected/build/application.k/dest/Component-preload.js b/test/expected/build/application.k/dest/Component-preload.js index 9eefb8942..619739027 100644 --- a/test/expected/build/application.k/dest/Component-preload.js +++ b/test/expected/build/application.k/dest/Component-preload.js @@ -1,7 +1,5 @@ //@ui5-bundle application/k/Component-preload.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ +sap.ui.require.preload({ "application/k/Component.js":function(){ sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ "use strict"; @@ -13,5 +11,5 @@ sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ }); }, "application/k/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.k","type":"application","applicationVersion":{"version":"${version}"},"embeds":["embedded"],"title":"{{title}}"},"customCopyrightString":"${copyright}"}' -}}); +}); //# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.k/dest/Component-preload.js.map b/test/expected/build/application.k/dest/Component-preload.js.map index 61c83ce28..bdf7961dc 100644 --- a/test/expected/build/application.k/dest/Component-preload.js.map +++ b/test/expected/build/application.k/dest/Component-preload.js.map @@ -1 +1 @@ -{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.k/dest/subcomponentA/Component-preload.js b/test/expected/build/application.k/dest/subcomponentA/Component-preload.js index cb50c4d55..a096cb54d 100644 --- a/test/expected/build/application.k/dest/subcomponentA/Component-preload.js +++ b/test/expected/build/application.k/dest/subcomponentA/Component-preload.js @@ -1,7 +1,5 @@ //@ui5-bundle application/k/subcomponentA/Component-preload.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ +sap.ui.require.preload({ "application/k/subcomponentA/Component.js":function(){ sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ "use strict"; @@ -13,5 +11,5 @@ sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ }); }, "application/k/subcomponentA/manifest.json":'{"_version":"1.1.0","sap.app":{"_version":"1.1.0","id":"application.k.subcomponentA","type":"application","applicationVersion":{"version":"1.2.2"},"embeds":["embedded"],"title":"{{title}}"}}' -}}); +}); //# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.k/dest/subcomponentA/Component-preload.js.map b/test/expected/build/application.k/dest/subcomponentA/Component-preload.js.map index 61c83ce28..bdf7961dc 100644 --- a/test/expected/build/application.k/dest/subcomponentA/Component-preload.js.map +++ b/test/expected/build/application.k/dest/subcomponentA/Component-preload.js.map @@ -1 +1 @@ -{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/expected/build/application.k/dest/subcomponentB/Component-preload.js b/test/expected/build/application.k/dest/subcomponentB/Component-preload.js index e09fbb22e..7af57880b 100644 --- a/test/expected/build/application.k/dest/subcomponentB/Component-preload.js +++ b/test/expected/build/application.k/dest/subcomponentB/Component-preload.js @@ -1,7 +1,5 @@ //@ui5-bundle application/k/subcomponentB/Component-preload.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ +sap.ui.require.preload({ "application/k/subcomponentB/Component.js":function(){ sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ "use strict"; @@ -16,5 +14,5 @@ sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent){ "application/k/subcomponentB/thirdparty/lib.js":function(){ console.log("subcomponentB/thirdparty/lib.js"); } -}}); +}); //# sourceMappingURL=Component-preload.js.map diff --git a/test/expected/build/application.k/dest/subcomponentB/Component-preload.js.map b/test/expected/build/application.k/dest/subcomponentB/Component-preload.js.map index 555d13778..be0090fdf 100644 --- a/test/expected/build/application.k/dest/subcomponentB/Component-preload.js.map +++ b/test/expected/build/application.k/dest/subcomponentB/Component-preload.js.map @@ -1 +1 @@ -{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["Component.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":16,"column":0},"map":{"version":3,"sources":["lib.js"],"mappings":"AAAA;AACA","sourceRoot":"thirdparty"}}]} \ No newline at end of file +{"version":3,"file":"Component-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["Component-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["Component.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourceRoot":""}},{"offset":{"line":14,"column":0},"map":{"version":3,"sources":["lib.js"],"mappings":"AAAA;AACA","sourceRoot":"thirdparty"}}]} \ No newline at end of file diff --git a/test/expected/build/library.d/preload/resources/library/d/library-preload.js b/test/expected/build/library.d/preload/resources/library/d/library-preload.js index 12b0a1cb5..4a740e861 100644 --- a/test/expected/build/library.d/preload/resources/library/d/library-preload.js +++ b/test/expected/build/library.d/preload/resources/library/d/library-preload.js @@ -1,7 +1,5 @@ //@ui5-bundle library/d/library-preload.js -jQuery.sap.registerPreloadedModules({ -"version":"2.0", -"modules":{ +sap.ui.require.preload({ "library/d/some.js":function(){ /*! * ${copyright} @@ -11,5 +9,5 @@ jQuery.sap.registerPreloadedModules({ console.log('Hello ' + someNonUglifiedVariable); })(); } -}}); +}); //# sourceMappingURL=library-preload.js.map diff --git a/test/expected/build/library.d/preload/resources/library/d/library-preload.js.map b/test/expected/build/library.d/preload/resources/library/d/library-preload.js.map index 75adb2fe2..fe612c788 100644 --- a/test/expected/build/library.d/preload/resources/library/d/library-preload.js.map +++ b/test/expected/build/library.d/preload/resources/library/d/library-preload.js.map @@ -1 +1 @@ -{"version":3,"file":"library-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["library-preload.js?bundle-code-0"],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["jQuery.sap.registerPreloadedModules({\n\"version\":\"2.0\",\n\"modules\":{\n"],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"sources":["some.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file +{"version":3,"file":"library-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"sources":["library-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"sources":["some.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourceRoot":""}}]} \ No newline at end of file diff --git a/test/lib/lbt/bundle/Builder.js b/test/lib/lbt/bundle/Builder.js index 19dd58518..974440161 100644 --- a/test/lib/lbt/bundle/Builder.js +++ b/test/lib/lbt/bundle/Builder.js @@ -110,6 +110,7 @@ test("integration: createBundle with exposedGlobals", async (t) => { const oResult = await builder.createBundle(bundleDefinition, {numberOfParts: 1, decorateBootstrapModule: true}); t.deepEqual(oResult.name, "library-preload.js"); const expectedContent = `//@ui5-bundle library-preload.js +window["sap-ui-optimized"] = true; sap.ui.require.preload({ "a.js":function(){ function One(){return 1;} @@ -523,7 +524,7 @@ ${SOURCE_MAPPING_URL}=bootstrap.js.map "bundle info subModules are correct"); }); -test("integration: createBundle UI5BundleFormat (non ui5loader.js)", async (t) => { +test("integration: Legacy test: createBundle without ui5loader.js presence also uses modern API", async (t) => { const pool = new ResourcePool(); pool.addResource({ name: "sap-ui-core.js", @@ -572,14 +573,11 @@ test("integration: createBundle UI5BundleFormat (non ui5loader.js)", async (t) = const oResult = await builder.createBundle(bundleDefinition, {numberOfParts: 1, decorateBootstrapModule: true}); t.deepEqual(oResult.name, "Component-preload.js"); const expectedContent = `//@ui5-bundle Component-preload.js -jQuery.sap.registerPreloadedModules({ -"name":"preload-section", -"version":"2.0", -"modules":{ +sap.ui.require.preload({ "jquery.sap.global-dbg.js":function(){ sap.ui.define([], function(){/* comment */ return {};}); } -}}); +},"preload-section"); //@ui5-bundle-raw-include myModule.js (function(){window.mine = {};}()); sap.ui.requireSync("sap-ui-core"); @@ -767,6 +765,7 @@ test.serial("integration: createBundle with bundleInfo", async (t) => { const oResult = await builder.createBundle(bundleDefinition, {numberOfParts: 1, decorateBootstrapModule: true}); t.deepEqual(oResult.name, "library-preload.js"); const expectedContent = `//@ui5-bundle library-preload.js +window["sap-ui-optimized"] = true; sap.ui.require.preload({ "a.js":function(){ function One(){return 1;} diff --git a/test/lib/tasks/bundlers/generateComponentPreload.js b/test/lib/tasks/bundlers/generateComponentPreload.js index 4cd92f9a9..58a93f448 100644 --- a/test/lib/tasks/bundlers/generateComponentPreload.js +++ b/test/lib/tasks/bundlers/generateComponentPreload.js @@ -15,16 +15,10 @@ test.beforeEach((t) => { byGlob: sinon.stub().resolves([]), write: sinon.stub().resolves() }; - t.context.dependencies = {}; - t.context.comboByGlob = sinon.stub().resolves([]); + t.context.workspace.filter = () => t.context.workspace; - t.context.ReaderCollectionPrioritizedStub = sinon.stub(); - t.context.ReaderCollectionPrioritizedStub.returns({ - byGlob: t.context.comboByGlob - }); - mock("@ui5/fs", { - ReaderCollectionPrioritized: t.context.ReaderCollectionPrioritizedStub - }); + t.context.dependencies = {}; + t.context.byGlob = t.context.workspace.byGlob; t.context.moduleBundlerStub = sinon.stub().resolves([]); mock("../../../../lib/processors/bundlers/moduleBundler", t.context.moduleBundlerStub); @@ -39,14 +33,14 @@ test.afterEach.always(() => { test.serial("generateComponentPreload - one namespace", async (t) => { const { - generateComponentPreload, moduleBundlerStub, ReaderCollectionPrioritizedStub, - workspace, dependencies, comboByGlob + generateComponentPreload, moduleBundlerStub, + workspace, dependencies, byGlob } = t.context; const resources = [ {"fake": "resource"} ]; - comboByGlob.resolves(resources); + byGlob.resolves(resources); moduleBundlerStub.resolves([ { @@ -105,16 +99,11 @@ test.serial("generateComponentPreload - one namespace", async (t) => { resources }]); - t.is(comboByGlob.callCount, 1, + t.is(byGlob.callCount, 1, "combo.byGlob should have been called once"); - t.deepEqual(comboByGlob.getCall(0).args, ["/resources/**/*.{js,json,xml,html,properties,library,js.map}"], + t.deepEqual(byGlob.getCall(0).args, ["/resources/**/*.{js,json,xml,html,properties,library,js.map}"], "combo.byGlob should have been called with expected pattern"); - t.is(ReaderCollectionPrioritizedStub.callCount, 1, - "ReaderCollectionPrioritized should have been called once"); - t.true(ReaderCollectionPrioritizedStub.calledWithNew(), - "ReaderCollectionPrioritized should have been called with 'new'"); - const bundleResources = await moduleBundlerStub.getCall(0).returnValue; t.is(workspace.write.callCount, 2, "workspace.write should have been called twice"); @@ -130,14 +119,14 @@ test.serial("generateComponentPreload - one namespace", async (t) => { test.serial("generateComponentPreload - one namespace - excludes", async (t) => { const { - generateComponentPreload, moduleBundlerStub, ReaderCollectionPrioritizedStub, - workspace, dependencies, comboByGlob + generateComponentPreload, moduleBundlerStub, + workspace, dependencies, byGlob } = t.context; const resources = [ {"fake": "resource"} ]; - comboByGlob.resolves(resources); + byGlob.resolves(resources); moduleBundlerStub.resolves([ { @@ -202,16 +191,11 @@ test.serial("generateComponentPreload - one namespace - excludes", async (t) => resources }]); - t.is(comboByGlob.callCount, 1, + t.is(byGlob.callCount, 1, "combo.byGlob should have been called once"); - t.deepEqual(comboByGlob.getCall(0).args, ["/resources/**/*.{js,json,xml,html,properties,library,js.map}"], + t.deepEqual(byGlob.getCall(0).args, ["/resources/**/*.{js,json,xml,html,properties,library,js.map}"], "combo.byGlob should have been called with expected pattern"); - t.is(ReaderCollectionPrioritizedStub.callCount, 1, - "ReaderCollectionPrioritized should have been called once"); - t.true(ReaderCollectionPrioritizedStub.calledWithNew(), - "ReaderCollectionPrioritized should have been called with 'new'"); - const bundleResources = await moduleBundlerStub.getCall(0).returnValue; t.is(workspace.write.callCount, 2, "workspace.write should have been called twice"); @@ -227,14 +211,14 @@ test.serial("generateComponentPreload - one namespace - excludes", async (t) => test.serial("generateComponentPreload - one namespace - excludes w/o namespace", async (t) => { const { - generateComponentPreload, moduleBundlerStub, ReaderCollectionPrioritizedStub, - workspace, dependencies, comboByGlob + generateComponentPreload, moduleBundlerStub, + workspace, dependencies, byGlob } = t.context; const resources = [ {"fake": "resource"} ]; - comboByGlob.resolves(resources); + byGlob.resolves(resources); moduleBundlerStub.resolves([ { @@ -298,16 +282,11 @@ test.serial("generateComponentPreload - one namespace - excludes w/o namespace", resources }]); - t.is(comboByGlob.callCount, 1, + t.is(byGlob.callCount, 1, "combo.byGlob should have been called once"); - t.deepEqual(comboByGlob.getCall(0).args, ["/resources/**/*.{js,json,xml,html,properties,library,js.map}"], + t.deepEqual(byGlob.getCall(0).args, ["/resources/**/*.{js,json,xml,html,properties,library,js.map}"], "combo.byGlob should have been called with expected pattern"); - t.is(ReaderCollectionPrioritizedStub.callCount, 1, - "ReaderCollectionPrioritized should have been called once"); - t.true(ReaderCollectionPrioritizedStub.calledWithNew(), - "ReaderCollectionPrioritized should have been called with 'new'"); - const bundleResources = await moduleBundlerStub.getCall(0).returnValue; t.is(workspace.write.callCount, 2, "workspace.write should have been called twice"); @@ -323,14 +302,14 @@ test.serial("generateComponentPreload - one namespace - excludes w/o namespace", test.serial("generateComponentPreload - multiple namespaces - excludes", async (t) => { const { - generateComponentPreload, moduleBundlerStub, ReaderCollectionPrioritizedStub, - workspace, dependencies, comboByGlob + generateComponentPreload, moduleBundlerStub, + workspace, dependencies, byGlob } = t.context; const resources = [ {"fake": "resource"} ]; - comboByGlob.resolves(resources); + byGlob.resolves(resources); moduleBundlerStub.onFirstCall().resolves([ { @@ -449,16 +428,11 @@ test.serial("generateComponentPreload - multiple namespaces - excludes", async ( resources }]); - t.is(comboByGlob.callCount, 1, + t.is(byGlob.callCount, 1, "combo.byGlob should have been called once"); - t.deepEqual(comboByGlob.getCall(0).args, ["/resources/**/*.{js,json,xml,html,properties,library,js.map}"], + t.deepEqual(byGlob.getCall(0).args, ["/resources/**/*.{js,json,xml,html,properties,library,js.map}"], "combo.byGlob should have been called with expected pattern"); - t.is(ReaderCollectionPrioritizedStub.callCount, 1, - "ReaderCollectionPrioritized should have been called once"); - t.true(ReaderCollectionPrioritizedStub.calledWithNew(), - "ReaderCollectionPrioritized should have been called with 'new'"); - const bundleObj1 = await moduleBundlerStub.getCall(0).returnValue; const bundleObj2 = await moduleBundlerStub.getCall(1).returnValue; @@ -487,14 +461,14 @@ test.serial("generateComponentPreload - multiple namespaces - excludes", async ( test.serial("generateComponentPreload - one namespace - invalid exclude", async (t) => { const { generateComponentPreload, - workspace, dependencies, comboByGlob, + workspace, dependencies, byGlob, log } = t.context; const resources = [ {"fake": "resource"} ]; - comboByGlob.resolves(resources); + byGlob.resolves(resources); await generateComponentPreload({ workspace, @@ -525,14 +499,14 @@ test.serial("generateComponentPreload - one namespace - invalid exclude", async test.serial("generateComponentPreload - nested namespaces - excludes", async (t) => { const { generateComponentPreload, moduleBundlerStub, - workspace, dependencies, comboByGlob, + workspace, dependencies, byGlob, log } = t.context; const resources = [ {"fake": "resource"} ]; - comboByGlob.resolves(resources); + byGlob.resolves(resources); await generateComponentPreload({ workspace, diff --git a/test/lib/tasks/bundlers/generateLibraryPreload.js b/test/lib/tasks/bundlers/generateLibraryPreload.js index 4130f7098..624626f9b 100644 --- a/test/lib/tasks/bundlers/generateLibraryPreload.js +++ b/test/lib/tasks/bundlers/generateLibraryPreload.js @@ -15,19 +15,10 @@ test.beforeEach((t) => { byGlob: sinon.stub().resolves([]), write: sinon.stub().resolves() }; - t.context.dependencies = {}; - t.context.comboByGlob = sinon.stub().resolves([]); - - t.context.combo = { - byGlob: t.context.comboByGlob, - }; - t.context.combo.filter = sinon.stub().returns(t.context.combo); + t.context.workspace.filter = () => t.context.workspace; - t.context.ReaderCollectionPrioritizedStub = sinon.stub(); - t.context.ReaderCollectionPrioritizedStub.returns(t.context.combo); - mock("@ui5/fs", { - ReaderCollectionPrioritized: t.context.ReaderCollectionPrioritizedStub - }); + t.context.dependencies = {}; + t.context.firstByGlob = t.context.workspace.byGlob.onFirstCall(); t.context.moduleBundlerStub = sinon.stub().resolves([]); mock("../../../../lib/processors/bundlers/moduleBundler", t.context.moduleBundlerStub); @@ -42,14 +33,14 @@ test.afterEach.always(() => { test.serial("generateLibraryPreload", async (t) => { const { - generateLibraryPreload, moduleBundlerStub, ReaderCollectionPrioritizedStub, - workspace, dependencies, comboByGlob + generateLibraryPreload, moduleBundlerStub, + workspace, dependencies, firstByGlob } = t.context; const resources = [ {getPath: sinon.stub().returns("/resources/my/lib/.library")} ]; - comboByGlob.resolves(resources); + firstByGlob.resolves(resources); workspace.byGlob.resolves([ {getPath: sinon.stub().returns("/resources/my/lib/.library")} @@ -150,28 +141,25 @@ test.serial("generateLibraryPreload", async (t) => { resources }]); - t.is(workspace.byGlob.callCount, 1, - "workspace.byGlob should have been called once"); - t.deepEqual(workspace.byGlob.getCall(0).args, ["/resources/**/.library"], + t.is(workspace.byGlob.callCount, 2, + "workspace.byGlob should have been called twice"); + t.deepEqual(workspace.byGlob.getCall(0).args, ["/**/*.{js,json,xml,html,properties,library,js.map}"], + "workspace.byGlob should have been called with expected pattern"); + t.deepEqual(workspace.byGlob.getCall(1).args, ["/resources/**/.library"], "workspace.byGlob should have been called with expected pattern"); - - t.is(ReaderCollectionPrioritizedStub.callCount, 1, - "ReaderCollectionPrioritized should have been called once"); - t.true(ReaderCollectionPrioritizedStub.calledWithNew(), - "ReaderCollectionPrioritized should have been called with 'new'"); }); test.serial("generateLibraryPreload for sap.ui.core (w/o ui5loader.js)", async (t) => { const { - generateLibraryPreload, moduleBundlerStub, ReaderCollectionPrioritizedStub, - workspace, dependencies, comboByGlob + generateLibraryPreload, moduleBundlerStub, + workspace, dependencies, firstByGlob } = t.context; const resources = [ {getPath: sinon.stub().returns("/resources/sap/ui/core/.library")}, {getPath: sinon.stub().returns("/resources/sap-ui-core.js")} ]; - comboByGlob.resolves(resources); + firstByGlob.resolves(resources); workspace.byGlob.resolves([ {getPath: sinon.stub().returns("/resources/sap/ui/core/.library")} @@ -408,22 +396,19 @@ test.serial("generateLibraryPreload for sap.ui.core (w/o ui5loader.js)", async ( resources }]); - t.is(workspace.byGlob.callCount, 1, - "workspace.byGlob should have been called once"); - t.deepEqual(workspace.byGlob.getCall(0).args, ["/resources/**/.library"], + t.is(workspace.byGlob.callCount, 2, + "workspace.byGlob should have been called twice"); + t.deepEqual(workspace.byGlob.getCall(0).args, ["/**/*.{js,json,xml,html,properties,library,js.map}"], + "workspace.byGlob should have been called with expected pattern"); + t.deepEqual(workspace.byGlob.getCall(1).args, ["/resources/**/.library"], "workspace.byGlob should have been called with expected pattern"); - - t.is(ReaderCollectionPrioritizedStub.callCount, 1, - "ReaderCollectionPrioritized should have been called once"); - t.true(ReaderCollectionPrioritizedStub.calledWithNew(), - "ReaderCollectionPrioritized should have been called with 'new'"); }); test.serial("generateLibraryPreload for sap.ui.core (/w ui5loader.js)", async (t) => { const { - generateLibraryPreload, moduleBundlerStub, ReaderCollectionPrioritizedStub, - workspace, dependencies, comboByGlob + generateLibraryPreload, moduleBundlerStub, + workspace, dependencies, firstByGlob } = t.context; const resources = [ @@ -431,7 +416,7 @@ test.serial("generateLibraryPreload for sap.ui.core (/w ui5loader.js)", async (t {getPath: sinon.stub().returns("/resources/ui5loader.js")}, {getPath: sinon.stub().returns("/resources/sap-ui-core.js")} ]; - comboByGlob.resolves(resources); + firstByGlob.resolves(resources); workspace.byGlob.resolves([ {getPath: sinon.stub().returns("/resources/sap/ui/core/.library")} @@ -724,21 +709,18 @@ test.serial("generateLibraryPreload for sap.ui.core (/w ui5loader.js)", async (t resources }]); - t.is(workspace.byGlob.callCount, 1, - "workspace.byGlob should have been called once"); - t.deepEqual(workspace.byGlob.getCall(0).args, ["/resources/**/.library"], + t.is(workspace.byGlob.callCount, 2, + "workspace.byGlob should have been called twice"); + t.deepEqual(workspace.byGlob.getCall(0).args, ["/**/*.{js,json,xml,html,properties,library,js.map}"], + "workspace.byGlob should have been called with expected pattern"); + t.deepEqual(workspace.byGlob.getCall(1).args, ["/resources/**/.library"], "workspace.byGlob should have been called with expected pattern"); - - t.is(ReaderCollectionPrioritizedStub.callCount, 1, - "ReaderCollectionPrioritized should have been called once"); - t.true(ReaderCollectionPrioritizedStub.calledWithNew(), - "ReaderCollectionPrioritized should have been called with 'new'"); }); test.serial("generateLibraryPreload for sap.ui.core with old specVersion defined (/w ui5loader.js)", async (t) => { const { - generateLibraryPreload, moduleBundlerStub, ReaderCollectionPrioritizedStub, - workspace, dependencies, comboByGlob + generateLibraryPreload, moduleBundlerStub, + workspace, dependencies, firstByGlob } = t.context; const coreProject = { @@ -749,7 +731,7 @@ test.serial("generateLibraryPreload for sap.ui.core with old specVersion defined {getPath: sinon.stub().returns("/resources/ui5loader.js")}, {getPath: sinon.stub().returns("/resources/sap-ui-core.js")} ]; - comboByGlob.resolves(resources); + firstByGlob.resolves(resources); workspace.byGlob.resolves([ {getPath: sinon.stub().returns("/resources/sap/ui/core/.library")} @@ -1042,21 +1024,18 @@ test.serial("generateLibraryPreload for sap.ui.core with old specVersion defined resources }]); - t.is(workspace.byGlob.callCount, 1, - "workspace.byGlob should have been called once"); - t.deepEqual(workspace.byGlob.getCall(0).args, ["/resources/**/.library"], + t.is(workspace.byGlob.callCount, 2, + "workspace.byGlob should have been called twice"); + t.deepEqual(workspace.byGlob.getCall(0).args, ["/**/*.{js,json,xml,html,properties,library,js.map}"], + "workspace.byGlob should have been called with expected pattern"); + t.deepEqual(workspace.byGlob.getCall(1).args, ["/resources/**/.library"], "workspace.byGlob should have been called with expected pattern"); - - t.is(ReaderCollectionPrioritizedStub.callCount, 1, - "ReaderCollectionPrioritized should have been called once"); - t.true(ReaderCollectionPrioritizedStub.calledWithNew(), - "ReaderCollectionPrioritized should have been called with 'new'"); }); test.serial("generateLibraryPreload for sap.ui.core with own bundle configuration (w/o ui5loader.js)", async (t) => { const { - generateLibraryPreload, moduleBundlerStub, ReaderCollectionPrioritizedStub, - workspace, dependencies, comboByGlob + generateLibraryPreload, moduleBundlerStub, + workspace, dependencies, firstByGlob } = t.context; const coreProject = { @@ -1066,7 +1045,7 @@ test.serial("generateLibraryPreload for sap.ui.core with own bundle configuratio {getPath: sinon.stub().returns("/resources/sap/ui/core/.library"), _project: coreProject}, {getPath: sinon.stub().returns("/resources/sap-ui-core.js")} ]; - comboByGlob.resolves(resources); + firstByGlob.resolves(resources); workspace.byGlob.resolves([ {getPath: sinon.stub().returns("/resources/sap/ui/core/.library")} @@ -1197,21 +1176,18 @@ test.serial("generateLibraryPreload for sap.ui.core with own bundle configuratio resources }]); - t.is(workspace.byGlob.callCount, 1, - "workspace.byGlob should have been called once"); - t.deepEqual(workspace.byGlob.getCall(0).args, ["/resources/**/.library"], + t.is(workspace.byGlob.callCount, 2, + "workspace.byGlob should have been called twice"); + t.deepEqual(workspace.byGlob.getCall(0).args, ["/**/*.{js,json,xml,html,properties,library,js.map}"], + "workspace.byGlob should have been called with expected pattern"); + t.deepEqual(workspace.byGlob.getCall(1).args, ["/resources/**/.library"], "workspace.byGlob should have been called with expected pattern"); - - t.is(ReaderCollectionPrioritizedStub.callCount, 1, - "ReaderCollectionPrioritized should have been called once"); - t.true(ReaderCollectionPrioritizedStub.calledWithNew(), - "ReaderCollectionPrioritized should have been called with 'new'"); }); test.serial("generateLibraryPreload for sap.ui.core with own bundle configuration (/w ui5loader.js)", async (t) => { const { - generateLibraryPreload, moduleBundlerStub, ReaderCollectionPrioritizedStub, - workspace, dependencies, comboByGlob + generateLibraryPreload, moduleBundlerStub, + workspace, dependencies, firstByGlob } = t.context; const coreProject = { @@ -1222,7 +1198,7 @@ test.serial("generateLibraryPreload for sap.ui.core with own bundle configuratio {getPath: sinon.stub().returns("/resources/ui5loader.js")}, {getPath: sinon.stub().returns("/resources/sap-ui-core.js")} ]; - comboByGlob.resolves(resources); + firstByGlob.resolves(resources); workspace.byGlob.resolves([ {getPath: sinon.stub().returns("/resources/sap/ui/core/.library")} @@ -1353,26 +1329,24 @@ test.serial("generateLibraryPreload for sap.ui.core with own bundle configuratio resources }]); - t.is(workspace.byGlob.callCount, 1, - "workspace.byGlob should have been called once"); - t.deepEqual(workspace.byGlob.getCall(0).args, ["/resources/**/.library"], + t.is(workspace.byGlob.callCount, 2, + "workspace.byGlob should have been called twice"); + t.deepEqual(workspace.byGlob.getCall(0).args, ["/**/*.{js,json,xml,html,properties,library,js.map}"], + "workspace.byGlob should have been called with expected pattern"); + t.deepEqual(workspace.byGlob.getCall(1).args, ["/resources/**/.library"], "workspace.byGlob should have been called with expected pattern"); - - t.is(ReaderCollectionPrioritizedStub.callCount, 1, - "ReaderCollectionPrioritized should have been called once"); - t.true(ReaderCollectionPrioritizedStub.calledWithNew(), - "ReaderCollectionPrioritized should have been called with 'new'"); }); test.serial("Error: Failed to resolve non-debug name", async (t) => { const { generateLibraryPreload, - workspace, dependencies, comboByGlob + workspace, dependencies } = t.context; const resources = [ {getPath: sinon.stub().returns("/resources/resource-tagged-as-debug-variant.js")} ]; - comboByGlob.resolves(resources); + t.context.workspace.byGlob.onFirstCall().resolves(resources); + t.context.workspace.byGlob.onSecondCall().resolves(resources); workspace.byGlob.resolves([ {getPath: sinon.stub().returns("/resources/sap/ui/core/.library")} @@ -1406,14 +1380,14 @@ test.serial("Error: Failed to resolve non-debug name", async (t) => { test.serial("generateLibraryPreload with excludes", async (t) => { const { - generateLibraryPreload, moduleBundlerStub, ReaderCollectionPrioritizedStub, - workspace, dependencies, comboByGlob + generateLibraryPreload, moduleBundlerStub, + workspace, dependencies, firstByGlob } = t.context; const resources = [ {getPath: sinon.stub().returns("/resources/my/lib/.library")} ]; - comboByGlob.resolves(resources); + firstByGlob.resolves(resources); workspace.byGlob.resolves([ {getPath: sinon.stub().returns("/resources/my/lib/.library")} @@ -1466,28 +1440,25 @@ test.serial("generateLibraryPreload with excludes", async (t) => { resources }]); - t.is(workspace.byGlob.callCount, 1, - "workspace.byGlob should have been called once"); - t.deepEqual(workspace.byGlob.getCall(0).args, ["/resources/**/.library"], + t.is(workspace.byGlob.callCount, 2, + "workspace.byGlob should have been called twice"); + t.deepEqual(workspace.byGlob.getCall(0).args, ["/**/*.{js,json,xml,html,properties,library,js.map}"], + "workspace.byGlob should have been called with expected pattern"); + t.deepEqual(workspace.byGlob.getCall(1).args, ["/resources/**/.library"], "workspace.byGlob should have been called with expected pattern"); - - t.is(ReaderCollectionPrioritizedStub.callCount, 1, - "ReaderCollectionPrioritized should have been called once"); - t.true(ReaderCollectionPrioritizedStub.calledWithNew(), - "ReaderCollectionPrioritized should have been called with 'new'"); }); test.serial("generateLibraryPreload with invalid excludes", async (t) => { const { generateLibraryPreload, moduleBundlerStub, - workspace, dependencies, comboByGlob, log + workspace, dependencies, firstByGlob, log } = t.context; const resources = [ {getPath: sinon.stub().returns("/resources/my/lib/.library")} ]; - comboByGlob.resolves(resources); + firstByGlob.resolves(resources); workspace.byGlob.resolves([ {getPath: sinon.stub().returns("/resources/my/lib/.library")}