Lightning web components: A great move forward

We are beginning to put Aura-based Lightning Components, the existing Salesforce Lightning custom-development technology, behind us. While Aura has its advantages, the global marketplace voted to proceed in a different direction.

But there’s good news: Lightning is enhanced by something even better. And not only is the World Wide Web is lining up behind the new direction1, it is both a Salesforce supported solution and open source2 to further align the Salesforce platform to modern web development.

We’re talking about Lightning Web Components (LWCs) for custom development on the Salesforce Lightning platform which offers multiple advantages. For IT, LWCs facilitate easier staffing, make developer training more efficient and improve developer productivity. For end users it delivers yet another enhancement in user-centric design: LWCs run fast and look great.

You’ll need to expand training

The most significant short-term impact of LWCs is on developer staffing and training. Now you’ll need two different training initiatives addressing two separate programmer constituencies.

Web developers new to Salesforce may have learned about LWCs, and the standard JavaScript used to program them, in school and may have used them elsewhere. Salesforce bases LWCs on Web Components specified by the World Wide Web Consortium—the same international standards organization that decides how web browsers behave—so use of this technology is broader than Salesforce. LWCs also use the current versions of the standards-based ECMA JavaScript programming language used elsewhere. Instead of learning about LWCs, programmers new to Salesforce need to learn how LWCs connect to the Salesforce platform and when to use Apex, another Salesforce programming language, instead of JavaScript.

Salesforce developers, unlike people who are new to Salesforce, already know how to connect components to Salesforce and they already know Apex. We need to train those developers on the specifics of LWCs instead. There is not a massive difference between programming Aura Components and new LWCs conceptually, but there is enough difference to want to upskill existing Salesforce developers on LWC best practices.

Other impacts: testing and development operations

Aura Components introduced the Lightning Testing Service leveraging the Mocha and Jasmine JavaScript testing frameworks to Salesforce. Lightning Web Components add Jest: Delightful JavaScript Testing. While unit testing is not required for LWCs the way it is for Apex, robust unit testing of LWCs using Jest is a best practice which we should incorporate into Salesforce development going forward.

Fortunately, Salesforce is offering a strong DevOps toolset for LWCs to support development —but there are new technologies there too. LWCs align to Salesforce Developer Experience (SFDX) and presume the use of code repositories and the SFDX CLI in place of historical Change Sets. At the same time, the Eclipse Integrated Software Environment is being retired for Salesforce in favor of the no-cost Visual Studio Code. And Salesforce has already yet other LWC development toolings available, such as shared playgrounds which allow for rapid prototyping, sharing, and collaboration.

Support also has a to-do

Existing LCs and the newer LWCs run side-by-side in the same Lightning applications, so there is no rush to re-write Aura-based Lightning Components as LWCs. Over time, it will make increasingly less sense to maintain training and support capability for both Aura Components and LWCs. We would look to retire any remaining Aura Components at that time.

To get started …

We recommend developers look at Salesforce’s LWC Recipes to get started. Our programmers who reviewed them before developing LWCs got off to a better start than those that did not. The very first LWC we put in production at a client site needed a third-party JavaScript library for advanced graphics functionality, and it just so happens that Salesforce uses that same library in one of the Recipes. Even our first commissioned LWC met its deliverability objectives on-time/on-budget without a hitch as a result.

Webuildsf has a long list of Salesforce things to keep up with, so we were initially not too keen on adding LWCs to our to-do list right now. But LWCs are better than Aura Components due to the broader support of the underlying framework and Salesforce’s clever adaptations for its platform, so we are enthusiastically making the switch to LWCs as quickly as possible. Once you wade in, we are confident that you’ll feel the same. And with the upcoming LWC support for Lightning Out, stand-alone Lightning Apps, and email client containers, now is the time to explore net new architectural options for LWC-based Salesforce solutions.

Salesforce and Salesforce Platform are trademarks of Salesforce, Inc. and used here with permission.


WebuildSF is a small group of salesforce professional, but we experienced in building large scale applications for Fortune 500 clients as well as SMEs across Australia and United States.

No Comments Yet.

Leave a comment