Use Lightning Components in Lightning Experience
- 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.
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.
- Out-of-the-Box Component Set
- Salesforce provides a number of components to bootstrap your app development.
- 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.
We’ve covered some 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 need to do things like render PDFs from a page. Visualforce hasn’t gone away, and remains a foundational part of developing on the Salesforce platform.
The Lightning Components framework is, relatively speaking, the new kid on the block—but this new kid has skills. While there are a few specific limitations of Lightning components, for the most part it’s ready to go. There are many situations where you should consider making the switch to developing with Lightning components. Salesforce 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.
- 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.
- Salesforce App
- 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 Lightning components and run it wherever your users are.
- Screen Flows
- If you haven't taken advantage of screen flows yet, you're missing out on a powerful way to guide your users through a business process. Customize the look-and-feel and functionality of your flow’s screens by adding Lightning components to them.
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.