1 of 19

Salesforce DX:�Quickstart for Developers

Alex Brausewetter @abrausewetter

21 Feb, 2018 – Salesforce Developer Group Barcelona Meetup

© 2018 Blue Canvas Labs Inc.

2 of 19

Alex Brausewetter

Co-Founder at Blue Canvas

@abrausewetter

We make great tools for Salesforce developers and admins.

  • Automatic source control
  • One-click deployments
  • Backup and change tracking�

San Francisco • Barcelona

3 of 19

We are growing, and are looking for engineers who are passionate about�making Salesforce better.��Talk to me, or email team@bluecanvas.io

4 of 19

Salesforce DX:�Quickstart for Developers

  • What it is. And what is isn't.
  • How to use scratch orgs.
  • Micro-packages aka DCP / Packaging2
  • Using DX with Blue Canvas.
  • Should I use it today?

5 of 19

Sales·force D·X noun/ˈseɪlzˌfɔrs dɪ eks/

  1. New tools and new features for app developers, built and published by Salesforce proper.
  2. A program to bring best-practices from other platforms to Salesforce.

6 of 19

A major shift in responsibility.

  • Code modules. Large monolithic applications that have many interdependencies don't work well with DX. Developers need to refactor large codebases into small independent packages.
  • Source of truth. Instead of saying "the org is always right", Salesforce DX promotes a new principle of "the external source control is always right".
  • Scratch orgs. To support the new approach, an empty lightweight scratch orgs is created for every project. The changes in that org are then pushed to external source control by the developer.

7 of 19

Benefits

  • Code modules. Smaller packages can be tested independently. The chance of ripple effects is reduced. Instead of deploying the whole org, you deploy one package.
  • Source of truth. If used diligently, an external source control tool can provide better workflow and more information.
  • Scratch orgs. Lightweight orgs that can be started from the command-line or API are great for CI/CD and automatic testing. Using one scratch org per project prevents pollution of the main sandbox with unused code.

8 of 19

Caveats

  • No point-and-click interface. Salesforce DX is accessed through the command-line.
  • Not one-size-fits-all. Salesforce DX is an evolution in process and requires new learning. More than just checking your code into Git or Subversion.
  • Not yet admin-friendly. Works best with code and developer-driven changes. If you are working mostly on declarative metadata, YMMV.
  • Not for Sandboxes. Salesforce DX requires a sophisticated development lifecycle where changes are made in Scratch Orgs and then packaged. You must stop making changes to sandboxes or production directly.

9 of 19

Development Lifecycle with Sandboxes

Scratch Orgs

DCP Packages

Blue Canvas

10 of 19

Development Lifecycle with Sandboxes

Developer

1

Developer

2

Developer

3

Integration

Staging

Production

Production

Support

Training

Change Set or Sandbox Refresh

11 of 19

Development Lifecycle with Scratch Orgs

Feature

1

Feature

2

Feature

3

Integration

Staging

Production

Production

Support

Training

Prototype

Scratch Orgs

Developer:�Local PC

Source Control

Dev Hub

sfdx Command Line

Change Set or Sandbox Refresh

12 of 19

Developer Controlled Packages�aka Salesforce DX Packaging aka Packaging2 aka 2GP

  • ISV-style packaging for developers.
  • In Beta for Spring '18.
  • Multiple packages can share a single namespace. You can use�public class instead of global class.
  • Pre- and post-install scripts. Install multiple packages via CLI or API.
  • Packages can declare dependencies.
  • There are locked and unlocked packages. Unlocked means changes can be made by admins in the target org but changes are lost if developer upgrades. Locked means no changes can be made by admins.

13 of 19

Development Lifecycle with Scratch Orgs and DCP

Feature

1

Feature

2

Feature

3

Integration

Staging

Production

Production

Support

Training

Prototype

Scratch Orgs

Developer:�Local PC

Source Control

Dev Hub

sfdx Command Line

Change Set or Sandbox Refresh

Installed DCP Package

14 of 19

Development Lifecycle with Blue Canvas

  • Our goal: Allow teams to use Salesforce DX without reinventing their development process.
  • Automatic source of truth. Changes in any org are synchronized in real-time to a host Git source control repository, without any manual intervention.
  • Instant scratch orgs. Create scratch orgs from any org without using the command-line. The org will be initialized with your sandbox content.
  • Deploy to and from anywhere. Move your metadata from any org to another, without being limited by scratch org, sandbox, or production types. Both upstream and downstream syncs are possible.

15 of 19

Development Lifecycle with Blue Canvas

Developer

1

Developer

2

Developer

3

Staging

Production

Production

Support

Integration

Training

Blue Canvas one-click deployment

Feature

1

Hotfix

1

Scratch Orgs

Blue Canvas one-click scratch org

16 of 19

Live Demo

17 of 19

Should I use it today?

  • If you're a developer. Follow the Salesforce DX Trailhead trail to get an idea of the command-line and what it's all about.
  • If you're an admin or have a mixed team. There's a steep learning curve for Admins. Look for tools that make it easier to adopt DX.
  • If you're starting a new project. DX could help you write modular code. In a new project, the choice is yours. You may want to wait for Developer Controlled Packages to become GA.
  • If you have a large codebase. You should do detailed research and planning before starting to adopt DX in large existing projects. Expect to spend a lot of time refactoring and rewriting your codebase.

18 of 19

Questions

19 of 19

Thank you!

https://bluecanvas.io@bluecanvasio

Come and ask me questions. Also, we are hiring.