What is LWC?
- LWC stands for Lightning Web Component.
- It is the new programming model on which we can build Lightning Components.
- It uses the latest web standards.
- It can also communicate with the existing aura components and deliver unparallel fast performance.
What is Aura?
- Aura is the existing programming model on which we can also build components.
- It uses old web standards.
- It will be obsolete by Salesforce in the upcoming years.
- It is not future-proof and slower in comparison to LWC.
Don't forget to check out: Create and Insert Record in LWC Without Using record-edit-form | Salesforce Developer Guide
Why Does Salesforce Come with LWC when Aura is Already There?
- In 2014, lightning component framework was launched by Salesforce along with Aura Programming Model.
- Actually, Aura is very different from other frameworks as most of the part is Salesforce-specific.
- It is very hard for a developer working on other technology to switch to Salesforce platform development and vice versa.
- When Salesforce comes with the LWC, it uses less framework and more general language models.
- LWC is an important step for Salesforce to make it easier and more accessible to other developers.
- Aura is also a type of isolation in terms of communication in between different frameworks.
- At that time when LWC was introduced, it fulfils the need for standardization of the web.
Advantages for Developers: LWC
- Learn the standard once, and use it everywhere.
- Aura contains multiple JS and HTML files and it's hard to handle them all while in LWC there is a single file for JS, CSS and HTML for each component.
- No more work on the developer console. You can now work on VS code for Salesforce development which also gives you access to a lot of helpful extensions.
- Non-Salesforce developers can also easily build components.
- Faster Development.
- Better Performance.
- Can communicate with existing aura components.
- More developers and the community can help Salesforce developers since Salesforce development is now nearer to another framework.
Check out an amazing Salesforce video tutorial here: What is Lightning Web Components (LWC) in Salesforce?
Web Stack 2014 vs Web Stack 2019
- Using web stack 2014 was more framework specific as many of the things are dependent on the framework feels like the framework itself is a whole different language.
- It makes components run faster and easy for developers to develop in the LWC framework even if they don’t know much about it.
- The Aura programming model follows the web stack 2014 while LWC follows the web stack 2019.
Aura and LWC Can Co-exist
- The good thing about LWC is that it can also use your older Aura component, you don’t have to worry about converting all of them into LWC.
- They share the same Lightning Data Service, User interface and API service.