"All those standard components you've used, like lightning:button, are actually LWC components..." (sfdcfox, 2018) "Aura is using LWC components in most of the base components behind the scenes" (salesforce-sas, 2019). Remain these Aura-LWC completely different, do they share code or are they sometimes largely the same as the respective standard LWC's?
And can I see this within Chrome? E.g. if the lightning-button
I use (not just according to Github) is under the hood somewhat the same as the lightning:button
?
Apparently it is possible to see the code of the Aura component with Salesforce's Lightning Inspector. But when I set up a trivial Lightning app, embedded an Aura component in it (with a lightning:button
) and embedded a LWC in the Aura (incl. lightning-button
), I didn't learn much from it:
I assume I'm supposed to look at the "Component Tree". On the left I see the lightning:button positioned in the Lightning app, but no Javascript. In the sidebar on the right I see two sections of "Attributes" (both referring to the Aura button), no Javascript. There's no shortcut to get to the source in Chrome's "Elements" or "Source" tab. Unfortunately, the "Component Tree" renders my LWC as a single <c:foo>
. (Did I read somewhere Lighting Inspector only supports Aura?) Clicking on the <button...>
element of the Aura in Chrome's "Elements" view, I can see Attributes and some other information in the "Lightning" sidebar. For the <button...>
element of LWC the sidebar remains blank. Am I missing something?
In DevTool's "Sources" view
apparently the Aura button Javascript is under
/top/[scratch org]/components/lightning/button.js
, LWC under
/top/[scratch org]/components/interop/button.js
Not unexpectedly the two files look different. E.g. Aura's button.js has the typical controller/helper structure.
How can I see Aura's LWC action? Has this changed? Can I even see Aura and LWC sharing the same component code sometimes?