1

Should a newbie use Lightning Web Components for all new components, or are there any cases where we would use Aura or Lightning Components?

I'm new to Salesforce coding and I'm wondering about what framework I should prioritize.

Also one more question - is the Lightning Design System usable in all frameworks (Aura, Lightning, Lightning Web)?

2
  • 2
    lwc and aura have different programming models, however, they are both Javascript. You should prioritize LWC, however, it is likely you will end up maintaining Aura components as well.
    – glls
    Feb 5 at 22:00
  • 2
    LWC is a replacement for Aura that is based on Web standards (Web components), unlike Aura which is framework-based. LWC is far easier to understand and develop with and is way more performant. Avoid Aura if at all possible (there are still some things only Aura supports though).
    – Phil W
    Feb 5 at 22:43

1 Answer 1

5

It might be helpful to clarify some terms, as it isn't always clear just from undirected reading of the documentation

Lightning Components is a broad the used to define the components that make up the "Lightning" UX that Salesforce introduced as the replacement for what is now known as the Classic UX

The Aura framework was the original framework that Salesforce built to deliver these Lightning Components when the Lightning UX was introduced. Aura was always the name of this underlying framework, but at the time, the components built using this framework were referred to as Lightning Components

This framework served it's purpose: to move to a JavaScript-based model in a way that allowed for more declarative customizations on top of custom development while encapsulating this work into reusable pieces.

Fast-forward a few years, and Salesforce made the decision to adopt a less heavy, standards-based approach to building Lightning Components, and introduced Lightning Web Components, based on the Web Component standard.

Colloquially, both of these are considered Lightning Components, but to help reduce confusion, aura-based components are now referred to as Aura Components, and LWCs as Lightning Web Components.

The transition to LWC is still underway, and the Lightning UI still relies on the Aura framework. You'll find there are many functions that Aura Components can do that LWC can't. And each release you'll find more and more enhancements to LWC.

LWC is easier, faster, and much closer to what you'd expect for modern JavaScript web development. The future of Salesforce is decidedly in the LWC camp, but the Aura framework, and existing aura components, will be around and coexisting for quite some time.

It is my opinion that you should focus and default to LWC, but that you should complement your study with learning at least the basics of Aura and the ways that Aura can and can't coexist with LWC, for both supporting existing work, and because you will find scenarios where you'll need to use Aura as a wrapper in order to deliver your work.

Edit: to answer your last question, yes the Lightning Design System is supported in both Aura and LWC (although styling hooks are exclusive to LWC)

Not the answer you're looking for? Browse other questions tagged or ask your own question.