I know there was the same question in Summer 16 (Lightning Component in VFP - slow loading since Summer 16), but it seems to be the case again in Spring 18 and Summer 18 (I've tested this in sandbox running 42.0), so I'm creating this new topic.

We've faced an issue with custom ligtning components wrapped up with Visualforce page. It takes Visualforce page around 3-5 seconds to start loading the lightning part (when the page itself is there). Here's VF page:

<apex:outputPanel id="viewPanel" rendered="{!$User.UIThemeDisplayed == 'Theme3'}">
<apex:includeLightning />
<div id="component" />
        var myUserContext = "{!$User.UITheme}";
        $Lightning.use("sff:SFF", function() {
            $Lightning.createComponent("sff:ReportsTab", {
                    label: "List of Reports",
                    userContext: myUserContext,
                function(cmp) {});

That's what I see in Chrome console. 'A' - VF part emerges, 'B' - Lightning is visualized and nothing in between.

enter image description here

Any ideas/hints on how to boost that loading? Thanks

  • Are you using lightning debugger to check which part of lightning component is taking more time. what is the difference if you load that component directly if possible. May 24 '18 at 14:10
  • @AvijitChakraborty if we use the exact same component in the ligtning tab (what i've described above is a Visualforce tab) it takes around 1 sec to show the spinner (so user starts seeing that smth is happening). Lightning Insperctor shows that it takes 4511ms to load "aura:bootstrap" before the actual component emerges in the log. May 24 '18 at 14:22
  • what is there in <apex:includeLightning /> do you have <apex:slds /> there? May 24 '18 at 15:50
  • @AvijitChakraborty as we are using active lightning component in that VF page we can't just go with plain <apex:slds/>. If we are using Lightning Components in VF page, we need to get the Lightning Component runtime necessary for Lighting Out developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/… May 25 '18 at 7:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.