TransWikia.com

Is it possible to export a Salesforce-hosted Lightning Web Component for consumption as a Micro Frontend?

Salesforce Asked by Brian Kessler on October 4, 2021

A colleague was giving a very exciting presentation on Micro Frontends today.
He explained that if you can import the web-components into your JavaScript, you could compose your UI using components from any number of sources.

As we know by now, Lightning Web Components really are mostly using standard web technologies and you don’t even need Salesforce to host a solution built with it.

Well, if LWC are really standard web components, then in follows I should be able to consume them on a website which is hosted elsewhere.

But then the question becomes, whether and how it is actually possible to expose the webcomponent which is hosted in Salesforce, which may be wired into AuraEnabled classes? Can it be done securely?

If it is not possible now, is this on the roadmap?

One Answer

It is not possible the way you're describing it (IE accessing the LWC "Hosted on Salesforce", accessing Apex methods directly via @AuraEnabled annotation)

You could expose a Salesforce Community site on the public internet but the only elements would be Embedded Services with CORS-enabled (this is what comes to mind- there may be others, I was just working on this yesterday with the FSL Scheduler and "embedding it" in a 3rd-party "Site", or Chat/Chat-bots, though most documentation targets placing them in different types of Salesforce Communities, and doesn't adequately demonstrate using them on 3rd party sites IMOP)

Your correct LWC is based on web-standards (IE Web Components) but this is just for client-side (read: browser) of a JavaScript/HTML/CSS, the "hosting" aspect still needs to happen in some sort of HTTP web-server to return said-components to the browser.

Answered by jordan.baucke on October 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP