SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

Mais procurados (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
 

Destaque

Destaque (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
 

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

Semelhante a 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
 

Último

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Último (20)

Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 

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

Notas do Editor

  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!