SlideShare a Scribd company logo
Packaging - It's not just for ISVs
Keir Bowden
https://trailblazer.me/id/bob-buzzard
@bob_buzzard
CTO at BrightGen
11 time MVP
Certified Technical Architect
> 10 years package development experience - SI + ISV
About Me
Packages
1st and 2nd Generation
Ancestry and Branching
Choose your Plan
Agenda
Packages
A collection of metadata components
Treated as a single unit
Install in one atomic operation
Everything goes in, or nothing does
Remove in one atomic operation
After removing local references
… Deletes data for packaged objects
What is a package
Distribution
Internal
Selected customers
Entire world
Promotes modular development
Isolated functionality
Independent release cadence
Communication through well-defined interfaces
Identifiable
Components from packages are marked with an icon
Why Packages?
1st and 2nd Generation Packaging
Terminology
Packaging Org (1st)
Developer Edition for First Generation package development
Namespace
Prefix applied to all metadata
Package version
Snapshot of the components at a point in time
Immutable
Subscriber Org
Org where package has been installed
Dev Hub (2nd)
Salesforce DX Developer Hub
Create and manage second generation packages
Create and manage scratch orgs
Unpackaged Metadata
Metadata required during package develop/test
Not included in final package
Beta version
Unreleased version of a package
May never be released
Install only in scratch, developer or sandbox orgs
Promote to release if testing successful
Terminology
Comparison
Source of Truth
First Gen Second Gen
Packaging Org Version Control
SFDX/CLI
Optional/Basic Mandatory/Integrated
Team Development
Challenging Straightforward
Create Version
Packaging Org UI Filesystem + CLI
Namespace
Single Package Multiple Packages
Ancestry
Linear Flexible
Unpackaged Metadata
Mixed in org Declarative
Namespace defined in Packaging Org
Unique to each package
Restricted to this one org
Expose code through global keyword
Blunt instrument
Code available to everyone
• Subscriber Org
• Any other packages installed in that org
Namespace - 1st Gen
Defined in developer edition
Registered in Dev Hub
Available for multiple packages
Potential for namespace collisions
E.g. BOOKSTORE__Book__c in two packages
Expose code through global keyword
Namespace - 2nd Gen
And @namespaceAccessible annotation
@namespaceAccessible
Package COREPKG Package SALESPKG
Explicitly grant access to each member
Class
Method
Property
Interface
Can add or remove at any time - may break code
Cannot mix with @AuraEnabled
Creates dependency
SALESPKG requires COREPKG to be installed
@namespaceAccessible Annotation
Ancestry and Branching
V1.0.0
Ancestry - 1st Gen
Patch Version
V2.0.0 V2.1.0 V2.2.0
V2.1.1
Define previous version (ancestorVersion)
Optional
Ancestry - 2nd Gen
1.25.0 can extend 1.24.0 released version
And any ancestors of 1.24.0
"Use the ancestor that’s the immediate parent of the version you’re creating"
SalesforceDXDeveloper Guide, https://sforce.co/3jUdxZH
Ancestry - 2nd Gen
V1.0.0 V2.0.0 V2.1.0 V2.2.0
V3.0.0 V3.1.0
V4.0.0 V4.1.0
ancestorVersion1.0.0 ancestorVersion2.0.0 ancestorVersion2.1.0
ancestorVersion2.0.0 ancestorVersion3.0.0
No ancestorVersion ancestorVersion4.0.0
Parallel development streams, like version control
Multiple beta versions with the same number
Only one can be promoted to released
Use --branch <name> switch when creating version
Branching
Branching
2.0.0
2.0.0.
1
2.1.0.
1
2.1.0.
2
2.1.0.
1
2.1.0.
2
2.1.0
Version Control
Merge
Feature Branch
AuthorReading
Feature Branch
OrderApprovals
Feature Branch
LoyaltyCard
Choose Your Plan
FirstGeneration SecondGeneration
Managed
Unmanaged Unlocked Managed Org
Dependent
1st Gen Unmanaged
Features
No namespace
Code visible/editable
Not upgradeable
When to use
Never!
1st Gen Managed
Features
Namespaced
Code obfuscated
Upgradeable
When to use
List on app exchange
Features missing in 2GP
2nd Gen Managed
Features
Namespaced
Code obfuscated
Upgradeable
When to use
List on app exchange
Extend 1GP
ISV
Tightly controlled apps
2nd Gen Unlocked
Features
Optional Namespace
Code visible/editable
Upgradeable
Downgradeable
Migrate metadata
Example - revert 1.33 version of package to 1.25
Downgrade Package
Metadata is :
Modified (Apex classes reverted to 1.25)
Deprecated (Custom objects not present in 1.25)
Deleted (Report not present in 1.25)
Fails if local code depends on 1.33 code
Move metadata in/out of package
Release metadata from package into org
Claim metadata from org in to package
Collaboration required
Cannot use namespaces
Package and org must be logically complete
No demo, just screenshots (sorry)
Migrate Metadata
Migrate Metadata
Migrate Metadata
Migrate Metadata
Migrate Metadata
Migrate Metadata
Migrate Metadata
2nd Gen Unlocked
When to Use
System Integrator
Enterprise Customer
Newer Org
Entire Application New
Distribute Open Source
2nd Generation Org Dependent Unlocked
Features
No Namespace
Code visible/editable
Upgradeable
Downgradeable
Migrate metadata
Depend on Org Metadata
Org Dependent
Org Package
Tests run on installation
Faster development
Slower installation
Complicates development process
Dependent metadata must be present during development
Local changes may prevent upgrade - collaboration required
Scratch orgs can be a challenge
Tooling can't tell the difference
Dependent metadata can sneak into package
LIkely to target fewer subscriber orgs
Org Dependent
2nd Generation Org Dependent Unlocked
When to Use
Mature Org
Rely on existing metadata
Extend existing apps
Enterprise Customer
Sweet spot for SI
2nd Generation
Flexibility
Managed
Unlocked
Org-Dependent
Developer
Collaboration
Control
Official Docs
Managed : sforce.co/398qygi
Unlocked : sforce.co/3NuNBk9
Trailhead :
Managed Module : sforce.co/3GUTmFr
Unlocked Trail : sforce.co/38W51qQ
2nd Gen Launch FAQs - historic interest
Developer Controlled : bit.ly/3MsZV2W
Unlocked : bit.ly/3O1ZWMO
Trailblazer groups :
Unlocked : sforce.co/3xo6jEC
London's Calling 21 Org Dependent Packages
youtu.be/XzUWr6gV9zk
More Information - 2nd Generation Only!
Thank You
Keir Bowden
https://trailblazer.me/id/bob-buzzard
@bob_buzzard

More Related Content

PDF
Our move to Salesforce DX and Unlocked Packages
Fabien Taillon
 
PPTX
Second-generation managed packages
Bohdan Dovhań
 
PDF
Accenture Salesforce Developer Meetup vol 1 2019
Accenture Hungary
 
PDF
Salesforce DX 201 - Advanced Implementation for ISVs
Vivek Chawla
 
PPTX
Dublin Meetup: TrailheaDX '18
Fabrice Cathala
 
PDF
Salesforce DX & Deep Dive demo on force:data commands
Steven Hugo
 
PDF
Salesforce DX Quickstart for Developers (Barcelona Meetup)
Jack Moxon
 
PDF
[Tech Webinar] Second Generation Packaging for ISVs
CodeScience
 
Our move to Salesforce DX and Unlocked Packages
Fabien Taillon
 
Second-generation managed packages
Bohdan Dovhań
 
Accenture Salesforce Developer Meetup vol 1 2019
Accenture Hungary
 
Salesforce DX 201 - Advanced Implementation for ISVs
Vivek Chawla
 
Dublin Meetup: TrailheaDX '18
Fabrice Cathala
 
Salesforce DX & Deep Dive demo on force:data commands
Steven Hugo
 
Salesforce DX Quickstart for Developers (Barcelona Meetup)
Jack Moxon
 
[Tech Webinar] Second Generation Packaging for ISVs
CodeScience
 

Similar to LC 2022 - Second Generation Packaging (20)

PPTX
Salesforce DX for admin
Thierry TROUIN ☁
 
PDF
Modern App Dev: Modular Development Strategies
Salesforce Developers
 
PPTX
Salesforce DX for Admin v2
Thierry TROUIN ☁
 
PPTX
Salesforce Developer Group Toronto - Winter'19
Jaswinder Rattanpal
 
PDF
TDX19 - Untangle Your Org with Salesforce Developer Tools
Doug Ayers
 
PDF
TDX19 - Accelerate DevOps with GitLab and Salesforce
Doug Ayers
 
PDF
Continuous Integration and Testing with Branch Orgs
Salesforce Developers
 
PDF
Chicago Salesforce Saturday - Tools Presentation
David Helgerson
 
PPTX
Simplify your code with Salesforce DX and module development
Salesforce Developers
 
PPT
SFDX Presentation
Bohdan Dovhań
 
PDF
Salesforce DX Pilot Product Overview
Salesforce Partners
 
PPTX
Successfully retrieving metadata from salesforce org using packages
Mohith Shrivastava
 
PPTX
Salesforce Integration Patterns
usolutions
 
PDF
Dreamforce 19 Global Gatherings Sevilla Salesforce Developer Group
Jorge Ortega Traverso
 
PDF
Modern Development with Salesforce DX
Salesforce Developers
 
PPTX
Spring 15
Jyothylakshmy P.U
 
PPTX
Salesforce DX with Visual Studio Code
Thierry TROUIN ☁
 
PPTX
Créer et gérer une scratch org avec Visual Studio Code
Thierry TROUIN ☁
 
PDF
Developer Preview Live – Release Readiness LIVE, Spring '18
Salesforce Developers
 
Salesforce DX for admin
Thierry TROUIN ☁
 
Modern App Dev: Modular Development Strategies
Salesforce Developers
 
Salesforce DX for Admin v2
Thierry TROUIN ☁
 
Salesforce Developer Group Toronto - Winter'19
Jaswinder Rattanpal
 
TDX19 - Untangle Your Org with Salesforce Developer Tools
Doug Ayers
 
TDX19 - Accelerate DevOps with GitLab and Salesforce
Doug Ayers
 
Continuous Integration and Testing with Branch Orgs
Salesforce Developers
 
Chicago Salesforce Saturday - Tools Presentation
David Helgerson
 
Simplify your code with Salesforce DX and module development
Salesforce Developers
 
SFDX Presentation
Bohdan Dovhań
 
Salesforce DX Pilot Product Overview
Salesforce Partners
 
Successfully retrieving metadata from salesforce org using packages
Mohith Shrivastava
 
Salesforce Integration Patterns
usolutions
 
Dreamforce 19 Global Gatherings Sevilla Salesforce Developer Group
Jorge Ortega Traverso
 
Modern Development with Salesforce DX
Salesforce Developers
 
Salesforce DX with Visual Studio Code
Thierry TROUIN ☁
 
Créer et gérer une scratch org avec Visual Studio Code
Thierry TROUIN ☁
 
Developer Preview Live – Release Readiness LIVE, Spring '18
Salesforce Developers
 
Ad

More from Keir Bowden (20)

PDF
Mutation Testing.pdf
Keir Bowden
 
PDF
London Non-Profit Spring 22 Salesforce Release
Keir Bowden
 
PDF
London Salesforce Developer January 2022
Keir Bowden
 
PDF
Winter 22 for Developers
Keir Bowden
 
PDF
Londons Calling 2021
Keir Bowden
 
PPTX
London Salesforce Developers TDX 20 Global Gathering
Keir Bowden
 
PDF
Helsinki developer group march 2020
Keir Bowden
 
PDF
London's calling 2020 Documentor Plug-In
Keir Bowden
 
PDF
Lightning User Interface Testing with Selenium and Node JS
Keir Bowden
 
PDF
Salesforce CLI Cheat Sheet
Keir Bowden
 
PDF
Salesforce Spring 19 release top 10 Features
Keir Bowden
 
PDF
UI Testing with Selenium and Node - London's Calling 2019
Keir Bowden
 
PPTX
Salesforce Winter 19 release top 10 features
Keir Bowden
 
PDF
Quickstart Templates with the Salesforce CLI
Keir Bowden
 
PDF
TrailheaDX Global Gathering London 2018
Keir Bowden
 
PDF
Getting started with public speaking
Keir Bowden
 
PDF
Salesforce CLI
Keir Bowden
 
PPTX
London's Calling 2018 - No Connection, No Problem
Keir Bowden
 
PPTX
No Connection? No Problem!
Keir Bowden
 
PDF
Unit Testing Lightning Components with Jasmine
Keir Bowden
 
Mutation Testing.pdf
Keir Bowden
 
London Non-Profit Spring 22 Salesforce Release
Keir Bowden
 
London Salesforce Developer January 2022
Keir Bowden
 
Winter 22 for Developers
Keir Bowden
 
Londons Calling 2021
Keir Bowden
 
London Salesforce Developers TDX 20 Global Gathering
Keir Bowden
 
Helsinki developer group march 2020
Keir Bowden
 
London's calling 2020 Documentor Plug-In
Keir Bowden
 
Lightning User Interface Testing with Selenium and Node JS
Keir Bowden
 
Salesforce CLI Cheat Sheet
Keir Bowden
 
Salesforce Spring 19 release top 10 Features
Keir Bowden
 
UI Testing with Selenium and Node - London's Calling 2019
Keir Bowden
 
Salesforce Winter 19 release top 10 features
Keir Bowden
 
Quickstart Templates with the Salesforce CLI
Keir Bowden
 
TrailheaDX Global Gathering London 2018
Keir Bowden
 
Getting started with public speaking
Keir Bowden
 
Salesforce CLI
Keir Bowden
 
London's Calling 2018 - No Connection, No Problem
Keir Bowden
 
No Connection? No Problem!
Keir Bowden
 
Unit Testing Lightning Components with Jasmine
Keir Bowden
 
Ad

Recently uploaded (20)

PPTX
dns domain name system history work.pptx
MUHAMMADKAVISHSHABAN
 
PPTX
Blue and Dark Blue Modern Technology Presentation.pptx
ap177979
 
PPTX
How tech helps people in the modern era.
upadhyayaryan154
 
PPTX
谢尔丹学院毕业证购买|Sheridan文凭不见了怎么办谢尔丹学院成绩单
mookxk3
 
PDF
Latest Scam Shocking the USA in 2025.pdf
onlinescamreport4
 
PPTX
The Internet of Things (IoT) refers to a vast network of interconnected devic...
chethana8182
 
PPTX
办理方法西班牙假毕业证蒙德拉贡大学成绩单MULetter文凭样本
xxxihn4u
 
PDF
Data Protection & Resilience in Focus.pdf
AmyPoblete3
 
PDF
DNSSEC Made Easy, presented at PHNOG 2025
APNIC
 
PPTX
Perkembangan Perangkat jaringan komputer dan telekomunikasi 3.pptx
Prayudha3
 
PPTX
Different Generation Of Computers .pptx
divcoder9507
 
PPT
Transformaciones de las funciones elementales.ppt
rirosel211
 
PPTX
LESSON-2-Roles-of-ICT-in-Teaching-for-learning_123922 (1).pptx
renavieramopiquero
 
PPTX
Pengenalan perangkat Jaringan komputer pada teknik jaringan komputer dan tele...
Prayudha3
 
PPTX
Crypto Recovery California Services.pptx
lionsgate network
 
PPTX
Microsoft PowerPoint Student PPT slides.pptx
Garleys Putin
 
PDF
LB# 820-1889_051-7370_C000.schematic.pdf
matheusalbuquerqueco3
 
PPTX
AI ad its imp i military life read it ag
ShwetaBharti31
 
PPTX
Unlocking Hope : How Crypto Recovery Services Can Reclaim Your Lost Funds
lionsgate network
 
PDF
KIPER4D situs Exclusive Game dari server Star Gaming Asia
hokimamad0
 
dns domain name system history work.pptx
MUHAMMADKAVISHSHABAN
 
Blue and Dark Blue Modern Technology Presentation.pptx
ap177979
 
How tech helps people in the modern era.
upadhyayaryan154
 
谢尔丹学院毕业证购买|Sheridan文凭不见了怎么办谢尔丹学院成绩单
mookxk3
 
Latest Scam Shocking the USA in 2025.pdf
onlinescamreport4
 
The Internet of Things (IoT) refers to a vast network of interconnected devic...
chethana8182
 
办理方法西班牙假毕业证蒙德拉贡大学成绩单MULetter文凭样本
xxxihn4u
 
Data Protection & Resilience in Focus.pdf
AmyPoblete3
 
DNSSEC Made Easy, presented at PHNOG 2025
APNIC
 
Perkembangan Perangkat jaringan komputer dan telekomunikasi 3.pptx
Prayudha3
 
Different Generation Of Computers .pptx
divcoder9507
 
Transformaciones de las funciones elementales.ppt
rirosel211
 
LESSON-2-Roles-of-ICT-in-Teaching-for-learning_123922 (1).pptx
renavieramopiquero
 
Pengenalan perangkat Jaringan komputer pada teknik jaringan komputer dan tele...
Prayudha3
 
Crypto Recovery California Services.pptx
lionsgate network
 
Microsoft PowerPoint Student PPT slides.pptx
Garleys Putin
 
LB# 820-1889_051-7370_C000.schematic.pdf
matheusalbuquerqueco3
 
AI ad its imp i military life read it ag
ShwetaBharti31
 
Unlocking Hope : How Crypto Recovery Services Can Reclaim Your Lost Funds
lionsgate network
 
KIPER4D situs Exclusive Game dari server Star Gaming Asia
hokimamad0
 

LC 2022 - Second Generation Packaging

  • 1. Packaging - It's not just for ISVs Keir Bowden https://trailblazer.me/id/bob-buzzard @bob_buzzard
  • 2. CTO at BrightGen 11 time MVP Certified Technical Architect > 10 years package development experience - SI + ISV About Me
  • 3. Packages 1st and 2nd Generation Ancestry and Branching Choose your Plan Agenda
  • 5. A collection of metadata components Treated as a single unit Install in one atomic operation Everything goes in, or nothing does Remove in one atomic operation After removing local references … Deletes data for packaged objects What is a package
  • 6. Distribution Internal Selected customers Entire world Promotes modular development Isolated functionality Independent release cadence Communication through well-defined interfaces Identifiable Components from packages are marked with an icon Why Packages?
  • 7. 1st and 2nd Generation Packaging
  • 8. Terminology Packaging Org (1st) Developer Edition for First Generation package development Namespace Prefix applied to all metadata Package version Snapshot of the components at a point in time Immutable Subscriber Org Org where package has been installed
  • 9. Dev Hub (2nd) Salesforce DX Developer Hub Create and manage second generation packages Create and manage scratch orgs Unpackaged Metadata Metadata required during package develop/test Not included in final package Beta version Unreleased version of a package May never be released Install only in scratch, developer or sandbox orgs Promote to release if testing successful Terminology
  • 10. Comparison Source of Truth First Gen Second Gen Packaging Org Version Control SFDX/CLI Optional/Basic Mandatory/Integrated Team Development Challenging Straightforward Create Version Packaging Org UI Filesystem + CLI Namespace Single Package Multiple Packages Ancestry Linear Flexible Unpackaged Metadata Mixed in org Declarative
  • 11. Namespace defined in Packaging Org Unique to each package Restricted to this one org Expose code through global keyword Blunt instrument Code available to everyone • Subscriber Org • Any other packages installed in that org Namespace - 1st Gen
  • 12. Defined in developer edition Registered in Dev Hub Available for multiple packages Potential for namespace collisions E.g. BOOKSTORE__Book__c in two packages Expose code through global keyword Namespace - 2nd Gen And @namespaceAccessible annotation
  • 14. Explicitly grant access to each member Class Method Property Interface Can add or remove at any time - may break code Cannot mix with @AuraEnabled Creates dependency SALESPKG requires COREPKG to be installed @namespaceAccessible Annotation
  • 16. V1.0.0 Ancestry - 1st Gen Patch Version V2.0.0 V2.1.0 V2.2.0 V2.1.1
  • 17. Define previous version (ancestorVersion) Optional Ancestry - 2nd Gen 1.25.0 can extend 1.24.0 released version And any ancestors of 1.24.0 "Use the ancestor that’s the immediate parent of the version you’re creating" SalesforceDXDeveloper Guide, https://sforce.co/3jUdxZH
  • 18. Ancestry - 2nd Gen V1.0.0 V2.0.0 V2.1.0 V2.2.0 V3.0.0 V3.1.0 V4.0.0 V4.1.0 ancestorVersion1.0.0 ancestorVersion2.0.0 ancestorVersion2.1.0 ancestorVersion2.0.0 ancestorVersion3.0.0 No ancestorVersion ancestorVersion4.0.0
  • 19. Parallel development streams, like version control Multiple beta versions with the same number Only one can be promoted to released Use --branch <name> switch when creating version Branching
  • 21. Choose Your Plan FirstGeneration SecondGeneration Managed Unmanaged Unlocked Managed Org Dependent
  • 22. 1st Gen Unmanaged Features No namespace Code visible/editable Not upgradeable When to use Never!
  • 23. 1st Gen Managed Features Namespaced Code obfuscated Upgradeable When to use List on app exchange Features missing in 2GP
  • 24. 2nd Gen Managed Features Namespaced Code obfuscated Upgradeable When to use List on app exchange Extend 1GP ISV Tightly controlled apps
  • 25. 2nd Gen Unlocked Features Optional Namespace Code visible/editable Upgradeable Downgradeable Migrate metadata
  • 26. Example - revert 1.33 version of package to 1.25 Downgrade Package Metadata is : Modified (Apex classes reverted to 1.25) Deprecated (Custom objects not present in 1.25) Deleted (Report not present in 1.25) Fails if local code depends on 1.33 code
  • 27. Move metadata in/out of package Release metadata from package into org Claim metadata from org in to package Collaboration required Cannot use namespaces Package and org must be logically complete No demo, just screenshots (sorry) Migrate Metadata
  • 34. 2nd Gen Unlocked When to Use System Integrator Enterprise Customer Newer Org Entire Application New Distribute Open Source
  • 35. 2nd Generation Org Dependent Unlocked Features No Namespace Code visible/editable Upgradeable Downgradeable Migrate metadata Depend on Org Metadata
  • 37. Tests run on installation Faster development Slower installation Complicates development process Dependent metadata must be present during development Local changes may prevent upgrade - collaboration required Scratch orgs can be a challenge Tooling can't tell the difference Dependent metadata can sneak into package LIkely to target fewer subscriber orgs Org Dependent
  • 38. 2nd Generation Org Dependent Unlocked When to Use Mature Org Rely on existing metadata Extend existing apps Enterprise Customer Sweet spot for SI
  • 40. Official Docs Managed : sforce.co/398qygi Unlocked : sforce.co/3NuNBk9 Trailhead : Managed Module : sforce.co/3GUTmFr Unlocked Trail : sforce.co/38W51qQ 2nd Gen Launch FAQs - historic interest Developer Controlled : bit.ly/3MsZV2W Unlocked : bit.ly/3O1ZWMO Trailblazer groups : Unlocked : sforce.co/3xo6jEC London's Calling 21 Org Dependent Packages youtu.be/XzUWr6gV9zk More Information - 2nd Generation Only!