Back to Blog

Lightning Web Components

Lightning Web Components is salesforce’s latest programming model for building Lightning components. Leveraging the web standards breakthroughs of the last five years, it can coexist and interoperate with the original Aura programming model, delivering unparalleled performance.
  1. Salesforce new baby - LWC (Lightning Web Components)
  2. LWC is based on web components

    Which is a set of web platform APIs that allows you to create new custom,reusable HTML tags that will work across all modern browsers . You can read more here.

  3. Advantages of LWC

    • Works on Modern Javascript LWC works on latest versions of javascript. ES6, ES7 ,ES8 and ES9. You can find some good tutorials here.

    • Better Execution LWC leverage the Web Components standards. That means they run faster and more consistently

    • Components without UI You can write lightning webcomponent that doesn't have its own UI and can work as a service for other component and can have reusable functions/methods. You don’t need to upload them in static resources which makes it more efficient.

    • More Secure As Web Components have concept of Shadow DOM, it makes them more secure. You can find some good tutorials about the shadow DOM here.

    • Easy to learn You don’t need much salesforce knowledge to work on Lightning Web Components. If you are familiar with Web Standards, you can easily create your own components.

    • Less Buggy And of course, LWC is not buggy as Lightning Aura Components.

    • Extensible Any JS library built on web standards can be easily integrated with LWC.

    • Better tools You can now use most standard web development tools such as webpack, git etc for developing LWC components.

    • Better support for legacy browsers LWC automatically provides polyfills for older browsers.

  4. Lightning Web ComponentsLightning Aura Components
    Based on Web Components StandardsBased on Aura Framework
    Does Not Support two-way bindingSupports two-way binding which is way too buggy
    Support Mixins - can import methods from multiple apex classes or from other componentsDoes Not Support Mixins - You can use only one apex class or can inherit only from one base component
    Faster than AuraSlower than Web components