0

Before SFDX I only versioned just the code (classes, components, objects, pages, triggers, and sometimes staticresources) in all of my projects and I saw many other projects doing the same. This mainly stems from the fact that the metadata was never thought to be versioned in the first place and since it really was just a mess, I left it out. When SFDX came around I was curious if this would be fixed with the all-new project directly layout. So I spoke with some guys that are really in the community and embrace all new features - they told me that it already is better with DX somehow but it's still not ideal. And for some weird reason, I cannot seem to find any answers to this simple question.

  1. I know you can now version your metadata with DX. But should you? Always?
  2. Currently, are they any pros and cons to each solution?
  3. If this is possible - are there any drawbacks? Do I have to be aware of anything?
  4. If I migrate an existing classic project to DX - will there be any differences/conversions?
2

I know you can now version your metadata with DX. But should you? Always?

Ideally, yes. It's possible to recreate virtually an entire org, which is really useful for Scratch Orgs and later, Unlocked Packages. However, there may be challenges that prevent this, as packaging isn't a perfect science yet.

Currently, are they any pros and cons to each solution?

Unlocked Packages are awesome, and Scratch Orgs are awesome. The only downside is that it may require complicated planning if you have many interdependent parts.

If this is possible - are there any drawbacks? Do I have to be aware of anything?

Not all metadata is packageable, which is frustrating. For all other use cases, the only other downside (if you call it that) is that packages can overwrite administrative changes. This forces administrators to be more technical in order to update the packages (or depend on devs to do it for them). This is definitely a mixed bag.

If I migrate an existing classic project to DX - will there be any differences/conversions?

The entire source tree changes from the mdapi format to the source format. The initial conversion is typically non-trivial, but the results are incredible, especially if you also use a code repository. Merges and syncs are much easier, especially for Objects and other large metadata types.

| improve this answer | |
  • So, does the source format solve all the issues that made the metadata format mostly unusable before DX? – Semmel Jun 24 at 15:11
  • 1
    @Semmel Is it a panacea? Not necessarily. However, it fixes the major problems, including the CustomObject format. It's a good deal closer to ideal than the old mdapi format. – sfdcfox Jun 24 at 15:23
  • Thanks for the clarification. If I stumble upon any similar problems - comparable to the ones I had with the metadata format - I'll update my question here and/or comment on it. – Semmel Jun 24 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.