I wanted to learn more. About a year ago, I noticed a series of Chatter posts from our Sr. UX Designer regarding Salesforce’s launch of Lightning Web Components (LWC), a programming model built on modern web standards for creating custom components on the Lightning Platform. I decided to explore this new alternative to Aura (the previous model built by Salesforce).
In order to develop the most progressive solutions possible for our customers, our development team works with the latest features and tools that Salesforce is rolling out. I started my adventure by attending the Lightning Web Components Global Broadcast webinar. Aura is no longer open source (LWC is) , and it’s likely that any new functionality Salesforce rolls out will be available in LWC as opposed to Aura. So, I decided to start building with Lightning Web Components.
As we gradually say goodbye to building with Aura Components, Aura has not been able to leverage recent advances in modern web technologies. Built from the ground up, LWC takes advantage of modern standards that are natively available in today’s web browsers such as Web Components, Custom Events, ECMAScript classes, and more.
Consequently, more of the core tasks involved in managing component execution are now handled natively by the web browser which results in a snappier user experience.
While I will admit there were points of frustration at first (as to be expected with using any new tool or system), I personally have grown to enjoy using LWC. My advice to anyone getting started is to take some time to really dig in and understand it. Below are some tips that cover some of the capabilities and limitations we’ve discovered while using LWC, as well as a few best practices and resources we’ve leveraged along the way.
Although LWC is the way forward for new development, there are a few places they are not supported yet, such as Salesforce Console APIs (Navigation Item, Workspace, Utility bar) as well as URL addressable tabs. Others are outlined in supported experiences.
The good news is that we can work around these limitations by nesting the LWC inside of an Aura component, then handle communication between the parent Aura component and child LWC by firing off an event to the parent Aura component, and set an attribute or call a method exposed by the child LWC from Aura. Note that although one can nest an LWC inside of an Aura component it is not possible the other way around.
Learn about how IC’s DevOps process is improving every day with the help of SalesforceDX . Also, we’re hiring! If you are a Salesforce technical professional looking for your next opportunity, take the first step and check out our openings!