This repository has been archived by the owner on May 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from SAP/new-preload-format
Usage of sap.ui.require.preload for library-preload.js >=1.54
- Loading branch information
Showing
16 changed files
with
169 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
test/preload/expected/component_compat_140/my/app/Component-preload.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
jQuery.sap.registerPreloadedModules({ | ||
"version": "2.0", | ||
"name": "my/app/Component-preload", | ||
"modules": { | ||
"my/app/Component.js": "/* © */\n\"use strict\";function myFunction(n,o){return n+o}/**\n* This is a copyright comment\n*/\n/* (c) */\n/* released under */\n/* license */\nconsole.log(\"myJS\");", | ||
"my/app/view/my.view.xml": "<my>XML</my>\n", | ||
"my/app/view/myHtmlPre.view.xml": "<my>XML</my>\n<!-- A comment in XML is the same as in HTML -->\n<html:pre> </html:pre>" | ||
} | ||
}); |
5 changes: 5 additions & 0 deletions
5
test/preload/expected/component_compat_154/my/app/Component-preload.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
sap.ui.require.preload({ | ||
"my/app/Component.js": "/* © */\n\"use strict\";function myFunction(n,o){return n+o}/**\n* This is a copyright comment\n*/\n/* (c) */\n/* released under */\n/* license */\nconsole.log(\"myJS\");", | ||
"my/app/view/my.view.xml": "<my>XML</my>\n", | ||
"my/app/view/myHtmlPre.view.xml": "<my>XML</my>\n<!-- A comment in XML is the same as in HTML -->\n<html:pre> </html:pre>" | ||
}, "my/app/Component-preload"); |
14 changes: 5 additions & 9 deletions
14
test/preload/expected/component_default_options/my/app/Component-preload.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
jQuery.sap.registerPreloadedModules({ | ||
"version": "2.0", | ||
"name": "my/app/Component-preload", | ||
"modules": { | ||
"my/app/Component.js": "/* © */\n\"use strict\";function myFunction(n,o){return n+o}/**\n* This is a copyright comment\n*/\n/* (c) */\n/* released under */\n/* license */\nconsole.log(\"myJS\");", | ||
"my/app/view/my.view.xml": "<my>XML</my>\n", | ||
"my/app/view/myHtmlPre.view.xml": "<my>XML</my>\n<!-- A comment in XML is the same as in HTML -->\n<html:pre> </html:pre>" | ||
} | ||
}); | ||
sap.ui.require.preload({ | ||
"my/app/Component.js": "/* © */\n\"use strict\";function myFunction(n,o){return n+o}/**\n* This is a copyright comment\n*/\n/* (c) */\n/* released under */\n/* license */\nconsole.log(\"myJS\");", | ||
"my/app/view/my.view.xml": "<my>XML</my>\n", | ||
"my/app/view/myHtmlPre.view.xml": "<my>XML</my>\n<!-- A comment in XML is the same as in HTML -->\n<html:pre> </html:pre>" | ||
}, "my/app/Component-preload"); |
14 changes: 5 additions & 9 deletions
14
test/preload/expected/component_no_compress/my/app/Component-preload.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
jQuery.sap.registerPreloadedModules({ | ||
"version": "2.0", | ||
"name": "my/app/Component-preload", | ||
"modules": { | ||
"my/app/Component.js": "/* © */\n'use strict';\n\n/**\n* This is a copyright comment\n*/\n\n/* (c) */\n\n/* released under */\n/* normal comment */\n/* license */\n\n\nconsole.log('myJS');\n\n/**\n * This is a little comment\n */\nfunction myFunction(longVariableName, longerVariableName) {\n\treturn longVariableName + longerVariableName;\n}\n", | ||
"my/app/view/my.view.xml": "<my>XML</my>\n<!-- A comment in XML is the same as in HTML -->", | ||
"my/app/view/myHtmlPre.view.xml": "<my>XML</my>\n<!-- A comment in XML is the same as in HTML -->\n<html:pre> </html:pre>" | ||
} | ||
}); | ||
sap.ui.require.preload({ | ||
"my/app/Component.js": "/* © */\n'use strict';\n\n/**\n* This is a copyright comment\n*/\n\n/* (c) */\n\n/* released under */\n/* normal comment */\n/* license */\n\n\nconsole.log('myJS');\n\n/**\n * This is a little comment\n */\nfunction myFunction(longVariableName, longerVariableName) {\n\treturn longVariableName + longerVariableName;\n}\n", | ||
"my/app/view/my.view.xml": "<my>XML</my>\n<!-- A comment in XML is the same as in HTML -->", | ||
"my/app/view/myHtmlPre.view.xml": "<my>XML</my>\n<!-- A comment in XML is the same as in HTML -->\n<html:pre> </html:pre>" | ||
}, "my/app/Component-preload"); |
14 changes: 5 additions & 9 deletions
14
test/preload/expected/component_resource_prefix/Component-preload.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
jQuery.sap.registerPreloadedModules({ | ||
"version": "2.0", | ||
"name": "my/app/Component-preload", | ||
"modules": { | ||
"my/app/Component.js": "/* © */\n\"use strict\";function myFunction(n,o){return n+o}/**\n* This is a copyright comment\n*/\n/* (c) */\n/* released under */\n/* license */\nconsole.log(\"myJS\");", | ||
"my/app/view/my.view.xml": "<my>XML</my>\n", | ||
"my/app/view/myHtmlPre.view.xml": "<my>XML</my>\n<!-- A comment in XML is the same as in HTML -->\n<html:pre> </html:pre>" | ||
} | ||
}); | ||
sap.ui.require.preload({ | ||
"my/app/Component.js": "/* © */\n\"use strict\";function myFunction(n,o){return n+o}/**\n* This is a copyright comment\n*/\n/* (c) */\n/* released under */\n/* license */\nconsole.log(\"myJS\");", | ||
"my/app/view/my.view.xml": "<my>XML</my>\n", | ||
"my/app/view/myHtmlPre.view.xml": "<my>XML</my>\n<!-- A comment in XML is the same as in HTML -->\n<html:pre> </html:pre>" | ||
}, "my/app/Component-preload"); |
2 changes: 1 addition & 1 deletion
2
test/preload/expected/library_compat_140/my/ui/lib/library-preload.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
test/preload/expected/library_compat_154/my/ui/lib/library-preload.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
sap.ui.require.preload({ | ||
"my/ui/lib/library.js": "jQuery.sap.require(\"sap.ui.core.library\"),jQuery.sap.declare(\"my.ui.lib.library\"),sap.ui.getCore().initLibrary({name:\"my.ui.lib\",version:\"0.0.0\",dependencies:[\"sap.ui.core\"]});", | ||
"my/ui/lib/myJS.js": "/* © */\n\"use strict\";function myFunction(n,o){return n+o}/**\n* This is a copyright comment\n*/\n/* (c) */\n/* released under */\n/* license */\nconsole.log(\"myJS\");", | ||
"my/ui/lib/my.view.xml": "<my>XML</my>\n", | ||
"my/ui/lib/myHtmlPre.view.xml": "<my>XML</my>\n<!-- A comment in XML is the same as in HTML -->\n<html:pre> </html:pre>", | ||
"my/ui/lib/foo.properties": "FOO=BAR\n" | ||
}, "my/ui/lib/library-preload"); |
18 changes: 7 additions & 11 deletions
18
test/preload/expected/library_custom_uglify_params/my/ui/lib/library-preload.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
jQuery.sap.registerPreloadedModules({ | ||
"version": "2.0", | ||
"name": "my.ui.lib.library-preload", | ||
"modules": { | ||
"my/ui/lib/library.js": "jQuery.sap.require(\"sap.ui.core.library\"),jQuery.sap.declare(\"my.ui.lib.library\"),sap.ui.getCore().initLibrary({name:\"my.ui.lib\",version:\"0.0.0\",dependencies:[\"sap.ui.core\"]});", | ||
"my/ui/lib/myJS.js": "/* © */\n\"use strict\";function myFunction(longVariableName,longerVariableName){return longVariableName+longerVariableName+\"\\u518d\\u6309\\u4e00\\u6b21\\u9000\\u51fa\\u4f19\\u62fc\"}/**\n* This is a copyright comment\n*/\n/* (c) */\n/* released under */\n/* license */\nconsole.log(\"myJS\");", | ||
"my/ui/lib/my.view.xml": "<my>XML</my>\n", | ||
"my/ui/lib/myHtmlPre.view.xml": "<my>XML</my>\n<!-- A comment in XML is the same as in HTML -->\n<html:pre> </html:pre>", | ||
"my/ui/lib/foo.properties": "FOO=BAR\n" | ||
} | ||
}); | ||
sap.ui.require.preload({ | ||
"my/ui/lib/library.js": "jQuery.sap.require(\"sap.ui.core.library\"),jQuery.sap.declare(\"my.ui.lib.library\"),sap.ui.getCore().initLibrary({name:\"my.ui.lib\",version:\"0.0.0\",dependencies:[\"sap.ui.core\"]});", | ||
"my/ui/lib/myJS.js": "/* © */\n\"use strict\";function myFunction(longVariableName,longerVariableName){return longVariableName+longerVariableName+\"\\u518d\\u6309\\u4e00\\u6b21\\u9000\\u51fa\\u4f19\\u62fc\"}/**\n* This is a copyright comment\n*/\n/* (c) */\n/* released under */\n/* license */\nconsole.log(\"myJS\");", | ||
"my/ui/lib/my.view.xml": "<my>XML</my>\n", | ||
"my/ui/lib/myHtmlPre.view.xml": "<my>XML</my>\n<!-- A comment in XML is the same as in HTML -->\n<html:pre> </html:pre>", | ||
"my/ui/lib/foo.properties": "FOO=BAR\n" | ||
}, "my/ui/lib/library-preload"); |
18 changes: 7 additions & 11 deletions
18
test/preload/expected/library_default_options/my/ui/lib/library-preload.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
jQuery.sap.registerPreloadedModules({ | ||
"version": "2.0", | ||
"name": "my.ui.lib.library-preload", | ||
"modules": { | ||
"my/ui/lib/library.js": "jQuery.sap.require(\"sap.ui.core.library\"),jQuery.sap.declare(\"my.ui.lib.library\"),sap.ui.getCore().initLibrary({name:\"my.ui.lib\",version:\"0.0.0\",dependencies:[\"sap.ui.core\"]});", | ||
"my/ui/lib/myJS.js": "/* © */\n\"use strict\";function myFunction(n,o){return n+o}/**\n* This is a copyright comment\n*/\n/* (c) */\n/* released under */\n/* license */\nconsole.log(\"myJS\");", | ||
"my/ui/lib/my.view.xml": "<my>XML</my>\n", | ||
"my/ui/lib/myHtmlPre.view.xml": "<my>XML</my>\n<!-- A comment in XML is the same as in HTML -->\n<html:pre> </html:pre>", | ||
"my/ui/lib/foo.properties": "FOO=BAR\n" | ||
} | ||
}); | ||
sap.ui.require.preload({ | ||
"my/ui/lib/library.js": "jQuery.sap.require(\"sap.ui.core.library\"),jQuery.sap.declare(\"my.ui.lib.library\"),sap.ui.getCore().initLibrary({name:\"my.ui.lib\",version:\"0.0.0\",dependencies:[\"sap.ui.core\"]});", | ||
"my/ui/lib/myJS.js": "/* © */\n\"use strict\";function myFunction(n,o){return n+o}/**\n* This is a copyright comment\n*/\n/* (c) */\n/* released under */\n/* license */\nconsole.log(\"myJS\");", | ||
"my/ui/lib/my.view.xml": "<my>XML</my>\n", | ||
"my/ui/lib/myHtmlPre.view.xml": "<my>XML</my>\n<!-- A comment in XML is the same as in HTML -->\n<html:pre> </html:pre>", | ||
"my/ui/lib/foo.properties": "FOO=BAR\n" | ||
}, "my/ui/lib/library-preload"); |
18 changes: 7 additions & 11 deletions
18
test/preload/expected/library_no_compress/my/ui/lib/library-preload.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
18 changes: 7 additions & 11 deletions
18
test/preload/expected/library_resource_prefix/library-preload.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
jQuery.sap.registerPreloadedModules({ | ||
"version": "2.0", | ||
"name": "my.ui.lib.library-preload", | ||
"modules": { | ||
"my/ui/lib/library.js": "jQuery.sap.require(\"sap.ui.core.library\"),jQuery.sap.declare(\"my.ui.lib.library\"),sap.ui.getCore().initLibrary({name:\"my.ui.lib\",version:\"0.0.0\",dependencies:[\"sap.ui.core\"]});", | ||
"my/ui/lib/myJS.js": "/* © */\n\"use strict\";function myFunction(n,o){return n+o}/**\n* This is a copyright comment\n*/\n/* (c) */\n/* released under */\n/* license */\nconsole.log(\"myJS\");", | ||
"my/ui/lib/my.view.xml": "<my>XML</my>\n", | ||
"my/ui/lib/myHtmlPre.view.xml": "<my>XML</my>\n<!-- A comment in XML is the same as in HTML -->\n<html:pre> </html:pre>", | ||
"my/ui/lib/foo.properties": "FOO=BAR\n" | ||
} | ||
}); | ||
sap.ui.require.preload({ | ||
"my/ui/lib/library.js": "jQuery.sap.require(\"sap.ui.core.library\"),jQuery.sap.declare(\"my.ui.lib.library\"),sap.ui.getCore().initLibrary({name:\"my.ui.lib\",version:\"0.0.0\",dependencies:[\"sap.ui.core\"]});", | ||
"my/ui/lib/myJS.js": "/* © */\n\"use strict\";function myFunction(n,o){return n+o}/**\n* This is a copyright comment\n*/\n/* (c) */\n/* released under */\n/* license */\nconsole.log(\"myJS\");", | ||
"my/ui/lib/my.view.xml": "<my>XML</my>\n", | ||
"my/ui/lib/myHtmlPre.view.xml": "<my>XML</my>\n<!-- A comment in XML is the same as in HTML -->\n<html:pre> </html:pre>", | ||
"my/ui/lib/foo.properties": "FOO=BAR\n" | ||
}, "my/ui/lib/library-preload"); |
14 changes: 5 additions & 9 deletions
14
test/preload/fixtures/app-same-dest/my/app/Component-preload.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
jQuery.sap.registerPreloadedModules({ | ||
"version": "2.0", | ||
"name": "my/app/Component-preload", | ||
"modules": { | ||
"my/app/Component.js": "/* © */\n\"use strict\";function myFunction(n,o){return n+o}/**\n* This is a copyright comment\n*/\n/* (c) */\n/* released under */\n/* license */\nconsole.log(\"myJS\");", | ||
"my/app/view/my.view.xml": "<my>XML</my>\n", | ||
"my/app/view/myHtmlPre.view.xml": "<my>XML</my>\n<!-- A comment in XML is the same as in HTML -->\n<html:pre> </html:pre>" | ||
} | ||
}); | ||
sap.ui.require.preload({ | ||
"my/app/Component.js": "/* © */\n\"use strict\";function myFunction(n,o){return n+o}/**\n* This is a copyright comment\n*/\n/* (c) */\n/* released under */\n/* license */\nconsole.log(\"myJS\");", | ||
"my/app/view/my.view.xml": "<my>XML</my>\n", | ||
"my/app/view/myHtmlPre.view.xml": "<my>XML</my>\n<!-- A comment in XML is the same as in HTML -->\n<html:pre> </html:pre>" | ||
}, "my/app/Component-preload"); |
18 changes: 7 additions & 11 deletions
18
test/preload/fixtures/library-same-dest/my/ui/lib/library-preload.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
jQuery.sap.registerPreloadedModules({ | ||
"version": "2.0", | ||
"name": "my.ui.lib.library-preload", | ||
"modules": { | ||
"my/ui/lib/library.js": "jQuery.sap.require(\"sap.ui.core.library\"),jQuery.sap.declare(\"my.ui.lib.library\"),sap.ui.getCore().initLibrary({name:\"my.ui.lib\",version:\"0.0.0\",dependencies:[\"sap.ui.core\"]});", | ||
"my/ui/lib/myJS.js": "/* © */\n\"use strict\";function myFunction(n,o){return n+o}/**\n* This is a copyright comment\n*/\n/* (c) */\n/* released under */\n/* license */\nconsole.log(\"myJS\");", | ||
"my/ui/lib/my.view.xml": "<my>XML</my>\n", | ||
"my/ui/lib/myHtmlPre.view.xml": "<my>XML</my>\n<!-- A comment in XML is the same as in HTML -->\n<html:pre> </html:pre>", | ||
"my/ui/lib/foo.properties": "FOO=BAR\n" | ||
} | ||
}); | ||
sap.ui.require.preload({ | ||
"my/ui/lib/library.js": "jQuery.sap.require(\"sap.ui.core.library\"),jQuery.sap.declare(\"my.ui.lib.library\"),sap.ui.getCore().initLibrary({name:\"my.ui.lib\",version:\"0.0.0\",dependencies:[\"sap.ui.core\"]});", | ||
"my/ui/lib/myJS.js": "/* © */\n\"use strict\";function myFunction(n,o){return n+o}/**\n* This is a copyright comment\n*/\n/* (c) */\n/* released under */\n/* license */\nconsole.log(\"myJS\");", | ||
"my/ui/lib/my.view.xml": "<my>XML</my>\n", | ||
"my/ui/lib/myHtmlPre.view.xml": "<my>XML</my>\n<!-- A comment in XML is the same as in HTML -->\n<html:pre> </html:pre>", | ||
"my/ui/lib/foo.properties": "FOO=BAR\n" | ||
}, "my/ui/lib/library-preload"); |
Oops, something went wrong.