Lightning Components is a UI system for creating web applications for portable and work area gadgets. It’s a cutting-edge system for building single-page applications with dynamic, responsive UI for Lightning Platform applications. It utilizes JavaScript on the customer side and Apex on the server side.
Every now and then you need to deploy tricks that will improve the performance of your
Most evident plan to enhance Lightning Component Performance is to keep away from server trips. Suppose, you have to know the queue Id to be allocated as proprietor in Case and furthermore require custom setting data to determine the conduct of Lightning Component. There are two different ways to accomplish this – Call Apex Controller multiple times versus return consolidated outcomes from Apex in a single call and process JSON in customer side controller of Lightning Component.
In this methodology, Lightning component demonstrates the stored result as opposed to making prompt server trip. Lightning part will make the server (Apex) bring in the foundation and whenever the reserved outcome is stale, at that point it would store and revive the lightning segment. This is exceptionally helpful for gadgets which have got slow internet connections. On the off chance that you are Facebook or Google News client, you would be able to effectively relate to it. When we open these applications, it indicates past feed and if there are new feeds, it gives us choice to invigorate see or consequently revive it. You should simply, on customer side controller of the Lightning component, stamp activity as storable utilizing this code action.setStorable()
.
Lightning Data Service is the process that is proportionate to Standard Controllers for Lightning Component. You don’t have to compose Apex Test classes for your Lightning Component. In any case, Lightning Data Service needs more recognization rather than trying to say we don’t have to compose Apex. Another critical side of Data Service is its capacity to utilize shared cache.
On the off chance that Lightning Data Service and Storable Action can’t full fill necessity then you can likewise construct your own custom reserve. Favorable position of the custom store is that you would have full command over life cycle and conduct of cache.
Rather than making all Lightning Components at the same time, you can postpone instantiation of the Lightning segment. This is a process that you need to deploy and de-deploy from time to time.
There are two different ways to restrictively render Lightning Components
There are two different ways to tie factors in Lightning Components
{!v.var1}
. For this situation, if the value in var1 changes, the Lightning part would be notified and the value would be refreshed.{#v.var1}
Rather than utilizing events, we can utilize aura: method to encourage correspondence between components. Its like uncovering exposing API. There are few preferences of utilizing aura: method rather than events, similar to the capacity to name technique which would clear up and distinguish conduct, capacity to utilize the same contentions and characterize different strategies.
Attempt to restrain a number of event handlers in your Lightning component. As you can figure, numerous occasion handler implies your part would be occupied in listening to event changes bringing about performance overload.
As we probably are already aware, there are two sorts of events – Application and Component events. Application events are ground-breaking and give heaps of adaptability to convey between any components in Application. In any case, we should utilize the Application event with incredible safety measure. As Application event is communicated to all components at the same time, it may be excessive for a few parts, if it’s not required.
This is the best time to return to basics and learn JavaScript. There was a time when just a couple of libraries were there like JQuery, underscoreJs and so on. However, in this consistently changing innovation consistently there is a new Library and new forms of existing libraries. In the meantime, vanilla JavaScript has additionally turned out to be all the more amazing with dynamic arrivals of EcmaScript. You may have the capacity to accomplish a large portion of stuff by joining Vanilla JavaScript and Aura structure. $A.util has numerous valuable techniques for Lightning Component improvement.
This is a very easy practice. On the off chance that you wind up utilizing the library, ensure that it is minified, with the goal that HTTP load would be negligible.
Rather than reinventing wheels or outsider Lightning Components, examine the base components first. Making custom segment and after that applying Salesforce Lightning Design System doesn’t bode well in the event that you as of now have a Base component. Base component fuses Lightning Design System, enhanced execution with insignificant impressions and best practices.
You can disable Lightning Component debug mode by exploring to –
Setup >> Custom Code >> Lightning Components and done.
There are numerous devices accessible to dive into the issue of the moderate Lightning component before playing in the darkness. Devices like Lightning Component Inspector in Google chrome or chrome performance tool can be of aid here.
Conclusion
It is advisable that you choose 4-5 tips from the list given above and deploy them. After a certain period of time you can deploy the next lot of 4-5 techniques. Do not bombard your instance with all of these techniques altogether, it will lead to a disaster you do not want to imagine.
Stop, read and acquire deep insights into complex issues
Write a Comment