What are Salesforce Lightning web components?
Lightning web component is a modern lightweight open source framework for building large scale applications. Salesforce lightning web components were mainly leveraged on recent web standards. By using Salesforce LWC developers can build Modern Rich UI implementations with the help of thin layer specialized services.
Thin layer specialized services helps developers to develop large scale modular apps easily with better performance.
With this open-source framework, one can develop applications on any platform not only in Salesforce. Before LWC Salesforce we have used different frameworks to build applications and also to host the application.
For example we have used Aura to build developer side applications and different Scripting like React js or Angular or Vue js to build client side applications.
Salesforce developers can build apps by using two programming models. The two programming models are:
- Lightning Web Components (LWC)
Aura supports more capabilities whereas LWC is a faster and efficient model in Salesforce.
Mainly LWC Salesforce leverages on Lightning data services, base lightning components, Web components, templates, custom elements, Shadow DOM, Modules, Standard events and ECMAScript 7, standard elements and rendering.
Choosing Lightning Web Components or Aura:
When compared with aura developers can develop apps easily by using Lightning Web Components. But developers can’t fully depend on LWC due to some unsupported features or tools. So developers have to rely on Aura Components also.
With this one can get some confusion whether to use LWC Salesforce or Aura Components when developing apps.
To use an unsupported feature or tool or any unsupported Interface then develop it with the help of Salesforce LWC and then wrap it into Aura Component that can access Interface or feature.
Supported Features of Lightning web components salesforce:
The supported Lightning Web Components of Salesforce tools are:
- Lightning experience
- Salesforce App
- Lightning Communities
- Lightning App builder
- Experience builder
- Standalone apps
- Lightning Components for Visualforce
- Lightning out
- Custom tabs
- Utility bars
- First-generation and Second generation managed packages
- Unlocked and Unmanaged packages
- Metadata API Lightning Component Bundle
- Tooling API Lightning component bundle, Lightning Component resource
- EMP API
- Embedded Service Chat
- Gmail and Outlook Integration
Unsupported features of Salesforce LWC:
Lightning Web Components does not support some of the Salesforce tools. So, in order to use these LWC Salesforce tools developers have to wrap the component into an aura component.
The tools that are not supported by LWC Salesforce are:
- APIs like Salesforce Console, Navigation Item, Workspace, Utility Bar, Conversation Toolkit, Mni Toolkit, Quick action.
- Actions like Custom actions, Global and List view and related list view.
- URL Addressable Tab
- Chatter extensions
Pros of LWC salesforce:
- Better performance: The reason behind the better performance is the absence of abstraction layers. With this reason LWC renders faster than Aura Components.
- Easy to use
- Easy to learn
- Faster loading
- Better security
- Lightning Web Components supports two way data binding
- Non-salesforce developers are also able to code in Salesforce LWC who are having Advanced Java Scripting skills.
Both Aura and Lightning Web Components can communicate easily by using Public APIs and events.
LWC Salesforce can be embedded inside Aura whereas aura can’t embedded inside Salesforce LWC.