Skip to content
Experiments with Aura and LWC Lightning components
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
config
experiments
force-app/main/default/lwc
otherjs
.eslintrc.json
.forceignore
.gitignore
.prettierignore
.prettierrc
README.md
package-lock.json
package.json
sfdx-project.json

README.md

LWC - Aura experiments

Experiment 1

Compare the modal dialog between Aura and LWC. 2 buttons launch idendical components one Aura, one LWC. The components use the same backend APEX class. Fetches the record type for a given object and a random number of colors.

Syntax for AURA component:

<aura:handler name="RecordTypeSelected" event="c:RecordTypeSelected" action="{!c.getRecType}"/>
<c:SampleDialogAura objectName="Opportunity"  heading="Aura: Pick an Opportunity and Color" />

Syntax for LWC component:

<c:sampleDialogLwc objectName="Opportunity" heading="LWC: Pick an Opportunity and Color" onselectionmade="{!c.lwcselection}" />

Components

  • SampleDialogController.cls
  • SampleDialogControllerTest.cls
  • aura/RecordTypeSelected
  • aura/SampleDialogAura
  • aura/DemoLWCAuraContainer
  • lwc/sampleDialogLwc

Setup

  • Opportunity object needs to have a record type (or change the call to fetch another object)
  • Create a lightning page and add DemoLWCAuraContainer to it - or add that to any lightning page
  • Deploy with sfdx force:source:deploy -p experiments/experiment1
You can’t perform that action at this time.