Through concrete examples, we explore the recently released Salesforce Lightning Components.
This article starts with assumption that the reader is both interested and has a rudimentary understanding of Salesforce development.
In addition, this article specifically builds upon the Salesforce Trailhead project Quick Start: Lightning Web Components. It is assumed that the reader has completed this project.
So Where Are The Web Components?
The Lightning Web Components literature indicates that it is built upon Web Components:
— Salesforce — Introducing Lightning Web Components
- While not shown in this simplified Web Component example, Web Components have a HTML Template specification much like the Lightning Web Component (HTML)
Let us compare Web Components and Lightning Web Components as they are used. First we use the Web Component:
And inspect it; observe the custom HTML tag, hello-world.
Next we use the Lightning Web Component:
and inspect it; observe the custom HTML tag c-hello-world:
- As we can see, both examples are web components; as per the custom HTML tags
- In looking at the lwc source, we can see that LightningElement extends HTMLElement
In the next article, Exploring Salesforce Lightning Web Components: Part 2, we explore how and why Lightning Web Components are compartmentalized.