What is LWR, for real?

Here is brief overview on LWR

Today, I had the opportunity to delve deeper into LWR, conducting some swift experiments that yielded valuable insights worth sharing. This topic is of more significance to Salesforce Architects, Devs and Consultants, as the topic goes beyond scope of LWC. Let’s dive right in.

Lightning Web Runtime (LWR), is a Node.js based solution that empowers developers to construct Static or Single Page Web Applications. Beneath its surface, LWR seamlessly integrates with Lightning Locker Service, Lightning Data Service. It works as a platform to develop LWC or Web Component based site. LWR-powered sites can find a home on platforms like Heroku or reside on your enterprise servers, such as Amazon EC2. What’s more, several Digital Experience Templates within Experience Cloud harness the power of LWR. But why? It’s promise of enhanced performance, scalability, and control – all wrapped in a package that simplifies optimisation efforts. After all, continuous optimisation is the path to progress!

Can I build my experience sites using LWR, will I need Node.js developers for this? Not Exactly.

Just like transition of Visualforce sites to Lightning, it’s a similar shift in some Digital Experience templates towards LWR. This transition means that under the hood, these templates leverage the power of LWR. The best part? You can continue using the Experience Site builder in the same familiar way with these templates. You have your freedom to use existing components or create your own LWC to craft effective digital experiences for everyone.

But wait, then what is “Build your own LWR” digital experience template available in Salesforce?

Great question. This template is unique in its own, as it’s based on LWR technology plus it doesn’t come pre-loaded with any ready-made pages and components tailored for specific experiences like Sales or E-Commerce.

So when should you consider using it? Allow me to clarify. Imagine you have meticulously crafted branded design mockups using tools like Adobe or Figma. These mockups are pixel-perfect, & maybe follow a complete different design system other than Salesforce Lightning Design System. Using this template gives you a level of control over that part of user experience of your site. You are not overriding SLDS here. During my initial trial, I even managed to inject the Bootstrap Design System. Design is just one aspect. This template also includes generic helper components to support your development, alongside some Salesforce feature-specific Lightning Web Components (LWC). Salesforce might introduce more of these components in the future. (just an observation, so please don’t base any purchase decisions solely on this)

What is that Node.js part you said and all those AWS server things?

Hey hey, your questions are really on point today! So, here’s the scoop: the LWR Node.js package is now available for preview via npm (Node Package Manager). Imagine you’re building a Single Page Application that needs to interact with third-party services. Or your own on-premise services and databases, and which are all quite complex. You want maximum control over the application for various technical or non-technical reasons. Well, this might just be the path forward (fingers crossed, it’s still in developer preview). It’s pretty new addition, so the documentation primarily focuses on examples of Static Sites and Single Page Applications. I gave it a whirl myself. I noticed that the URL routing (mapping) & file structure might not be as scalable for complex web apps at moment.

Shubham, is there any use-case of LWR Node that comes into your mind?

Let’s take an example use case. You already have multiple Enterprise Applications and Micro-Services that together via an integration function as a SAAS extension for your core business operations. Take, for instance, an insurance company aiming to process new applications within a 30-minute window, leveraging their proprietary image recognition, AI, and extensive third-party integrations. With substantial traffic and a dedicated team continuously monitoring operations, their goal is to continually enhance the user experience and fine-tune the infrastructure to push the boundaries in their business domain. The onboarding process which is client front facing will be a single page application which also talks to your Salesforce instance along with other things. This can be one example to explore LWR (keep in mind it’s still in developer preview).


Leave a Reply

Your email address will not be published. Required fields are marked *