Book Image

Learning Salesforce Lightning Application Development

By : Mohit Shrivatsava
Book Image

Learning Salesforce Lightning Application Development

By: Mohit Shrivatsava

Overview of this book

Built on the Salesforce App Cloud, the new Salesforce Lightning Experience combines three major components: Lightning Design System, Lightning App Builder, and Lightning Components, to provide an enhanced user experience. This book will enable you to quickly create modern, enterprise apps with Lightning Component Framework. You will start by building simple Lightning Components and understanding the Lightning Components architecture. The chapters cover the basics of Lightning Component Framework semantics and syntax, the security features provided by Locker Service, and use of third-party libraries inside Lightning Components. The later chapters focus on debugging, performance tuning, testing using Lightning Testing Services, and how to publish Lightning Components on Salesforce AppExchange.
Table of Contents (22 chapters)
Title Page
PacktPub.com
Foreword
Contributors
Preface
Index

Optimizing Apex code


In this section, we will discuss improvements that you can make to your server-side Apex controllers, to reduce database time and provide Lightning Components with data in an optimized format so that the framework renders the components faster.

Limiting data rows for lists

If your Salesforce SOQL query is fetching large amount of results, consider limiting the number of data rows by using a LIMIT clause and using server-side pagination.

Look for opportunities where data from the server can be lazy loaded. For example, if you have three tabs, load data only for the first tab that will be rendered on the screen. Render the data for the second tab only when a user clicks the second tab.

Reducing server response time, using the platform cache

Redundant SOQL can be expensive, and you can significantly improve performance by using the platform cache feature of the Salesforce Lightning platform. Salesforce offers two types of caching mechanisms namely Org cache and session cache...