
Learning Salesforce Lightning Application Development
Build and test Lightning Components for Salesforce Lightning Experience using Salesforce DX
- 458 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
Learning Salesforce Lightning Application Development
Build and test Lightning Components for Salesforce Lightning Experience using Salesforce DX
About this book
Build, design, and style beautiful and informative applications on the Salesforce Lightning platform
Key Features
- Build and Test Lightning Components that enhance application usability and adaptability
- Apply Security Best Practices to your Custom Lightning Components
- Design Lightning Components for Salesforce UIs such as Lightning Pages, Salesforce 1 Application, Communities, and more.
Book Description
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.
What you will learn
- Understand Lightning Components architecture
- Learn Locker security best practices
- Debug and Improve performance of your Lightning Components
- Use third-party libraries along with Lightning Component Framework
- Learn how to publish Lightning Components on AppExchange
- Use Lightning Out to take your Lightning Components outside the Salesforce platform
Who this book is for
This book is for Salesforce developers or developers from other platforms who are familiar with HTML, CSS, and JavaScript and want to build and test Salesforce Lightning components. No knowledge of Salesforce Lightning is required.
Tools to learn more effectively

Saving Books

Keyword Search

Annotating Text

Listen to it instead
Information
Using External JavaScript Libraries in Lightning Components
- Using third-party JavaScript libraries in Lightning Components
- Using the ltng:require tag
- Creating a Locker Service-compliant JavaScript bundle using webpack
- Examples of building custom components using ChartJs and MomentJs
- Rendering a React application in a Lightning Component using a Lightning:container
Third-party JavaScript libraries in Lightning Components
Attributes
| Attribute name | Attribute type | Description |
| body | Component[] | The body of the component. In markup, this is everything in the body of the tag. |
| scripts | String[] | The set of scripts that will be loaded in dependency order. |
| styles | String[] | The set of style sheets that will be loaded in dependency order. |
Events
| Event Name | Event Type | Description |
| afterScriptsLoaded | COMPONENT | Fired when ltng:require has loaded all scripts listed in ltng:require.scripts |
| beforeLoadingResources | COMPONENT | Fired before ltng:require starts loading resources |
Integrating a third-party library into Lightning Components
<html>
<head>
<link rel="stylesheet" href="../compiled/flipclock.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="../compiled/flipclock.js"></script>
</head>
<body>
<div class="clock" style="margin:2em;"></div>
<script type="text/javascript">
var clock;
$(document).ready(function() {
clock = $('.clock').FlipClock({
clockFace: 'TwentyFourHourClock'
});
});
</script>
</body>
</html>
- Create a static resource hosting a third-party library: The first step is to download the library to your local machine and upload it to static resource. Note that due to the Content Security Policy, you cannot use JavaScript hosted on CDN inside Lightning Components and it is always recommended to upload to static resource. Any dependent JavaScript should be referred to from the static resource and can be loaded in order. The scripts attribute allows us to load multiple JavaScript files in order. In our case, the flipclock.js requires the jQuery library to be loaded beforehand. Also, it is recommended to use a zipped folder that can hold JavaScript and CSS assets. For this project, download the ZIP file that needs to be uploaded from static resource available at https://github.com/PacktPublishing/Learning-Salesforce- Lightning-Application-Development/blob/master/chapter7/libraries/flipclock.zip.
- Use the ltng:require tag and...
Table of contents
- Title Page
- Copyright and Credits
- PacktPub.com
- Foreword
- Contributors
- Preface
- Introduction to the Lightning Component Framework
- Exploring Salesforce DX
- Lightning Component Building Blocks
- The Lightning JavaScript API
- Events in the Lightning Component Framework
- Lightning Data Service and Base Components
- Using External JavaScript Libraries in Lightning Components
- Debugging Lightning Components
- Performance Tuning Your Lightning Component
- Taking Lightning Components out of Salesforce Using Lightning Out
- Lightning Flows
- Making Components Available for Salesforce Mobile and Communities
- Lightning Navigation and Lightning Console APIs
- Unit Testing Lightning Components
- Publishing Lightning Components on AppExchange
- Other Books You May Enjoy
Frequently asked questions
- Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
- Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app