SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Lightning Out:
Components on Any Platform
London | May 19, 2016
Speaker
Andrew Fawcett
CTO, FinancialForce
Salesforce MVP, Certified Developer
and Advanced Developer
@andyinthecloud
andyinthecloud.com
Agenda
▪ Components, Containers and Events
▪ Address Finder Components
▪ Components in Lightning Experience! *NEW*
▪ Components on Any Platform aka “Lightning Out” *NEW*
▪ Components in Google App Add-ons
▪ Google App Script Tips and Tricks
▪ Resources and Q&A
Component Container
- Loads Components
- Ask each Component render
- Manages Events
Lightning Components Overview
Component
- Renders
- Attributes
- Methods
- Events
▪ Application vs
Component
Events
▪ Component
events within
containment
hierarchy
Lightning Components Publish and Subscribe
Component B
- Handles event
Component C
- Handles event
Event
- MyAppEvent
MyAppEvent
Component A
- Registers the event
- Fires event
Address Finder in Lightning Experience
Separation of Concerns between searching
and how addresses are displayed
AddressInfo Event
AddressFinder.cmp
Address.cmp
Demo
Customising Lightning Experience
with Lightning Components
Enabling for Lightning App Builder and Pages
General steps to enable for Lightning App Builder and Pages.
● Enable My Domain in Your Org
● Add a New Interface/s to Your Component
● Add a Design Resource to Your Component Bundle
● Optional: Add an SVG Resource to Your Component Bundle
More information can be found in the documentation.
Lightning Out, Components on Any Platform
Lightning Out Requirements
▪ Lightning Components should be GLOBAL
▪ Lightning “Dependency” App
– Only top level components you intend to use
▪ Container Page supports <SCRIPT> import
– Import lightning.out.js library into the page
▪ Authentication is handled by the “container” or you!
– Session ID is available (e.g Visualforce page,)
– Or implements oAuth
Lightning Out: Components on Any Platform
What about Google App Add-ons?
Demo
Integrating Lightning Components
in Google Documents via Google App Add-ons
Address Finder in Google Documents
Separation of Concerns means that the
Address Finder component knows nothing of
how the AddressInfo event will be handled. In
this case by some Google App Script!
AddressFinder.cmp
AddressInfo Event
What just happened?
ComponentA
https://mydomain.lightning.force.com/lightning
<html>
<body>
<div id=”mycontainer”>
</div>
<script src=”./lightning.out.js”>
</script>
<script>
$Lightning.use(
“LightningOutApp” ...
“ComponetA”... “mycontainer”);
</script>
</div>
...
https://*.googleusercontent.com
LightingOutApp
ComponentB
ComponentChild
1
2
CORS
3Component A
4
CORS, Cross-Origin Resource Sharing?
https://...lightning.force.com
Resources /some/api/resource
- GET, POST, UPDATE, PATCH ...
https://*.googleusercontent.com
<script>
XMLHttpRequest….. send(...)
</script>
Exposing your Components Lightning Out
Note: Inclusion of SLDS
css file in Lightning
“Dependency” App.
Must be absolute path.
Using the Lightning Out JavaScript API
Note: Notice the class=”slds” being applied to the containing <div> element.
Currently styles defined by the container are not imported by Lightning Out. Hence must
be explicitly imported via the Lightning “Dependency” App.
Using the Lightning Out JavaScript API
Google App Script and Lightning Out
▪ oAuth is supported, but the user experience is not great
– See https://github.com/googlesamples/apps-script-oauth2
Google App Script Document API’s
▪ Rich API’s for working with
document content
▪ Rich UI’s in HTML pose a challenge to
traditional accessibility tools
▪ Accessible Rich Internet Applications (Aria)
– Research it and find out more at
https://www.w3.org/WAI/intro/aria.php
▪ Lightning Design System
Examples adopting Aria!
Global Accessibility Awareness Day
Resources and Q&A
▪ Source Code in GitHub Stash
– https://gist.github.com/afawcett/6a38c589e3ae18ad2d16d4ee98e00b17
▪ Lightning Components Developer Guide
– https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning
▪ Quickstart: Add-on for Google Docs
– https://developers.google.com/apps-script/quickstart/docs#set_it_up
▪ Google App Script oAuth2 Library
– https://github.com/googlesamples/apps-script-oauth2
▪ My Twitter and Blog
Salesforce World Tour 2016 : Lightning Out : Components on any Platform

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Salesforce Lightning Components Workshop
Salesforce Lightning Components WorkshopSalesforce Lightning Components Workshop
Salesforce Lightning Components Workshop
 
Logic apps and PowerApps - Integrate across your APIs
Logic apps and PowerApps - Integrate across your APIsLogic apps and PowerApps - Integrate across your APIs
Logic apps and PowerApps - Integrate across your APIs
 
Connecticut Salesforce Developer Group - Jan 2017
Connecticut Salesforce Developer Group - Jan 2017Connecticut Salesforce Developer Group - Jan 2017
Connecticut Salesforce Developer Group - Jan 2017
 
Lightning Components Workshop v2
Lightning Components Workshop v2Lightning Components Workshop v2
Lightning Components Workshop v2
 
Mastering the Lightning Framework - Part 2
Mastering the Lightning Framework - Part 2Mastering the Lightning Framework - Part 2
Mastering the Lightning Framework - Part 2
 
Do's and don'ts for Office 365 development
Do's and don'ts for Office 365 developmentDo's and don'ts for Office 365 development
Do's and don'ts for Office 365 development
 
synebo talk #1 Salesforce lightning
synebo talk #1 Salesforce lightningsynebo talk #1 Salesforce lightning
synebo talk #1 Salesforce lightning
 
Introduction to Analytics Cloud
Introduction to Analytics CloudIntroduction to Analytics Cloud
Introduction to Analytics Cloud
 
Streamline Workflows Using Salesforce Process builder
Streamline Workflows Using Salesforce Process builderStreamline Workflows Using Salesforce Process builder
Streamline Workflows Using Salesforce Process builder
 
Lighnting component development
Lighnting component developmentLighnting component development
Lighnting component development
 
Salesforce Lightning workshop Hartford - 12 March
Salesforce Lightning workshop Hartford - 12 MarchSalesforce Lightning workshop Hartford - 12 March
Salesforce Lightning workshop Hartford - 12 March
 
Let's Build an Editor Macro with Forge UI
Let's Build an Editor Macro with Forge UILet's Build an Editor Macro with Forge UI
Let's Build an Editor Macro with Forge UI
 
Go Faster with Lightning Process Builder
Go Faster with Lightning Process BuilderGo Faster with Lightning Process Builder
Go Faster with Lightning Process Builder
 
Mobile Apps CI
Mobile Apps CIMobile Apps CI
Mobile Apps CI
 
Mulesoft intergrate for android app
Mulesoft intergrate for android appMulesoft intergrate for android app
Mulesoft intergrate for android app
 
Application innovation & Developer Productivity
Application innovation & Developer ProductivityApplication innovation & Developer Productivity
Application innovation & Developer Productivity
 
Apex code Benchmarking
Apex code BenchmarkingApex code Benchmarking
Apex code Benchmarking
 
Building Mobile Apps: A PhoneGap Enterprise Introduction for Developers
Building Mobile Apps: A PhoneGap Enterprise Introduction for DevelopersBuilding Mobile Apps: A PhoneGap Enterprise Introduction for Developers
Building Mobile Apps: A PhoneGap Enterprise Introduction for Developers
 
Force.com Friday - Intro to Force.com
Force.com Friday -  Intro to Force.comForce.com Friday -  Intro to Force.com
Force.com Friday - Intro to Force.com
 
O365con14 - the new sharepoint online apps - napa in action
O365con14 - the new sharepoint online apps - napa in actionO365con14 - the new sharepoint online apps - napa in action
O365con14 - the new sharepoint online apps - napa in action
 

Andere mochten auch

Andere mochten auch (16)

Lightning Out: Components for the Rest of the World
Lightning Out: Components for the Rest of the WorldLightning Out: Components for the Rest of the World
Lightning Out: Components for the Rest of the World
 
Building strong foundations apex enterprise patterns
Building strong foundations apex enterprise patternsBuilding strong foundations apex enterprise patterns
Building strong foundations apex enterprise patterns
 
Apex Design Patterns
Apex Design PatternsApex Design Patterns
Apex Design Patterns
 
Real-time SQL Access to Your Salesforce.com Data Using Progress Data Direct
Real-time SQL Access to Your Salesforce.com Data Using Progress Data DirectReal-time SQL Access to Your Salesforce.com Data Using Progress Data Direct
Real-time SQL Access to Your Salesforce.com Data Using Progress Data Direct
 
Lightning strikes twice- SEDreamin
Lightning strikes twice- SEDreaminLightning strikes twice- SEDreamin
Lightning strikes twice- SEDreamin
 
Apex Connector for Lightning Connect: Make Anything a Salesforce Object
Apex Connector for Lightning Connect: Make Anything a Salesforce ObjectApex Connector for Lightning Connect: Make Anything a Salesforce Object
Apex Connector for Lightning Connect: Make Anything a Salesforce Object
 
Force.com Canvas in the Publisher and Chatter Feed
Force.com Canvas in the Publisher and Chatter FeedForce.com Canvas in the Publisher and Chatter Feed
Force.com Canvas in the Publisher and Chatter Feed
 
JSforceではじめるSalesforce APIの世界
JSforceではじめるSalesforce APIの世界JSforceではじめるSalesforce APIの世界
JSforceではじめるSalesforce APIの世界
 
Lightning Connect: Lessons Learned
Lightning Connect: Lessons LearnedLightning Connect: Lessons Learned
Lightning Connect: Lessons Learned
 
Lightning Connect Custom Adapters: Connecting Anything with Salesforce
Lightning Connect Custom Adapters: Connecting Anything with SalesforceLightning Connect Custom Adapters: Connecting Anything with Salesforce
Lightning Connect Custom Adapters: Connecting Anything with Salesforce
 
Two-Way Integration with Writable External Objects
Two-Way Integration with Writable External ObjectsTwo-Way Integration with Writable External Objects
Two-Way Integration with Writable External Objects
 
Design Patterns for Asynchronous Apex
Design Patterns for Asynchronous ApexDesign Patterns for Asynchronous Apex
Design Patterns for Asynchronous Apex
 
Apex Design Patterns
Apex Design PatternsApex Design Patterns
Apex Design Patterns
 
Secure Salesforce: Lightning Components Best Practices
Secure Salesforce: Lightning Components Best PracticesSecure Salesforce: Lightning Components Best Practices
Secure Salesforce: Lightning Components Best Practices
 
Access External Data in Real-time with Lightning Connect
Access External Data in Real-time with Lightning ConnectAccess External Data in Real-time with Lightning Connect
Access External Data in Real-time with Lightning Connect
 
Salesforce Health Cloud and Partners: Improving the Care Experience
Salesforce Health Cloud and Partners: Improving the Care ExperienceSalesforce Health Cloud and Partners: Improving the Care Experience
Salesforce Health Cloud and Partners: Improving the Care Experience
 

Ähnlich wie Salesforce World Tour 2016 : Lightning Out : Components on any Platform

Ähnlich wie Salesforce World Tour 2016 : Lightning Out : Components on any Platform (20)

Mobile backends with Google Cloud Platform (MBLTDev'14)
Mobile backends with Google Cloud Platform (MBLTDev'14)Mobile backends with Google Cloud Platform (MBLTDev'14)
Mobile backends with Google Cloud Platform (MBLTDev'14)
 
Android 103 - Firebase and Architecture Components
Android 103 - Firebase and Architecture ComponentsAndroid 103 - Firebase and Architecture Components
Android 103 - Firebase and Architecture Components
 
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
 
Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)
Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)
Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
 
AppliFire Blue Print Design Guidelines
AppliFire Blue Print Design GuidelinesAppliFire Blue Print Design Guidelines
AppliFire Blue Print Design Guidelines
 
Lightning salesforce
Lightning salesforceLightning salesforce
Lightning salesforce
 
[WSO2 Integration Summit Bern 2019] API-led Integration
[WSO2 Integration Summit Bern 2019] API-led Integration[WSO2 Integration Summit Bern 2019] API-led Integration
[WSO2 Integration Summit Bern 2019] API-led Integration
 
An introduction to Microsoft Graph for developers
An introduction to Microsoft Graph for developersAn introduction to Microsoft Graph for developers
An introduction to Microsoft Graph for developers
 
Shine a Light with Prism (the Composite Application Guidance for WPF and Silv...
Shine a Light with Prism (the Composite Application Guidance for WPF and Silv...Shine a Light with Prism (the Composite Application Guidance for WPF and Silv...
Shine a Light with Prism (the Composite Application Guidance for WPF and Silv...
 
TechEvent Advanced Service Worker / PWA with Google Workbox
TechEvent Advanced Service Worker / PWA with Google WorkboxTechEvent Advanced Service Worker / PWA with Google Workbox
TechEvent Advanced Service Worker / PWA with Google Workbox
 
M365 global developer bootcamp 2019 PA
M365 global developer bootcamp 2019  PAM365 global developer bootcamp 2019  PA
M365 global developer bootcamp 2019 PA
 
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootSpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
 
Bootstrapping an App for Launch
Bootstrapping an App for LaunchBootstrapping an App for Launch
Bootstrapping an App for Launch
 
M365 global developer bootcamp 2019
M365 global developer bootcamp 2019M365 global developer bootcamp 2019
M365 global developer bootcamp 2019
 
Spring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsugSpring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsug
 
ESPL implementing scalable salesforce integrations for enterprises v1.3
ESPL implementing scalable salesforce integrations for enterprises v1.3ESPL implementing scalable salesforce integrations for enterprises v1.3
ESPL implementing scalable salesforce integrations for enterprises v1.3
 
Building a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one weekBuilding a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one week
 
M365 global developer bootcamp 2019 Intro to SPFx Version
M365 global developer bootcamp 2019 Intro to SPFx VersionM365 global developer bootcamp 2019 Intro to SPFx Version
M365 global developer bootcamp 2019 Intro to SPFx Version
 
Salesforce Lightning workshop
Salesforce Lightning workshopSalesforce Lightning workshop
Salesforce Lightning workshop
 

Kürzlich hochgeladen

%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 

Kürzlich hochgeladen (20)

%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 

Salesforce World Tour 2016 : Lightning Out : Components on any Platform

  • 1. Lightning Out: Components on Any Platform London | May 19, 2016
  • 2. Speaker Andrew Fawcett CTO, FinancialForce Salesforce MVP, Certified Developer and Advanced Developer @andyinthecloud andyinthecloud.com
  • 3. Agenda ▪ Components, Containers and Events ▪ Address Finder Components ▪ Components in Lightning Experience! *NEW* ▪ Components on Any Platform aka “Lightning Out” *NEW* ▪ Components in Google App Add-ons ▪ Google App Script Tips and Tricks ▪ Resources and Q&A
  • 4. Component Container - Loads Components - Ask each Component render - Manages Events Lightning Components Overview Component - Renders - Attributes - Methods - Events
  • 5. ▪ Application vs Component Events ▪ Component events within containment hierarchy Lightning Components Publish and Subscribe Component B - Handles event Component C - Handles event Event - MyAppEvent MyAppEvent Component A - Registers the event - Fires event
  • 6. Address Finder in Lightning Experience Separation of Concerns between searching and how addresses are displayed AddressInfo Event AddressFinder.cmp Address.cmp
  • 8. Enabling for Lightning App Builder and Pages General steps to enable for Lightning App Builder and Pages. ● Enable My Domain in Your Org ● Add a New Interface/s to Your Component ● Add a Design Resource to Your Component Bundle ● Optional: Add an SVG Resource to Your Component Bundle More information can be found in the documentation.
  • 9. Lightning Out, Components on Any Platform
  • 10. Lightning Out Requirements ▪ Lightning Components should be GLOBAL ▪ Lightning “Dependency” App – Only top level components you intend to use ▪ Container Page supports <SCRIPT> import – Import lightning.out.js library into the page ▪ Authentication is handled by the “container” or you! – Session ID is available (e.g Visualforce page,) – Or implements oAuth
  • 11. Lightning Out: Components on Any Platform
  • 12. What about Google App Add-ons?
  • 13. Demo Integrating Lightning Components in Google Documents via Google App Add-ons
  • 14. Address Finder in Google Documents Separation of Concerns means that the Address Finder component knows nothing of how the AddressInfo event will be handled. In this case by some Google App Script! AddressFinder.cmp AddressInfo Event
  • 15. What just happened? ComponentA https://mydomain.lightning.force.com/lightning <html> <body> <div id=”mycontainer”> </div> <script src=”./lightning.out.js”> </script> <script> $Lightning.use( “LightningOutApp” ... “ComponetA”... “mycontainer”); </script> </div> ... https://*.googleusercontent.com LightingOutApp ComponentB ComponentChild 1 2 CORS 3Component A 4
  • 16. CORS, Cross-Origin Resource Sharing? https://...lightning.force.com Resources /some/api/resource - GET, POST, UPDATE, PATCH ... https://*.googleusercontent.com <script> XMLHttpRequest….. send(...) </script>
  • 17. Exposing your Components Lightning Out Note: Inclusion of SLDS css file in Lightning “Dependency” App. Must be absolute path.
  • 18. Using the Lightning Out JavaScript API Note: Notice the class=”slds” being applied to the containing <div> element. Currently styles defined by the container are not imported by Lightning Out. Hence must be explicitly imported via the Lightning “Dependency” App.
  • 19. Using the Lightning Out JavaScript API
  • 20. Google App Script and Lightning Out ▪ oAuth is supported, but the user experience is not great – See https://github.com/googlesamples/apps-script-oauth2
  • 21. Google App Script Document API’s ▪ Rich API’s for working with document content
  • 22. ▪ Rich UI’s in HTML pose a challenge to traditional accessibility tools ▪ Accessible Rich Internet Applications (Aria) – Research it and find out more at https://www.w3.org/WAI/intro/aria.php ▪ Lightning Design System Examples adopting Aria! Global Accessibility Awareness Day
  • 23. Resources and Q&A ▪ Source Code in GitHub Stash – https://gist.github.com/afawcett/6a38c589e3ae18ad2d16d4ee98e00b17 ▪ Lightning Components Developer Guide – https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning ▪ Quickstart: Add-on for Google Docs – https://developers.google.com/apps-script/quickstart/docs#set_it_up ▪ Google App Script oAuth2 Library – https://github.com/googlesamples/apps-script-oauth2 ▪ My Twitter and Blog

Hinweis der Redaktion

  1. - Customise the Home page - Put a more than one Address component on the page
  2. - Illustrate how the LC components HTML and JavaScript was injected into the host page, no IFRAME!