- Create project
- Update .gitignore
- Create git and add project
- Request Trial Dev Hub
- Authorize DevHub
- sfdx force:auth:web:login -d -a dhTDX19_A2W
- Update config/project-scratch-def.json
- "s1EncryptedStoragePref2": false
- Create a scratch Org
- sfdx force:org:create -f config/project-scratch-def.json -a soTDX19_A2W -s
- Create Aura Component
- sfdx force:lightning:component:create --componentname AuraHello --outputdir force-app/main/default/aura
- Copy code from slides
- Markup
- Controller
- Push Aura component to Org
- sfdx force:source:push --json --loglevel fatal
- Open Scratch Org
- sfdx force:org:open
- In Browser...
- App launcher > Service
- Home Tab
- Setup > Edit Tab
- Drag component to page
- Save
- Activate
- Assign as Org default
- Save
- Back
- Pull Changes
- sfdx force:source:pull
- Git it!
- Create Lightning web component
- sfdx force:lightning:component:create --type lwc --componentname lwcHello --outputdir force-app/main/default/lwc
- Start changing the code...
<aura:component implements="flexipage:availableForAllPageTypes" access="global">...</aura:component>
lwcHello.html
<template>
</template>
lwcHello.js-meta.xml
<isExposed>true</isExposed>
<targets>
<target>lightning__HomePage</target>
</targets>
- Push LWC component to Org
- sfdx force:source:push --json --loglevel fatal
- Update page
- Setup > Edit Tab
- Drag component to page
- Save
- Save
- Back
lwcHello.js
import { LightningElement, track } from "lwc";
export default class LwcHello extends LightningElement {
@track greeting = "world";
}
lwcHello.html
<lightning-card title="LWC_Hello" icon-name="action:announcement">
</lightning-card>
lwcHello.html
<lightning-button label="Count" onclick={count} ></lightning-button>
lwcHello.js
count() {
alert(this.greeting.length + " letters");
}
lwcHello.html
<lightning-button label="Count" onclick={count} slot="actions"></lightning-button>
No changes needed
lwcHello.html
<p>Hello, {greeting}!</p>
lwcHello.html
<lightning-input label="Name" value={greeting} onchange={handleChange}></lightning-input>
lwcHello.js
handleChange(event) {
this.greeting = event.target.value;
}
- Push and Git it!
- Create a scratch Org
- sfdx force:org:create -f config/project-scratch-def.json -a soTDX19_A2W -s
- Push original source to Org
- sfdx force:source:push --json --loglevel fatal
- Assign Permission Set
- sfdx force:user:permset:assign --permsetname Hello_World