Lightning Web Components

The What, Why, and Hows of Lightning Web Components.

What are Lightning Web Components?

Salesforce introduced Lightning Web Components (LWC) in it’s latest Spring 19 release.  Lightning web components are custom HTML elements built using HTML and modern JavaScript.  It is based on Web Standard. It leverages custom elements, templates, shadow DOM, decorators, modules, and other new language constructs available in ECMAScript 7 and beyond.

Benefits of Lightning Web Components?

It is built on code that runs natively in browsers and hence Lightning web components are lightweight and delivers exceptional performance.  A huge benefit of the Lightning Web Components programming model is that you write standard JavaScript code.

Lightning Web Components uses core Web Components standards and provides only what’s necessary to perform well in browsers supported by Salesforce.  Combining the Web Components programming model with the Salesforce metadata and services unleashes an unprecedented level of productivity.

What happened to the Lightning Components?

The original Lightning components are now referred to as “Aura Components”. To admins and end users, they both appear as Lightning components.  You can still continue to build or use existing Aura components on any page in Lightning Experience. Lightning web components and Aura components can coexist and interoperate on a page.

How to build Lightning components now?

For Lightning web components, most of the code you write is standard JavaScript and HTML.  You would be using JavaScript code but there are Javascript functions that are unique to this LWC programming model.  Your page would now be an .html file, .js file and an .xml file. 

With the addition of Lightning Web Components, there are now two ways to build Lightning components:

  • Aura Components, leveraging its own component model, templates, and modular development programming model.
  • Lightning Web Components, built on top of the web standards breakthroughs of the last five years: web components, custom elements, etc.

You can consider migrating your Aura Components to Lightning Web Components, starting with the components that would benefit the most from the performance benefits of Lightning Web Components.

Summary

LWC is using a cutting-edge programming model that is built for the 2019 web stack from the ground up and that interoperates seamlessly with your existing code. With the combination of Lightning Web Components and Salesforce metadata, you get an unparalleled level of productivity and performance.

Advertisements

One Reply to “Lightning Web Components”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s