<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: SAPUI5 Asynchronous pre-load in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/sapui5-asynchronous-pre-load/qaa-p/11925573#M4480512</link>
    <description>&lt;P&gt;Thanks Saurabh. This helps. But on the other two questions I asked..&lt;/P&gt;&lt;P&gt;Can we consider sap.ui.getCore().attachInit(function() as kind of promise statement of java script ?&lt;/P&gt;&lt;P&gt;How are we making sure that the application is not waiting till all the SAPUI5 libraries are loaded ? Because, in the above code, we are only waiting for the sap.ui.core library to load but not the other sapui5 libraries like sap.m.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jul 2019 03:52:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2019-07-10T03:52:06Z</dc:date>
    <item>
      <title>SAPUI5 Asynchronous pre-load</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-asynchronous-pre-load/qaq-p/11925571</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;I am changing the pre-load property in my index.html tag to ''async".&lt;/P&gt;
  &lt;P&gt;When I do that, I believe below code makes sure that my application or component.js file doesn't get loaded until all the required SAPUI5 libraries are loaded. If I am correct till now, may I know if sap.ui.getCore().attachInit() acts as a promise and only when this is resolved the callback function within the attachInit() will get executed ?&lt;/P&gt;
  &lt;P&gt;Again, if I am correct till now, then may I know where are we making sure that sap.m library and other SAPUI5 libraries are also loaded, as I only see attachInit for sap.ui library.&lt;/P&gt;
  &lt;P&gt;If I am completely off mark, please let me know how do we handle the async pre-load in SAPUI5 applications and how can we set the pre-load='async' property in application where index.html is not available.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;&amp;lt;script&amp;gt;
			sap.ui.getCore().attachInit(function() {
				new sap.m.Shell({
					app: new sap.ui.core.ComponentContainer({
						height : "100%",
						name : "com.sunSampleGetData"
					})
				}).placeAt("content");
			});
		&amp;lt;/script&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Jul 2019 17:10:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-asynchronous-pre-load/qaq-p/11925571</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-07-08T17:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Asynchronous pre-load</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-asynchronous-pre-load/qaa-p/11925572#M4480511</link>
      <description>&lt;P&gt;Check &lt;A href="https://ui5.sap.com/#/topic/676b636446c94eada183b1218a824717"&gt;Use Asynchronous Loading&lt;/A&gt; , the async property can be added to the manifest.json file as well. Also check the recommendations given here - &lt;A href="https://ui5.sap.com/#/topic/493a15aa978d4fe9a67ea9407166eb01"&gt;Is Your Application Ready for Asynchronous Loading?&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 05:33:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-asynchronous-pre-load/qaa-p/11925572#M4480511</guid>
      <dc:creator>saurabh_vakil</dc:creator>
      <dc:date>2019-07-09T05:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Asynchronous pre-load</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-asynchronous-pre-load/qaa-p/11925573#M4480512</link>
      <description>&lt;P&gt;Thanks Saurabh. This helps. But on the other two questions I asked..&lt;/P&gt;&lt;P&gt;Can we consider sap.ui.getCore().attachInit(function() as kind of promise statement of java script ?&lt;/P&gt;&lt;P&gt;How are we making sure that the application is not waiting till all the SAPUI5 libraries are loaded ? Because, in the above code, we are only waiting for the sap.ui.core library to load but not the other sapui5 libraries like sap.m.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 03:52:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-asynchronous-pre-load/qaa-p/11925573#M4480512</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-07-10T03:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Asynchronous pre-load</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-asynchronous-pre-load/qaa-p/11925574#M4480513</link>
      <description>&lt;P&gt;&lt;A href="https://answers.sap.com/users/6575/venkatasunil.html"&gt;Venkata Sunil Naidu Chennam&lt;/A&gt;&lt;/P&gt;&lt;P&gt;providing async option will asynchronously load those modules you've provided in the sap-ui-libs, which means other requests will go even if those modules are not loaded yet. check the below blog:&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sap.com/2016/10/29/sapui5-application-startup-performance-best-practices/"&gt;https://blogs.sap.com/2016/10/29/sapui5-application-startup-performance-best-practices/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;now the attahInit is not a promise but it is a function which will register your handler function and will call it once the core is loaded. it kinda behaves like a promise but it's definitely not a promise.&lt;/P&gt;&lt;P&gt;&lt;A href="https://ui5.sap.com/#/api/sap.ui.core.Core/methods/attachInit"&gt;https://ui5.sap.com/#/api/sap.ui.core.Core/methods/attachInit&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This function you've passed will be called once after the core is loaded successfully and this is independent of teh async option you provide as per my knowledge. BTW as per the latest ui5 standards, you are not supposed to do that and use the below:&lt;/P&gt;&lt;P&gt;&lt;A href="https://ui5.sap.com/#/topic/1f81a093a9f3433983dcb2ebe11cd4cd"&gt;https://ui5.sap.com/#/topic/1f81a093a9f3433983dcb2ebe11cd4cd&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 10:46:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-asynchronous-pre-load/qaa-p/11925574#M4480513</guid>
      <dc:creator>maheshpalavalli</dc:creator>
      <dc:date>2019-07-10T10:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Asynchronous pre-load</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-asynchronous-pre-load/qaa-p/11925575#M4480514</link>
      <description>&lt;P&gt;Thanks Mahesh. I have a follow up question.&lt;/P&gt;&lt;P&gt;Since index.html file is not used when application is accessed from FIORI launchpad, may I know where and how we can declare preload='async' ?&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jul 2019 17:05:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-asynchronous-pre-load/qaa-p/11925575#M4480514</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-07-13T17:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Asynchronous pre-load</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-asynchronous-pre-load/qaa-p/11925576#M4480515</link>
      <description>&lt;P&gt;Very good question, you don't need to. SAP fiori launchpad will take care of loading the initial resources and via async only for all Ur resources that u mention in manifest.json &lt;/P&gt;&lt;P&gt;What you can do is set to lazy  load the libraries.&lt;/P&gt;&lt;P&gt;&lt;A href="https://ui5.sap.com/#/topic/408b40efed3c416681e1bd8cdd8910d4" target="test_blank"&gt;https://ui5.sap.com/#/topic/408b40efed3c416681e1bd8cdd8910d4&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Using this means that libraries loaded when they are required. &lt;/P&gt;&lt;P&gt;Tip: you can click on comment on the answer and reply. We only need to answer if we have solution.&lt;/P&gt;&lt;P&gt;How this helps. Let us know if u need anything.&lt;/P&gt;&lt;P&gt;Br,&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jul 2019 08:11:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-asynchronous-pre-load/qaa-p/11925576#M4480515</guid>
      <dc:creator>maheshpalavalli</dc:creator>
      <dc:date>2019-07-14T08:11:43Z</dc:date>
    </item>
  </channel>
</rss>

