Newer Version Available
Best Practices for Unlocked Packages
We suggest that you follow these best practices when working with unlocked packages.
- We recommend that you work with only one Dev Hub, and enable Dev Hub in a production org.
- The Dev Hub org against which you run the force:package:create command becomes the owner of the package. If the Dev Hub org associated with a package expires or is deleted, its packages no longer work.
- Use care in deciding how to utilize namespaces. For most customers, we recommend working
with no namespace or a single namespace to avoid unnecessary complexity in managing components.
If you’re test-driving unlocked packages, use a test namespace.
Use real namespaces only when you’re ready to embark on a development path headed for release in a production org.
- Include the --tag option when you use the package:version:create and package:version:update commands. This option helps you keep your version control system tags in sync with specific package versions.
- Create user-friendly aliases for packaging IDs, and include those aliases in your Salesforce DX project file and when running CLI packaging commands. See: Package IDs and Aliases for Unlocked Packages.