Learning Salesforce Lightning Application Development

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Author(s): Mohith Shrivastava
Year: 0

Language: English
Pages: 446

Cover......Page 1
Title Page......Page 2
Copyright and Credits......Page 3
PacktPub.com......Page 4
Foreword......Page 5
Contributors......Page 7
Table of Contents......Page 9
Preface......Page 16
Chapter 1: Introduction to the Lightning Component Framework......Page 23
Lightning Experience......Page 24
Lightning Application......Page 25
Creating a Lightning Application......Page 27
Creating tabs in Lightning Experience......Page 29
Lightning Page Tabs......Page 30
Lightning App Builder......Page 32
Lightning Utility Bar......Page 34
List views in the Lightning UI......Page 36
The ability to calendar data in the Date and Datetime fields......Page 38
Global Actions......Page 39
Publisher actions......Page 41
Lightning Component architecture......Page 42
The concept of web components......Page 43
Lightning Component Bundle......Page 44
Lightning Component lifecycle......Page 45
MVC concepts in the Lightning Component framework......Page 46
Setting up a Salesforce developer organization to enable the building of Lightning Components......Page 47
Creating a simple hello world Lightning Component......Page 48
Creating a simple card component using SLDS ......Page 51
Summary......Page 53
Chapter 2: Exploring Salesforce DX......Page 54
Enabling the developer hub......Page 55
Installing the Salesforce DX CLI......Page 56
auth commands......Page 58
Creating a new Salesforce DX project......Page 59
Configuring project definition JSON......Page 60
Creating a scratch Org......Page 61
Pulling source from a scratch Org......Page 62
Push source code to a scratch Org......Page 64
Lightning commands......Page 66
Creating a Lightning app and components......Page 67
mdapi:convert and mdapi:retrieve......Page 68
Converting existing managed/unmanaged package code to DX Format......Page 69
Data export Salesforce DX command......Page 70
Bulk data upsert Salesforce DX command......Page 72
Installing the Visual Studio extension pack for DX......Page 73
Developer workflow for building a Salesforce application ......Page 75
Summary......Page 81
Chapter 3: Lightning Component Building Blocks......Page 82
Access modifier......Page 83
Implementing interfaces in Lightning Components......Page 84
Lightning base components for layout and layout items......Page 85
Lightning card base component......Page 87
Example layouts using the Lightning layout and card components......Page 88
Horizontal alignment using the Lightning layout base component......Page 91
Vertical alignment using the Lightning layout base component ......Page 93
Stretching a LayoutItem using the flexibility attribute......Page 94
Creating multiple rows and controlling the size of the row in Lightning layout......Page 95
Lightning layout to handle multiple devices......Page 96
Nested page layout using Lightning Layouts......Page 99
Understanding attributes......Page 102
Using Expression syntax......Page 103
JavaScript controller and helper......Page 104
Wiring the client-side to the server using Apex controllers......Page 109
Summary......Page 116
Technical requirements......Page 117
Using the find function to locate the DOM......Page 118
Strict mode enforcement in Locker Service......Page 120
Understanding the DOM access containment hierarchy in Lightning Components ......Page 122
The proxy object in Locker Service......Page 123
Exploring the $A.Util APIs......Page 124
Find your organization's local currency......Page 127
Formatting dates ......Page 128
Dynamically creating components using $A.createComponent()......Page 129
Destroying components using the destory() function......Page 133
Modifying the DOM in the RENDERER JavaScript file of the component bundle......Page 134
Understanding the rendering life cycle of a component......Page 135
Understanding re-rendering the life cycle of a component......Page 138
Using custom labels in Lightning Components......Page 140
ES6 support in Lightning Components......Page 141
An introduction to Promises......Page 142
Promise support in Lightning Components......Page 143
Summary......Page 144
Browser events......Page 145
Capturing browser events......Page 147
Event handling in Lightning base components......Page 149
Application events......Page 150
Firing an application event......Page 151
Handling capturing and bubbling events......Page 152
Creating a component event......Page 154
Handling component events......Page 155
Creating a sales LeaderBoard Lightning Application using events......Page 156
Using aura:method to call child methods from parent methods......Page 168
Using the aura method asynchronously......Page 170
Optimal event architecture design pattern......Page 172
Adding custom events to components dynamically......Page 176
Summary......Page 177
Lightning Data Service......Page 178
Loading Salesforce record context data using force:recordData ......Page 180
Functions available for CRUD records......Page 182
Saving existing records......Page 183
Creating a new record......Page 184
Deleting records......Page 187
Using SaveRecordResult ......Page 189
Example components using Lightning Data Service......Page 190
Lightning base components......Page 194
Creating an input form using the RecordEdit and Lightning input field components......Page 195
Introducing events and attributes in Lightning record edit form and input field......Page 197
Creating a contact edit form using the Lightning input field and RecordEditForm components......Page 199
Using the Lightning output field component......Page 200
The list view component ......Page 201
Creating a tree view using the tree and tree grid components......Page 202
Formatting output data using Lightning base components......Page 205
Using the datatable component......Page 208
Using Lightning input components......Page 210
Using the carousel component......Page 212
Summary......Page 213
Chapter 7: Using External JavaScript Libraries in Lightning Components......Page 214
Attributes......Page 215
Integrating a third-party library into Lightning Components......Page 216
Integrating the Select2 JavaScript library into Lightning Components......Page 218
Integrating the MomentJs library into Lightning Components......Page 222
Creating a Locker Service-compliant JavaScript bundle using webpack......Page 224
Entry......Page 225
Loaders......Page 226
Plugins......Page 227
Integrating choices.js into Lightning Components......Page 228
Creating a Locker Service-compatible bundle with webpack......Page 230
ChartJs in Lightning Components......Page 236
Making client-side calls to external sites using JavaScript......Page 238
Communication from the Visualforce page to the Lightning Component......Page 243
Communication from the Lightning Component to the Visualforce page......Page 245
Rendering a React application in a Lightning Component using Lightning:container......Page 246
Rendering  reactApp using the LCC npm module in a Lightning Component......Page 247
Summary......Page 254
Enabling Debug Mode......Page 255
Salesforce Lightning Inspector ......Page 256
Component Tree......Page 260
$auraTemp......Page 261
Performance tab......Page 262
Event Log tab......Page 264
Storage tab......Page 265
Salesforce community page optimizer......Page 266
Using the Chrome developer Console......Page 268
Setting breakpoints in the Chrome developer Console......Page 269
Apex debugging......Page 271
Using the Salesforce CLI to stream logs......Page 273
Advanced debugging with the Replay Debugger......Page 274
Summary......Page 278
Chapter 9: Performance Tuning Your Lightning Component......Page 279
When to use storable actions?......Page 280
Avoiding nested aura:if in aura:iteration......Page 281
Using plain old JavaScript to gain maximum performance......Page 285
– multiple items set......Page 287
Unbound expression bindings......Page 289
Leveraging Lightning base components......Page 291
Limiting data rows for lists......Page 292
Reducing server response time, using the platform cache......Page 293
Avoiding sending responses from Apex as wrapper objects......Page 294
Summary......Page 296
Lightning Out in Visualforce......Page 297
Creating a Lightning dependency application......Page 298
Adding JavaScript to create a component on a Visualforce page......Page 299
Creating a connected application ......Page 301
Setting up a Node.js application......Page 303
Creating a Lightning Out application ......Page 305
Deploying Node.js application on Heroku......Page 308
Lightning Out for unauthenticated users......Page 309
Summary......Page 313
Introducing Flows......Page 314
Creating the Lead Finder app using the Flow builder......Page 316
Running Flows in Lightning Experience......Page 325
Adding custom components in Flow builder......Page 327
Using asynchronous XHR calls in customized Lightning Components......Page 331
Using Lightning Components as local Flow actions......Page 338
Embedding Flows into a Lightning Component......Page 342
Summary......Page 345
Chapter 12: Making Components Available for Salesforce Mobile and Communities......Page 346
Using Lightning Components in a Salesforce mobile application......Page 347
Setting up the Chrome browser to simulate the Salesforce mobile app experience......Page 348
Adding a Lightning Component to the Salesforce mobile navigation......Page 349
Adding Lightning Components as global and object-specific actions......Page 354
Creating communities in Salesforce......Page 357
Creating a theme layout......Page 361
Creating custom content layouts......Page 368
Overriding a profile menu......Page 372
Adding custom navigation......Page 373
Summary......Page 375
Chapter 13: Lightning Navigation and Lightning Console APIs......Page 376
Adding navigation support using Lightning :navigation......Page 377
Introducing the Lightning Console......Page 383
Utility Bar component......Page 384
Page context in the Utility Bar API......Page 388
Workspace API......Page 389
Standard Lightning tab events in the console......Page 394
Summary......Page 395
Chapter 14: Unit Testing Lightning Components......Page 396
Suite......Page 397
Spec......Page 398
Setup and teardown......Page 399
Spies......Page 400
Quickstart example......Page 401
LTS......Page 404
Writing tests for a YouTubeSearchApp......Page 405
Installing LTS......Page 406
Creating a Lightning Component test via CLI......Page 407
Testing for search terms rendered via two-way binding......Page 408
Verifying the response by mocking the server response using Jasmine spy......Page 410
Testing application events......Page 413
Summary......Page 414
Chapter 15
: Publishing Lightning Components on AppExchange......Page 415
Namespacing Salesforce developer instances for managed package generation......Page 416
The impact of namespacing Salesforce instances on the component bundle......Page 417
Creating scratch Orgs with namespaces......Page 423
Creating a managed package......Page 425
Documenting your components using the auradoc file......Page 429
Using the design file to allow admins to configure attributes......Page 432
Publishing components on AppExchange......Page 435
Summary......Page 437
Other Books You May Enjoy......Page 438
Index......Page 441