General Lightning Questions

Q: What is Lightning?

A: Lightning is the collection of tools and technologies behind a significant upgrade to the Salesforce platform. Lightning includes:

  • Experience: A set of modern user interfaces optimized for speed. This includes the Lightning Experience, Salesforce1 Mobile app and template-based communities.
  • Lightning Component Framework: A JavaScript framework and set of standard components that allow you to build reusable components to customize the Lightning Experience, Salesforce1 Mobile app and template-based communities and build your own standalone apps.
  • Visual Building Tools: Drag-and-drop technologies for fast and easy app building & customizations. Use the Lightning App Builder to customize the Lightning Experience and Salesforce1 Mobile app. Use the Community Builder to customize template-based communities.
  • Lightning Exchange: A section of the AppExchange where you can find 70+ partner components to jumpstart your development.
  • Lightning Design System: Style guides and modern enterprise UX best practices to build pixel perfect apps that match the look and feel of the Lightning Experience and Salesforce1 Mobile app.

Q: Is Lightning an MVC framework?

A: No, it’s a component-based framework.

Q: When will Lightning Components be GA?

A: Lightning components are now GA (generally available) across all Salesforce-supported platforms.

Q: How do I use Lightning Components in Lightning Experience?

A: See the Using Lightning Components in Lightning Experience unit in the Lightning Experience Development module on Trailhead.

Q: How do I use Lightning Components with the Salesforce1 Mobile App?

A: Create a custom Lightning tab that points to your component and include that tab in your Salesforce1 Mobile navigation.

Q: If Lightning Experience or Salesforce1 uses Lightning Components, will those Lightning Components (for example, the calendar component, input fields, etc.) be exposed as “standard components” for developers to use in the future with standard Salesforce styling?

A: We will be releasing a majority of those components incrementally with each major release.

Q: Which parts of Lightning Components are server-side and which are client-side?

A: Lightning Components can use JavaScript on the client side and Apex on the server side.

Q: What is Lightning Locker Service?

A: See Introducing The LockerService For Lightning Components

Q. Can I make one component inherit styles/CSS from a parent component, or must I always define it in the component?

A. Yes, you can inherit styles.

Visualforce and Lightning

Q: Can I make a Lightning Component that shows up in both the mobile and the desktop user interfaces?

A: You can use Lightning Components directly in Lightning Experience, the Salesforce1 Mobile app, template-based communities, and custom standalone apps. Additionally, you can include Lightning components in a Visualforce page, allowing you to use them in Salesforce Classic, Console, and Visualforce-based communities.

Q: Visualforce already has components. How are Lightning Component different and why would I want to use them?

A: Visualforce components are page-centric and most of the work is done on the server. Lightning is designed from the component up, rather than having the concept of a page as its fundamental unit. Lightning Components are client-side centric, which makes them more dynamic and mobile-friendly.

See the User Interface Development Considerations unit of the Lightning Experience Development module on Trailhead for an in-depth explanation of this issue.

Q: What happens to my existing Visualforce Pages?

A: They’ll continue to be supported in the current UI and Lightning Experience. See the Trailhead module on this topic.

Q: Does Lightning work with Visualforce?

A: Yep. See Add Lightning Components to Visualforce Pages in the Lightning Components Developer's Guide for details.

Q: Will Lightning Components be replacing Visualforce?

A: Nope. See the User Interface Development Considerations unit of the Lightning Experience Development module on Trailhead for an in-depth explanation of this issue.

Q: Now that Lightning Components are GA, when would it still be appropriate to use Visualforce?

A: Visualforce provides the facility for delivering template-driven web pages and email messages. In addition, developers wishing to simply utilize a basic container and maintain more control over the lifecycle of the request may choose Visualforce pages. Finally, organizations that can’t use Apex code can’t use Lightning Components, but they can use Visualforce.

See the User Interface Development Considerations unit of the Lightning Experience Development module on Trailhead for an in-depth explanation of this issue.

Namespace Questions

Q: What is Aura? Why do I see the aura: namespace in the code?

A: Aura is the open source technology that powers Lightning Components. The aura: namespace contains all of the basic building blocks for defining components and applications.

Q: Do I need a namespace to develop Lightning Components?

A: No. Lightning Components used to require a namespace, but that is no longer a requirement.

Q: Should I change my development process to start using namespaces and managed packages?

A: We don’t recommend changing your development process to use namespaces and managed packages if you aren’t already using them. That said, they are an important part of sophisticated development processes, so as your organization's processes mature, you should consider them for a variety of reasons.

Q: I already have a Developer Edition I use for a package I uploaded to the AppExchange. Should I use this namespaced org to create my Lightning Components or get a new one?

A: If Lightning Components are useful for your current app, you may want to use them in your existing org. If you're creating a separate app, you might want to consider using a new namespace for it. This best practice isn't particularly specific to Lightning Components.

General Coding Questions

Q: Where can a component be displayed?

A: After you create a component, you will want to display it somewhere. There are a number of possibilities.

  • Lightning Experience: Display your component in the Lightning Experience using the App Builder. You can edit the home page, edit a record detail page or create/edit a new app page to include it. Alternatively, you can create a custom Lightning tab that references your component and add that tab to your Lightning navigation.
  • Salesforce1 Mobile app: Display your component in the Salesforce1 Mobile app by creating a custom Lightning tab that references it and adding that tab in your mobile navigation.
  • Template-based community: Display your component in your template-based (e.g. Napili) community using the Community Builder.
  • Standalone Lightning app: Create a standalone Lightning app (e.g. myapp.app) and include your component in this app. Access your Lightning app by URL.

Q: Do I always create an app bundle first?

A: Not necessarily, you can start with a Component bundle.

Q: How much Javascript do I need to know to develop Lightning Components?

A: You need at least intermediate-level JavaScript knowledge.

Q: Are Lightning Components intended only for mobile apps?

A: Components have been built to be mobile first, but with responsive design in mind. With Lightning you can build responsive apps fast for desktop, mobile and tablets.

Q: How do I deploy components to my production org?

A: You can develop Lightning Components in a sandbox or Developer Edition org and then deploy them to any organization that supports Apex using managed packages, Force.com IDE, Force.com Migration Tool or Change Sets. NOTE: We don’t recommend changing your development process to use namespaces and managed packages if you aren’t already using them.

Q: How do I include external JavaScript libraries in my components?

A: You can use a RequireJS component or Loader component (https://github.com/rajaraodv/loadcomponent) to load external JS or CSS files.

Q: Can I integrate Lightning components with another framework, such as Angular?

A: Yes. You can include the working 3rd party code inside a Visualforce Page, embed the Visualforce Page inside a Lightning Component. This Lightning Component can be used as any other Lightning Component in various environments.

The use of 3rd party frameworks directly inside Lightning Components is not supported. Packages with components that directly include 3rd party frameworks submitted to the AppExchange security review will automatically fail. We strongly suggest that your review our security review requirements for components before submitting.

Q: How is Lightning aware of what record you are on if you embed it in Salesforce1? (i.e. how do you get the ID of the record you are on like in a standard controller)?

A: Your component just needs to implement the force:recordTab interface and the record and recordId will be automatically injected when your component is wired into record home.

Q: Are there any CSS (styles) provided by salesforce.com as part of the supported Lightning Components?

A: Yes. See Salesforce Lightning Design System