SlideShare una empresa de Scribd logo
1 de 25
Introduction to
Lightning Web
Component
Kitchener, CA Developer Group
Speaker
Date
Venue/Link
Mohith Shrivastava
January 19th, 2019 @ 9:00 AM EST
https://www.gotomeet.me/Sudipta-Deb
Meeting Sponsor
Who Am I? Salesforce Technical Architect
Appirio Inc., a Wipro Company
www.sudipta-deb.in
8x Salesforce Certified Application Architect
Group Leader of Kitchener, CA Developer
Group
311 Badges
@sudipta_1984
Who Am I?
Salesforce Technical Architect @codescience
Salesforce MVP , Author - Learning Salesforce
Application Development
Medium blogs
@msrivastav13
▪ Introduction To Web Components
▪ Difference between Web Components and
Lightning Web Components
▪ Tooling Support for LWC
▪ Demo Lightning Web Component
▪ Compare and Contrast Lightning Web
Components with Aura Components
▪ Explore LWC Properties and Lightning Data
Services
▪ Q & A
Agenda
Introduction To Web Components
Why Web Components ?
● Reusability - Imports , Exports and Templates allow us
to reuse the components
● Composition - Breaking components to smaller chunks
● Encapsulation - Using the shadow DOM
● Standardization - Part of W3C specs and supported by
majority of browsers
Core Elements Of Web Components
★ HTML Templates
★ Custom Elements
★ Shadow DOM
★ ES Modules
Templates and Slots
★ Templates allow us to load HTML tags without
rendering them on initial load.
★ Write once and reuse in multiple pages or multiple
apps.
★ Attach them to Shadow DOM or DOM .
★ Slots are placeholders in template that allow you to
insert your own HTML markup
Template Demo
Custom Elements
Allows us to define an element and let browser learn about the new tag
Shadow DOM
1. Shadow DOM allows the web browser to render DOM
elements without putting them into the main document
DOM tree
2. One can attach shadow DOM to an element using the
API Element.attachShadow({mode:open}).
3. You can attach the Shadow to the custom element .
4. Offers encapsulation (CSS in outer DOM cannot bleed
into the shadow DOM)
Demo
Lightning Web Components (LWC)
➢ Lightning Components used aura framework and its
renamed as Aura Components .
➢ Components built using Web Components standard
now are referred as lightning web components
➢ Lightning Web Components(LWC) adheres closely to
the web components standards.
➢ Modules for Data services , UI API and provides
reactive properties
Difference between Web Components and
LWC
1. Has polyfills to support IE11
2. No need to use the attachShadow() or appendChild() methods . Also
supports browsers that does not implement shadow DOM
3. Protected by locker services that adds additional security
4. Supports app builder ,community builder.
5. Special renderedCallback() method to perform logic after component has
rendered .
6. For better performance there are some rules and restrictions .Refer the git
repo here (https://github.com/salesforce/eslint-plugin-lwc)
Tooling Support For LWC
1. Salesforce VSCode Extension pack helps scaffolding
and language grammar + Deployment
2. Personally built an extension to support faster deploy
and better error display.Its a VScode Plugin and can
be downloaded from marketplace
Demo
Compare LWC with Aura Components
Aura Components Lightning Web Components
<aura:attribute name=”myproperty”> @api myproperty
{!v.myattribute} {myattribute}
no more <aura:handler> and
<aura:register>
const customEvt = new CustomEvent();
this.dispatchEvent(customEvt);
.THIS .myclass {} .myclass {}
aura:facet slot
lightning:layoutitem lightning-layout-item
Javascript Properties
1. Reactive Property - Change in property value
automatically reRenders the template
2. To create a public property use @api
3. To create a private property and re Render DOM use
@track
Lightning Data Service
1. Mark the property with @wire if you want the property
to recieve the change when data change happens to
record
2. LWC supports UI APIs and Metadata describes
References
1. Googles Dev blog
2. LWC Recipes
3. Salesforce Dev blog
4. Salesforce Official docs
Upcoming Salesforce Webinar
https://www.salesforce.com/form/event/lightning-web-
components-launch-event
Demo Resources
1. slider web component demo
2. salesforce lwc demo
Q & A
Thank You

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Introduction to Visualforce
Introduction to VisualforceIntroduction to Visualforce
Introduction to Visualforce
 
OAuth with Salesforce - Demystified
OAuth with Salesforce - DemystifiedOAuth with Salesforce - Demystified
OAuth with Salesforce - Demystified
 
Spring boot
Spring bootSpring boot
Spring boot
 
Introduction to Swagger
Introduction to SwaggerIntroduction to Swagger
Introduction to Swagger
 
Intro to Salesforce Lightning Web Components (LWC)
Intro to Salesforce Lightning Web Components (LWC)Intro to Salesforce Lightning Web Components (LWC)
Intro to Salesforce Lightning Web Components (LWC)
 
Introduction to lightning Web Component
Introduction to lightning Web ComponentIntroduction to lightning Web Component
Introduction to lightning Web Component
 
Deep Dive into Apex Triggers
Deep Dive into Apex TriggersDeep Dive into Apex Triggers
Deep Dive into Apex Triggers
 
Spring ppt
Spring pptSpring ppt
Spring ppt
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
 
Lightning Web Component - LWC
Lightning Web Component - LWCLightning Web Component - LWC
Lightning Web Component - LWC
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Introducing Swagger
Introducing SwaggerIntroducing Swagger
Introducing Swagger
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
 
Angular Basics.pptx
Angular Basics.pptxAngular Basics.pptx
Angular Basics.pptx
 
Angular 8
Angular 8 Angular 8
Angular 8
 
Lightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionLightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An Introduction
 
Introduction to spring boot
Introduction to spring bootIntroduction to spring boot
Introduction to spring boot
 
Introduction to selenium
Introduction to seleniumIntroduction to selenium
Introduction to selenium
 
Angular.ppt
Angular.pptAngular.ppt
Angular.ppt
 
Angular Interview Questions-PDF.pdf
Angular Interview Questions-PDF.pdfAngular Interview Questions-PDF.pdf
Angular Interview Questions-PDF.pdf
 

Similar a Introduction to lightning web component

Mozilla Add-Ons Evolution 2011 in review and Upcoming in 2012
Mozilla Add-Ons Evolution 2011 in review and Upcoming in 2012Mozilla Add-Ons Evolution 2011 in review and Upcoming in 2012
Mozilla Add-Ons Evolution 2011 in review and Upcoming in 2012
Brian King
 

Similar a Introduction to lightning web component (20)

Lightning Web Component in Salesforce
Lightning Web Component in SalesforceLightning Web Component in Salesforce
Lightning Web Component in Salesforce
 
Implementing Vanilla Web Components
Implementing Vanilla Web ComponentsImplementing Vanilla Web Components
Implementing Vanilla Web Components
 
Lightning web components
Lightning web componentsLightning web components
Lightning web components
 
Lightning web components
Lightning web componentsLightning web components
Lightning web components
 
Introduction to Lightning Web Components
Introduction to Lightning Web ComponentsIntroduction to Lightning Web Components
Introduction to Lightning Web Components
 
Lightning Web Components
Lightning Web ComponentsLightning Web Components
Lightning Web Components
 
Lightning Web Components- Ep 0 - Introduction
Lightning Web Components- Ep 0 - IntroductionLightning Web Components- Ep 0 - Introduction
Lightning Web Components- Ep 0 - Introduction
 
Live Session1 lightning web component
Live Session1 lightning web componentLive Session1 lightning web component
Live Session1 lightning web component
 
What's new in Portal and WCM 8.5
What's new in Portal and WCM 8.5What's new in Portal and WCM 8.5
What's new in Portal and WCM 8.5
 
Getting Started with Lightning Web Components | LWC | Salesforce
Getting Started with Lightning Web Components | LWC | SalesforceGetting Started with Lightning Web Components | LWC | Salesforce
Getting Started with Lightning Web Components | LWC | Salesforce
 
6 reasons developers should consider salesforce lightning web components
6 reasons developers should consider salesforce lightning web components6 reasons developers should consider salesforce lightning web components
6 reasons developers should consider salesforce lightning web components
 
Lightning Web Components
Lightning Web ComponentsLightning Web Components
Lightning Web Components
 
Lightning Web Components by Abdul Gafoor
Lightning Web Components by Abdul GafoorLightning Web Components by Abdul Gafoor
Lightning Web Components by Abdul Gafoor
 
Mozilla Add-Ons Evolution 2011 in review and Upcoming in 2012
Mozilla Add-Ons Evolution 2011 in review and Upcoming in 2012Mozilla Add-Ons Evolution 2011 in review and Upcoming in 2012
Mozilla Add-Ons Evolution 2011 in review and Upcoming in 2012
 
Lightning Web Component Structure Benefit
Lightning Web Component Structure BenefitLightning Web Component Structure Benefit
Lightning Web Component Structure Benefit
 
An Introduction to Lightning Web Components
An Introduction to Lightning Web ComponentsAn Introduction to Lightning Web Components
An Introduction to Lightning Web Components
 
RVA intro to LWC- Salesforce Dev Week
RVA intro to LWC-  Salesforce Dev WeekRVA intro to LWC-  Salesforce Dev Week
RVA intro to LWC- Salesforce Dev Week
 
Introduction to lightning components
Introduction to lightning componentsIntroduction to lightning components
Introduction to lightning components
 
Introduction to lightning components
Introduction to lightning componentsIntroduction to lightning components
Introduction to lightning components
 
Vue3: nuove funzionalità, differenze e come migrare
Vue3: nuove funzionalità, differenze e come migrareVue3: nuove funzionalità, differenze e come migrare
Vue3: nuove funzionalità, differenze e come migrare
 

Más de Sudipta Deb ☁

Más de Sudipta Deb ☁ (16)

Kitchener Canada Developer Group Event: From Admin to Certified Technical Arc...
Kitchener Canada Developer Group Event: From Admin to Certified Technical Arc...Kitchener Canada Developer Group Event: From Admin to Certified Technical Arc...
Kitchener Canada Developer Group Event: From Admin to Certified Technical Arc...
 
Kitchener Developer Group's session on "All about events"
Kitchener Developer Group's session on "All about events"Kitchener Developer Group's session on "All about events"
Kitchener Developer Group's session on "All about events"
 
DevOps 101
DevOps 101DevOps 101
DevOps 101
 
Learn how Source Tracking can keep metadata changes in sync between your loca...
Learn how Source Tracking can keep metadata changes in sync between your loca...Learn how Source Tracking can keep metadata changes in sync between your loca...
Learn how Source Tracking can keep metadata changes in sync between your loca...
 
Orchestrate all of your salesforce automation with the trigger actions framework
Orchestrate all of your salesforce automation with the trigger actions frameworkOrchestrate all of your salesforce automation with the trigger actions framework
Orchestrate all of your salesforce automation with the trigger actions framework
 
Let's Learn About Heroku and How to Integrate with Salesforce
Let's Learn About Heroku and How to Integrate with SalesforceLet's Learn About Heroku and How to Integrate with Salesforce
Let's Learn About Heroku and How to Integrate with Salesforce
 
Using Styling Hooks to Customize Your LWC
Using Styling Hooks to Customize Your LWCUsing Styling Hooks to Customize Your LWC
Using Styling Hooks to Customize Your LWC
 
Shadow DOM, CSS and Styling Hooks in LWC what you need to know
Shadow DOM, CSS and Styling Hooks in LWC  what you need to knowShadow DOM, CSS and Styling Hooks in LWC  what you need to know
Shadow DOM, CSS and Styling Hooks in LWC what you need to know
 
Algorithms design and analysis, part 1
Algorithms  design and analysis, part 1Algorithms  design and analysis, part 1
Algorithms design and analysis, part 1
 
Functional programming principles in scala
Functional programming principles in scalaFunctional programming principles in scala
Functional programming principles in scala
 
Principles of reactive programming
Principles of reactive programmingPrinciples of reactive programming
Principles of reactive programming
 
Automate the development lifecycle with cumulus ci on april 9th, 2020
Automate the development lifecycle with cumulus ci on april 9th, 2020Automate the development lifecycle with cumulus ci on april 9th, 2020
Automate the development lifecycle with cumulus ci on april 9th, 2020
 
Dreamforce Global Gathering
Dreamforce Global GatheringDreamforce Global Gathering
Dreamforce Global Gathering
 
Kitchener Salesforce Developer Group Event - Introduction to dev ops with Sal...
Kitchener Salesforce Developer Group Event - Introduction to dev ops with Sal...Kitchener Salesforce Developer Group Event - Introduction to dev ops with Sal...
Kitchener Salesforce Developer Group Event - Introduction to dev ops with Sal...
 
Kitchener CA Developer Group Presents Everything you need to know about Einst...
Kitchener CA Developer Group Presents Everything you need to know about Einst...Kitchener CA Developer Group Presents Everything you need to know about Einst...
Kitchener CA Developer Group Presents Everything you need to know about Einst...
 
Building lightning apps by Daniel Peter
Building lightning apps by Daniel PeterBuilding lightning apps by Daniel Peter
Building lightning apps by Daniel Peter
 

Último

Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Último (20)

Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 

Introduction to lightning web component

  • 1. Introduction to Lightning Web Component Kitchener, CA Developer Group Speaker Date Venue/Link Mohith Shrivastava January 19th, 2019 @ 9:00 AM EST https://www.gotomeet.me/Sudipta-Deb
  • 3. Who Am I? Salesforce Technical Architect Appirio Inc., a Wipro Company www.sudipta-deb.in 8x Salesforce Certified Application Architect Group Leader of Kitchener, CA Developer Group 311 Badges @sudipta_1984
  • 4. Who Am I? Salesforce Technical Architect @codescience Salesforce MVP , Author - Learning Salesforce Application Development Medium blogs @msrivastav13
  • 5. ▪ Introduction To Web Components ▪ Difference between Web Components and Lightning Web Components ▪ Tooling Support for LWC ▪ Demo Lightning Web Component ▪ Compare and Contrast Lightning Web Components with Aura Components ▪ Explore LWC Properties and Lightning Data Services ▪ Q & A Agenda
  • 6. Introduction To Web Components
  • 7. Why Web Components ? ● Reusability - Imports , Exports and Templates allow us to reuse the components ● Composition - Breaking components to smaller chunks ● Encapsulation - Using the shadow DOM ● Standardization - Part of W3C specs and supported by majority of browsers
  • 8.
  • 9. Core Elements Of Web Components ★ HTML Templates ★ Custom Elements ★ Shadow DOM ★ ES Modules
  • 10. Templates and Slots ★ Templates allow us to load HTML tags without rendering them on initial load. ★ Write once and reuse in multiple pages or multiple apps. ★ Attach them to Shadow DOM or DOM . ★ Slots are placeholders in template that allow you to insert your own HTML markup
  • 12. Custom Elements Allows us to define an element and let browser learn about the new tag
  • 13. Shadow DOM 1. Shadow DOM allows the web browser to render DOM elements without putting them into the main document DOM tree 2. One can attach shadow DOM to an element using the API Element.attachShadow({mode:open}). 3. You can attach the Shadow to the custom element . 4. Offers encapsulation (CSS in outer DOM cannot bleed into the shadow DOM)
  • 14. Demo
  • 15. Lightning Web Components (LWC) ➢ Lightning Components used aura framework and its renamed as Aura Components . ➢ Components built using Web Components standard now are referred as lightning web components ➢ Lightning Web Components(LWC) adheres closely to the web components standards. ➢ Modules for Data services , UI API and provides reactive properties
  • 16. Difference between Web Components and LWC 1. Has polyfills to support IE11 2. No need to use the attachShadow() or appendChild() methods . Also supports browsers that does not implement shadow DOM 3. Protected by locker services that adds additional security 4. Supports app builder ,community builder. 5. Special renderedCallback() method to perform logic after component has rendered . 6. For better performance there are some rules and restrictions .Refer the git repo here (https://github.com/salesforce/eslint-plugin-lwc)
  • 17. Tooling Support For LWC 1. Salesforce VSCode Extension pack helps scaffolding and language grammar + Deployment 2. Personally built an extension to support faster deploy and better error display.Its a VScode Plugin and can be downloaded from marketplace
  • 18. Demo
  • 19. Compare LWC with Aura Components Aura Components Lightning Web Components <aura:attribute name=”myproperty”> @api myproperty {!v.myattribute} {myattribute} no more <aura:handler> and <aura:register> const customEvt = new CustomEvent(); this.dispatchEvent(customEvt); .THIS .myclass {} .myclass {} aura:facet slot lightning:layoutitem lightning-layout-item
  • 20. Javascript Properties 1. Reactive Property - Change in property value automatically reRenders the template 2. To create a public property use @api 3. To create a private property and re Render DOM use @track
  • 21. Lightning Data Service 1. Mark the property with @wire if you want the property to recieve the change when data change happens to record 2. LWC supports UI APIs and Metadata describes
  • 22. References 1. Googles Dev blog 2. LWC Recipes 3. Salesforce Dev blog 4. Salesforce Official docs Upcoming Salesforce Webinar https://www.salesforce.com/form/event/lightning-web- components-launch-event
  • 23. Demo Resources 1. slider web component demo 2. salesforce lwc demo
  • 24. Q & A