Learning Objectives

After completing this unit, you’ll be able to:
  • Describe the importance of Lightning components to Lightning Experience
  • Name some of the key considerations for using Lightning components over Visualforce
  • Identify three places where you can use Lightning components

Lightning Components in Lightning Experience

By now you’ve read the word “Lightning” so many times it’s probably lost all meaning. Worse, we’ve been talking so much about both “Lightning Experience” and “Lightning components” that maybe the two terms are blurring together. Let’s clear up the relationship between the two.

Remember all that information about developing following either a page-centric or app-centric model? Salesforce Classic uses a page-centric model, but Lightning Experience uses an app-centric model. It’s made up of—you guessed it—components.

You can probably see where this is going. Lightning components were designed with Lightning Experience in mind. As the core Salesforce app shifts to the app-centric framework, we want you to shift along with us. We want you to think about developing on the platform in a whole new way.

You might have developed some Lightning components in Salesforce Classic. You can still use the old interface with Lightning components and all your existing component functionality transfers seamlessly into Lightning Experience.

If you haven’t worked with Lightning components yet, don’t worry. There’s a Trailhead module, a quickstart guide, and a full developer’s guide so that you can start developing in no time. Before you dive in to the technical details, let’s take a second to review some basic advantages of Lightning components:
Out-of-the-Box Component Set
Salesforce provides a number of components to bootstrap your app development.
The component framework leverages a stateful client (using JavaScript) and a stateless server (using Apex). This structure allows the client to call the server only when absolutely necessary. With fewer calls to the server, your apps are more responsive and efficient.
Event-Driven Architecture
Events are key to the Lightning component framework. Components listen to application and component events and respond accordingly.
Rapid Development
The simple markup and pre-made components mean that you can get applications out the door faster than ever. Particularly if you’re comfortable with Visualforce markup, learning component markup is a breeze.
Device-Aware and Cross-Browser Compatibility
A huge advantage of Lightning components is that you don’t have to worry about compatibility across devices and browsers. The component framework handles this work for you.

Considerations for Use

We’ve already covered a lot of the considerations for using Lightning components. You probably don’t want to switch to Lightning components with in-progress Visualforce projects. You also want to stick with Visualforce if you want to do things like render PDFs on a page. Again, Visualforce still works like it used to and continues to be a foundational part of developing on the Salesforce platform. Lightning components are still in their infancy and not all the features you’re used to in Visualforce are fully supported yet. We’ve released several documents outlining the specific limitations of Lightning components so you can decide if they’re right for your immediate development work.

We’ve also covered situations where you should consider making the switch to developing with Lightning components. Salesforce1 mobile development, for example, is a great place to use Lightning components. Also use Lightning components for new projects and any project involving highly interactive applications.

Okay, so we know what to consider. But where exactly can you use Lightning components? You have several options.
Lightning Experience
We said it earlier, but don’t want you to get the wrong idea by leaving it off this list. Lightning Experience and Lightning components are two great tastes that taste great together.
We’re repeating this one often because it’s important: use Lightning components for your mobile development. When you’re using a mobile device, you don’t want to make a call to the server every time a user presses a button. Using Lightning components vastly improves mobile app performance.
Standalone Apps
If you used Lightning components in Salesforce Classic, you probably made at least one standalone Lightning app. Lightning App Builder lets you declaratively create apps with standard components ranging from buttons to Canvas apps. Alternatively, use the Developer Console to create apps made up of both standard and custom Lightning components. See the Lightning Components Developer Guide for more information.
Visualforce Pages
This capability is perfect for Salesforce developers who are Visualforce veterans. If you’re not quite ready to commit to a full Lightning app, smooth the transition by integrating components into Visualforce pages. This task only requires a few lines of markup and gives you a huge amount of flexibility. See the Lightning Components Developer Guide for more information about Lightning Components for Visualforce.
Lightning Out, currently available in beta, lets you run your Lightning components and apps, well, pretty much anywhere you can serve a web page. Whether it’s a Node.js app running on Heroku, a department server inside the firewall, or even SharePoint (yes, SharePoint), build your custom app with Force.com and run it wherever your users are.

As much engineering effort as we’ve put into making Lightning components a framework you can use to create applications for the next decade, we’re not done. There’s still a few places where you can use Visualforce to customize Salesforce but you can’t yet use Lightning components. Stay tuned to this channel.

Share Time Estimate

Having trouble with your challenge verification?

Here are some tips:

  1. Check for typos (hey, it happens)
  2. Try using a new Developer Edition (existing customizations can interfere with the validation)