Salesforce have announced the biggest change to Lightning since… well, Lightning!
Lightning Web Components are the future of front-end development on Salesforce. We've been on the pilot and wanted to share some of our thoughts. Spoiler alert: we like it a lot!
Why the change?
How do Lightning Web Components differ from Aura-based Lightning Components? Firstly - the component bundle is a lot more straightforward, and much more in line with standard web technologies.
A html template used in a Lightning Web Component. A lot less XML!
What will the benefits be?
As hinted above, the main driver for the new framework is to take Lightning to the next level of performance. The framework has been built to leverage features found in modern browsers that will be key to future performance enhancements in Lightning.
Unlike traditional Aura-based components, the new "LWC" model is in line with web components found elsewhere. This means Lightning Web Components should be much more familiar for those who do not currently develop on the platform, and the skills more commonly found - whereas the existing Aura model is not always well-known outside of the Salesforce ecosystem.
This is the E-Bikes sample application, available in the Samples Gallery. We'd highly recommend playing with it for a demonstration of what LWC can do!
It'll help to open up developer tooling. For example, useful IDE plugins thrown off by the syntax, styles and conventions of Aura-based components will now be usable in Salesforce front-end development.
The team behind LWC have also revisited some of the fundamentals of the Aura-model, to rework the way developers accomplish their goals, and encourage best practices. This may just appear as changes to syntax; however, the changes in the model will help eliminate entire classes of bugs, make framework behaviour more predictable, and make developer intent clearer.
There are many other benefits, but you'll be hearing more about those over the coming weeks and months!
Now, you may be thinking: "What about all the time I spent with Lightning Components?!" Fret not - the Aura-based model will still be available for you to use, so you can continue developing with what you already know to give you time to transition. Existing Aura-based components and Lightning Web Components will work side-by-side so there will be plenty of opportunity to explore the new model without having to rebuild everything you've worked on in the last few years.
What about the risk of introducing a new UI model in this way? Actually - Lightning Web Components have already been in use for some time. Lightning Base Components are built on the LWC model, so though the new model is only becoming GA in Spring 19, the underlying technology has already been put through its paces.
What should I do next?
Firstly - plan how you'll get access to a Spring '19 org, either via pre-release sign up or by planning your sandbox refreshes to make sure you get an org. Once you have access - get reading the development material Salesforce will be making available, and get coding.
Whilst that org is provisioned, have a look at the official announcement which goes into more detail about changes in the technology that are driving this change.
When can we expect Trailhead content? Already available! the Lightning Web Components Quick Start will have you up and running with your first component in no time.
Salesforce have been working on new sample apps to demonstrate LWC - they've also rebuilt the existing apps you already know using LWC, so you can compare the Aura-model with the new. Head to the Sample Gallery to have a look.
Planning for the Future
You can then explore opportunities where to start using LWC in your applications. You don't need to go big bang and re-write entire applications - there may be small components you can incorporate in a single area of your application, then as you and your team learn, look for opportunities to refactor other components to LWC.
We'll be sharing more about our experience with LWC in the coming weeks and months. It's an exciting time to be a Salesforce developer, so we look forward to sharing our stories!