Building apps faster with lightning and winter '17

37

Transcript of Building apps faster with lightning and winter '17

Page 1: Building apps faster with lightning and winter '17
Page 2: Building apps faster with lightning and winter '17

Forward-Looking StatementStatement under the Private Securities Litigation Reform Act of 1995:

This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services.

The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site.

Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.

Page 3: Building apps faster with lightning and winter '17

Go Social!

Salesforce Developers

Salesforce Developers

Salesforce Developers

The video will be posted to YouTube & thewebinar recap page (same URL as registration).

This webinar is being recorded!

@salesforcedevs

Page 4: Building apps faster with lightning and winter '17

§ Don’t wait until the end to ask your question! – Technical support will answer questions starting now.

§ Respect Q&A etiquette– Please don’t repeat questions. The support team will work

their way down the queue.§ Stick around for live Q&A at the end

– Speakers will tackle questions at the end, time-allowing.§ Head to Developer Forums

– More questions? Visit developer.salesforce.com/forums

Have Questions?

Page 5: Building apps faster with lightning and winter '17

Base Lightning Components

Page 6: Building apps faster with lightning and winter '17

How can my app look like this?

Page 7: Building apps faster with lightning and winter '17

Can I use theCSS in my app?

Page 8: Building apps faster with lightning and winter '17

Can you makeit easier?

Page 9: Building apps faster with lightning and winter '17

Base Lightning Component GoalsEasy to adopt

• Patterned after HTML standards making it easy to adopt.Componentized

• Components are self contained and can be composed to build experience components

Minimal CSS• Styled using the Salesforce Lightning Design System (SLDS), ensuring

that your components match the Lightning Experience and Salesforce1 Mobile seamlessly

• They evolve with SLDSAccessible by design: Supporting WCAG 2.0 and Section 508 standards

Page 10: Building apps faster with lightning and winter '17

Facilitate reusability over all other principles

Start with restrictive shape and relax on request

Optimize for best practices and make bad practice harder to implement

Develop components for the 80%

Base Lightning Component Philosophy

BaseLightning

Components

Page 11: Building apps faster with lightning and winter '17

Most Used/Requested Components

Page 12: Building apps faster with lightning and winter '17

Styling Is Baked In

Buttons IconsBadges Inputs

Page 13: Building apps faster with lightning and winter '17

Simple Markup

Buttons IconsBadges Inputs

<lightning:button … />

<lightning:icon … />

<lightning:input type="number" … />

<lightning:select … />

Page 14: Building apps faster with lightning and winter '17

Base Lightning Components in Winter ‘17 iconbuttonbuttonGroupbuttonIconbuttonMenu inputbadge

formattedNumber formattedDateTimemenuItem select spinner textarea

Page 15: Building apps faster with lightning and winter '17

Button Patterns

<lightning:buttonGroup><lightning:button … /><lightning:button … /><lightning:button … /><lightning:buttonMenu … >

<lightning:menuItem … /><lightning:menuItem … /><lightning:menuItem … />

</lightning:buttonMenu></lightning:buttonGroup>

Page 16: Building apps faster with lightning and winter '17

Container and Layout Components

Tabset & TabCardLayout & layoutItem

<lightning:card footer="Card Footer” iconName="utility:location" title=“My Card Header"><aura:set attribute="actions">

<lightning:button label="New"/></aura:set> Card Body (custom component)</lightning:card>

Page 17: Building apps faster with lightning and winter '17

Component Structure and Variants

<lightning:button variant="brand" ../>

<lightning:button variant=“destructive"

label="Delete" onclick="{!c.handler}" class="myClass"/>

Page 18: Building apps faster with lightning and winter '17

Salesforce Lightning Design System

CSS framework• Open sourced, faster development

Consistent User Experience• Across different apps and devices

Seamless upgrades every release • Easy migration path across releases

Page 19: Building apps faster with lightning and winter '17

Evolving In Step With SLDS

Page 20: Building apps faster with lightning and winter '17

Release Roadmap

Release Theme ComponentsSpring ‘17 Adding depth to single

record foundational components

Eg: avatar, inputSearch, inputSelect, picklist, inputRichText, tile, pill, modal and notification

Summer ‘17

Introducing experience and databound components

Eg: inputField, outputField, list, lookup

Page 21: Building apps faster with lightning and winter '17

Demo

Page 22: Building apps faster with lightning and winter '17

Christophe Coenraets@ccoenraets

Lightning Data Service

Page 23: Building apps faster with lightning and winter '17

Components Drive Modern UI Experiences

Page 24: Building apps faster with lightning and winter '17

Before Lightning Data Service

PropertyStatus

PropertyMap

MortgageCalculator

PropertyController- getProperty

getProperty(abc)

getProperty(abc)

getProperty(abc)

Client Server

Page 25: Building apps faster with lightning and winter '17

Challenges

1. Multiple calls to the server for the same record2. Code-centric– Javascript at the client-side– Apex at the server-side (including CRUD and FLS

enforcement)3. UI inconsistencies– Each component has its own copy of the data– Changes made in one component are not reflected in other

components

Page 26: Building apps faster with lightning and winter '17

Introducing Lightning Data Service

• Declarative CRUD operations• No Apex• No SOQL• Limited Javascript (Edit mode only)• Handles sharing rules and field level security• Shared record cache

Page 27: Building apps faster with lightning and winter '17

Lightning Data Service

PropertyStatus

PropertyMap

MortgageCalculator

Client Server

Shared Record Cache

<force:record recordId="abc"/>

<force:record recordId="abc"/>

<force:record recordId="abc"/>

Page 28: Building apps faster with lightning and winter '17

Example<aura:component implements="force:hasRecordId,flexipage:availableForAllPageTypes" access="global"> <aura:attribute name="recordId" type="Id" /> <aura:attribute name="property" type="Property__c" /> <force:recordPreview recordId="{!v.recordId}" targetRecord="{!v.property}" fields="['Id', 'Status__c']" /> {!v.property.Status__c} </aura:component>

Page 29: Building apps faster with lightning and winter '17

Example 2: EDIT mode<aura:component implements="force:hasRecordId,flexipage:availableForAllPageTypes" access="global"> <aura:attribute name="recordId" type="Id" /> <aura:attribute name="property" type="Property__c" /> <force:recordPreview aura:id="propertyService" recordId="{!v.recordId}" targetRecord="{!v.property}" fields="['Id', 'Status__c']" mode="EDIT"/> <ui:inputText label="Status:" value="{! v.property.Status__c}"/> <lightning:button onclick="{!c.onSaveClicked}">Save</lightning:button></aura:component>

Page 30: Building apps faster with lightning and winter '17

Saving the RecordonSaveClicked : function(component) { component.find("propertyService").saveRecord();}

Page 31: Building apps faster with lightning and winter '17

Synching Records in Edit Mode<aura:component implements="force:hasRecordId,flexipage:availableForAllPageTypes" access="global"> <aura:attribute name="recordId" type="Id" /> <aura:attribute name="property" type="Property__c" /> <force:recordPreview aura:id="propertyService" recordId="{!v.recordId}" targetRecord="{!v.property}" fields="['Id', 'Status__c']" mode="EDIT" recordUpdated="{!c.onRecordUpdated}"/> <ui:inputText label="Status:" value="{! v.property.Status__c}"/> <lightning:button onclick="{!c.onSaveClicked}">Save</lightning:button></aura:component>

Page 32: Building apps faster with lightning and winter '17

Reloading the Record onRecordUpdated : function(component, event, helper) { var changeType = event.getParams().changeType; if (changeType === "CHANGED") { component.find("propertyService").reloadRecord(); }}

Page 33: Building apps faster with lightning and winter '17

Summary

Without Lightning Data Service With Lightning Data Service

Code-centric (Apex, SOQL, FLS, Javascript)

Declarative (no code)

Components make multiple calls to the server for the same record

Components get record from local record cache which manages server access transparently and efficiently

Each component has its own copy of the record

Components share a single copy of the record

Page 34: Building apps faster with lightning and winter '17

http://dreamhouseapp.io

Page 35: Building apps faster with lightning and winter '17

SurveyYour feedback is crucial to the successof our webinar programs. Thank you!

http://bit.ly/2fcaY5s

A copy of the webinar and the survey will be emailed to all who registered.

Page 36: Building apps faster with lightning and winter '17

Q & A

Also try our discussion boards http://bit.ly/discussionboards

Try Trailhead: trailhead.salesforce.comJoin the conversation: @salesforcedevs

Page 37: Building apps faster with lightning and winter '17

Thank You