What is Lightning Web Component
Lightning Web Components is a new programming model for building Lightning components. It leverages the web standards breakthroughs of the last five years, can coexist and interoperate with the original Aura programming model, and delivers unparalleled performance.
Now you can build Lightning components using two programming models: Lightning Web Components, and the original model, Aura Components. Lightning web components are custom HTML elements built using HTML and modern JavaScript. Lightning web components and Aura components can coexist and interoperate on a page. To admins and end users, they both appear as Lightning components.
Advantages of using LWC
Why Lightning Web Component(LWC)
When Salesforce introduced LWC as a Developer my first question was why use LWC when we are already having the AURA component framework.
8 years back, in 2014, Lightning Components Launched. At that time Web Standards had limited functionality and various framework came to fulfill the gaps like ReactJs for virtual DOM, commonJS, etc. Aura framework was part of that initiative where they pushed web standards to build enterprise applications.
Fast forward a few years later. Web standard has a rich set of functionalities, supported by Native Browsers. In other words, the Lightning Web Components framework brings the power and benefits of Web Components while being built on modern web standards. Lighting Web Components are comprised of 3 key pieces:
- Base Lighting Components – a set of 80+ UI components built as custom elements
- The Lightning Data Service – provides declarative access to Salesforce data and metadata, data caching, and data synchronization
- The User Interface API – the underlying service that makes Base Lighting Components and the Lightning Data Service metadata-aware
Web stack transformation 2014-2019
Image from Salesforce Document.
What is going to happen with Aura now?
Well, now you know the power of LWC, now you must be wondering what is going to happen with AURA components ? Are we going to skip them ? The answer isNO!
Aura vs LWC
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.)
How to start the LWC Journey?
Here are some recommended steps that might help in your LWC development journey!
- Install VS Code and set it up for Salesforce Development. You can follow Set up VS Code trailhead module for that.
- Start with JavaScript Basics.
- Follow SLDS.
- Check the component library before starting the build.
- Complete the LWC trail mix on the trailhead.
0 Comments