Lightning Web Components

2018 ended with an announcement of a highly significant change for Lightning developers, i.e. – Lightning Web Components:

Although this change is extensive, users will not actually notice it (but they may realize performance has improved). However, this change is important from the development side.

With this change, Lightning Components is now divided into two models:

  • Aura Components: Aura is the open source framework used to create the interface so far, and it was available to develop customized components. It was built without resorting to the most modern web standards and had some design issues. Therefore, its performance is not as good as it could be, and the learning curve is steep.

  • Lightning Web Components (LWC): is a programming model taking advantage of all functionalities supporting the most modern browsers, including Web Components, Templates or Shadow DOM, which are basically web standards defining methods to handle and define the DOM solely with HTML and JavaScript. This greatly enhances performance and, additionally, it feels much simpler.

What are the benefits of this change?

One of the main benefits of Lightning Web Components (LWC), aside from performance and ease of use, is that because it is more standardized, any Front-end developer arriving from another technology (React, Angular etc.) will soon be able to exploit its advantages. Moreover, they can reuse the skill set learned as a LWC programmer for general front-end development. Any programmers who did not want to learn Aura because it was too specific no longer have an excuse 😉

Additionally, Lightning Web Components fully supports ES6, and some parts of ES7 and ES8 – the ultimate versions of JavaScript, and this is super cool!

If, for any reason, your browser does not support these JavaScript versions, Salesforce transforms the code into a compatible version, and you need not concern yourself about it.

Meanwhile, Salesforce published a series of extensions for VSCode. Together with SFDX, this involves a dramatic increase in developer productivity when working with LWC, as the available functions include, among others, auto-complete, syntax highlighting, and linting for JavaScript.

Almost everything that you can do with Aura can be developed in Web Components*, and it is easier. This means that in the long-term Aura will not evolve (although it will also not be withdrawn) and the trend is using LWC. It seems that they have finally got it right, as this is an extensively tested pilot program published directly as GA (Generally Available).

Additionally, Salesforce migrated all its components to Lightning Web Components, and this means that Lightning Experience (Lightning’s UI) should improve performance in forthcoming releases.

Have you already developed Aura components? No sweat. From now on, you have two options. Either you let them co-exist with the new LWCs you develop or they can cohabit on the same page and communicate with each other, or you can migrate them. The documentation has a guide on how to do this, and it is a walk in the park.

We will continue to monitor any news to keep you updated. Meanwhile, if you want to start testing, you can get your first badge on Trailhead (Quick Start: Lightning Web Components).

* Some functionalities which are not yet available for LWC are currently being developed. Salesforce says they will be published with forthcoming releases. These are mostly containers where LWC cannot be included yet, like Visualforce/Lightning Out, Lightning Flows, Lightning for Gmail/Outlook, Lightning Tabs and Action overrides. There is, however, a workaround. LWC can be included in an Aura component, which is supported in all these containers.


Leave a Reply

Your email address will not be published. Required fields are marked *

You might also like...

Subscribe to our blog