Introduction to Lightning Components, Lightning Components in Visualforce, and Lightning Out technologies of the Salesforce App Cloud.
Presented at 4th Annual PhillyForce Conference, May 4, 2016.
https://www.meetup.com/PhillyForce/events/228226665/
1. Put Lightning Out in
ALL THE THINGS
Use your Lightning Components anywhere
Mary Scotton
Principal Developer Evangelist
mscotton@salesforce.com
@rockchick322004
www.maryscotton.com
2. Forward Looking Statements
Safe harbor statement under the Private Securities Litigation Reform Act of 1995:
This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties
materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results
expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be
deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other
financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any
statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services.
The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new
functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our
operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any
litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our
relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of
our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to
larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is
included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent
fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor
Information section of our Web site.
Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently
available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based
upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-
looking statements.
4. Let’s do a quick Lightning Recap
Before we talk about Lightning Out
What is Lightning?
a. A new User Experience for Salesforce
b. A set of tools to visually build apps on top of Salesforce
c. A design system of tools and best practices for creating custom UIs
d. A component framework for building custom apps
e. ALL THE THINGS Correct Answer
What we’re talking
about today
6. What are Lightning Components?
Lightning 101
• UI Framework bridges the
client (JS) and server (Apex)
• Reusable building blocks for
an app
• Designed for mobile and
desktop apps
• Built on the open source
Aura framework
7. Developer Benefits from Lightning Components
Lightning 101
Enables your admins in Lightning App Builder & Community Builder
Less Page Refreshes & tightly integrated
Responsive and mobile friendly client-centric design
Modular and event-driven architecture
Device-aware with cross browser compatibility
Reusability
Future of the platform!
8. Anatomy of a Component
D
Component
<c:HotelList/>
Apex ControllerInterfaces
Attributes
Markup
Cmp
Bundle
Data Binding
My Hotel App
Hotel Map
Hotel List
Hotel List Item
11. Recap: Lightning Components in Visualforce
There are only three steps necessary to integrate components:
1. Add <apex:includeLightning/> to your Visualforce page
2. Tell your Visualforce page which Lightning app to use
3. Write a function that creates the component on the page
15. Lightning Out
Requirements
Valid Salesforce session ID (SID), for
example from Oauth
Ability to modify the generated markup for
the remote site
Supports
Secure browser (HTTPS)
Cross-Origin Resouce Sharing (CORS)
17. What is Lightning?
a. A new User Experience for Salesforce
b. A set of tools to visually build apps on top of Salesforce
c. A design system of tools and best practices for creating custom UIs
d. A component framework for building custom apps
e. ALL THE THINGS
Let’s talk
about this
for a sec
18. Build pixel-perfect apps every time, every where.
Design
Guidelines
Framework
Agnostic
Salesforce Lightning Design SystemNEW
Trust
UI
Library
Living
Design
CSS
Framework
22. Lightning Out: Config and Usage
1. Enable My Domain (for Lightning Components)
2. Configure the remote site for CORS and a Connected App with Oauth
3. Create a Lightning App that extends ltng:outApp with dependencies for components
4. Include lightning.out.js in the remote site
<script
src="https://gs0.lightning.force.com/lightning/lightning.out.js"></scrip
t>
5. Authenticate with Salesforce OAuth using the Consumer Key
6. Initialize Lightning App with $Lightning.use, passing in the OAuth token
$Lightning.use(”namespace:appName", function() {}, oauth.instance_url,
oauth.access_token)
7. Add the components to the remote site using $Lightning.createComponent
$Lightning.createComponent(”namespace:cmpName", {}, ”DOMelementId”,
function(cmp) {});