Chapter 1: Introduction to Salesforce Lightning Web Component

This article is intended for giving Introduction to Salesforce Lightning Web Component. Salesforce Lightning Web Component is a new programming model to develop  lightning components. It’s a UI framework that is built using native HTML and modern JavaScript. It uses core web component standards and leverages custom elements, templates, decorators, modules, shadow DOM, and other new language constructs available in ECMAScript 7 and beyond

Aura components – which are also known as lightning components.

Lightning Web Components– the newest and advanced way to create lightning components.

Key concepts of Web components

lwc components

                                              Web Component Model

 

1) Custom Elements

  • It defines an element’s behavior
  • It reacts to attribute changes
  • Augment existing elements

2) Shadow DOM

  • It keeps implementation logic inside
  • It avoids styles leaking out
  • Naming becomes simpler

3) ES Modules

  • Add modules wherever it’s needed
  • No build step requirement
  • Keep everything in one place

4) HTML Templates

  • Create ready-made structures
  • Contains HTML, CSS and JS
  • Highly reusable

 

Why LWC over Aura?

LWC comes with many different advantages over aura components as follows:

  1. Better performance
  2. Modern web standards
  3. Compatible with Aura components
  4. Faster loading sites
  5. Better security, better testing, and better browser compatibility
  6. Ease of development

 

Coexistence And Interoperability

Aura components and Lightning web components can coexist and interoperate, and they share the same high-level services:

  • Aura components and Lightning web components can coexist on the same page
  • Aura components can include Lightning web components
  • Aura components and Lightning web components share the same base Lightning components. Base Lightning components were already implemented as Lightning web components.
  • Aura components and Lightning web components share the same underlying services (Lightning Data Service, User Interface API, etc.).

 

Reference : Salesforce.com

Read more: Install Developer Tools for LWC development

 

Leave a Comment