As many customers transition their Salesforce applications from Classic to the Lightning Experience, they are also thinking of ways to allow their users to be more productive and efficient in their day to day activities.
Therefore, within the Lightning Experience user interface, there are a series of out of the box tools available such as Flow, Process and Application Builder as well as pre-built Lightning Components that a Salesforce Administrator can drag and drop into existing Lightning pages to fit into the “clicks not code” paradigm to provide a better user experience.
Within this book, Mohith Shrivastava covers the concepts that are available within the Lightning Framework such as the building blocks to form a Lightning bundle, as well as capabilities such as Lightning Flows, Lightning Data Service, Locker Service, and Lightning Out. Lastly, additional development concepts are covered such as Debugging, Performance Tuning, Unit Testing while utilizing the SalesforceDX CLI (Command Line Interface), providing code examples from Github.
This book provides plenty of examples along with screenshots and a general overview of concepts and I highly recommend the purchase of this reference book to grasp a more in-depth understanding of all the moving pieces involved within the framework.
Below is a summary of each chapter.
Chapter 1 – Intro to the Lightning Framework
An intro into the core components that make up a Lightning app and the architectural differences between the client and server communication and data rendering as a user interacts with the system.
Finally, we are provided an example of how to create a “Hello World” Lightning component using the developer console as well as how to utilize the Lightning Design System to style and format a component.
Chapter 2 – Exploring Salesforce DX
Within this book, Salesforce DX is the development tool of choice and is used in all examples provided. In this chapter, Mohith explains how Salesforce DX is used as a source driven development workflow in utilizing version control and the Salesforce DX CLI (Command Line Interface) to help adopt a Continuous Integration process.
Also outlined is the process and the CLI commands to install DX, the Developer Hub, create a new DX project, build a scratch org, and to set up Visual Studio extension pack. Lastly, we’re shown a good example of the life-cycle and workflow using all the above-mentioned tools to develop a Lightning component, as shown below.
Chapter 3 – Lightning Component Building Blocks
We also explore examples of how to control the layout and sizes of the Lightning Components to help increase the visual appeal to the end user.
Lastly, we’re shown a diagram of the series of events and actions that takes place between the client and server which really give a great depiction of what is happening technically behind the scenes.
Concluding this chapter, we get an introduction to the Promises API which can help when you have nested callback that can be a challenge to debug and maintain.
Chapter 5 – Events in the Lightning Component Framework
The event driven model is the core of what the Lightning Component Framework uses based on a series of Publisher/Subscribe events using either the application or component event model. In this chapter, we are educated on how component events differ from application events, as well as how to create, register, fire and handle each type of event. We are also provided examples along with associated code to explain how a series of components can communicate with one another such as a child component taking action when it’s corresponding parent triggers it. Lastly, we are shown the optimal design pattern to help make debugging Lightning events less cumbersome.
Chapter 6 – Lightning Data Service and Base Components
One of the new features within the Lightning framework is the Lightning Data Service which provides a developer the ability to take care of Create, Read, Update, Delete (CRUD) operations as well as field level security inherently within the service. Historically, this was needed using APEX coding on the server. Below are examples of the client/server interaction comparing not using LDS and using LDS.
The idea behind Lightning Base Components is to accelerate development by utilizing the out of the box components and design patterns available to you in SLDS (Salesforce Lightning Design System).
This chapter provides example on how to use both custom and base components to rapidly achieve LDS functionality as well as the offerings that base components have such as: carousel, tree, data table, etc. to help provides a base set of common functionalities to get a developer going in their development work.
Lastly, using the Lightning:Container component allows for a SPA’s (Single Page Applications) written in React, Angular, Vue, etc. to load inside the Salesforce Lightning Component. We are also shown some of the limitations of this approach with regards to performance, storage and offline caching.
Chapter 8 – Debugging Lightning Components
Within this chapter, we walk through the Salesforce Lightning Inspector tool to explore ways to inspect issues associated to the events firing and receiving, as well as performance bottlenecks. Additionally, we go through examples and techniques of using the performance optimizer, how to set breakpoints, parsing and catching exceptions, streaming logs, and using the replay debugger in the Salesforce DX CLI. Below is an example of the Lightning Inspector.
Chapter 9 – Performance Tuning Your Lightning Components
As a developer, having a performance problem can cause all your development work to quickly loose its appeal. In this great chapter, we explore preferred options and specific “gotchas” that may cause performance constraints within your Lightning Component and techniques to correct them. Below is an example of that interface.
Some of the recommended and non-recommended approaches mentioned are using storable actions, avoiding Aura:If in the Aura:Iteration, rearchitecting the solution by moving logic to the controller to create markups conditionally, using the Lighting Data Service, limiting data sets and leveraging the Lightning Base Components (rather than new components from scratch) among many other examples.
Chapter 10 – Taking Lightning Components out of Salesforce Using Lightning Out
In this chapter, we are provided some examples of how to deploy Lightning on VisualForce pages and on a custom Node.JS application as well as diving into some of the limitations to consider as not all events and components are supported nor work outside the context of the Lightning experience.
Chapter 11 – Lightning Flows
As most Salesforce practitioners are familiar with declarative features of Flow and Flow Builder, we can integrate Lightning Components within these to provide additional capabilities to meet specific user requirements.
We are provided an example of how-to set-up a Flow using Flow Builder, how to run that flow in the Lightning Experience, then debug the flow and lastly how to add custom components to the flow builder. From these, the author takes the reverse approach on how to embed Flows inside a Lightning Component to pass variables in and out based on a Lightning Component firing and the flow running logic to pass those variables back to the Lightning Component that called it.
Chapter 12 – Making Components Available for Salesforce Mobile and Communities
Utilizing Salesforce Lightning Components within the Salesforce Mobile App and Salesforce Communities can provide the user with a more personal and appealing user-experience.
Within this chapter, Mohith provides step by step instructions and screen shots of how to develop a UI on the Mobile app, and how to set up your Chrome browser to simulate the user experience while providing context on global and Lightning Quick Actions.
Chapter 13 – Lightning Navigation and Lightning Console API’s
In this short chapter, we’re introduced to additional capabilities to enhance the productivity of the user with techniques such as: allowing the user to navigate to various components, pages and tabs by using the Lightning console to provide split views, work spaces, tabs and a utility bar using API’s to do so.
Chapter 14 – Unit Testing Lightning Components
This chapter, we are given explanations and examples of the different parts the make-up Jasmine, such as Suite (like a test class in APEX), Spec (similar to a test method in APEX), Setup and Teardown (equivalent to @istest setup), and Spies (the same as stubs that prevent actual server calls to be made). Additionally, discussed are the various wrappers that are available from the Lightning Testing Service as well as recommendation on the different test cases.
Chapter 15 – Publishing Lightning Components on the AppExchange
Once a Salesforce Lightning App is developed and tested, a managed package can be created and published on the AppExchange for other users to install and use. Mohith takes us through the various steps to be able to do this such as creating the proper namespace, creating the manage package, documenting your components using the Auradoc file, providing the design file to allow admins to configure attributes to drag components to the Lightning App Builder, Community Builder or Flow Builder, and lastly publishing the component on the AppExchange.
In conclusion, whether you’re a developer that’s new to the Lightning Framework or have been developing Lightning Components for a few years, this book should be a part of your reference collection as it provides great examples and explanations along with helpful screen shots to help expand your expertise within the various layers that are involved with Lightning Component development.
This book can be found on Amazon at: