1

When configuring sfdx-project.json for 2GP managed package you specify it's dependencies.

My package depends on our 1GP managed package. So I specified 1GP package version Id in depencensies.

But what will happen when we upgrade our 1GP? I could not find answer for this. Documentation says you can use word LATEST, but will it work with package version Id? It is hard to find any information about dependencies.

1 Answer 1

2

When you update your 1GP, unless your 2GP is also going to be updated to make use of new features (object model additions, new APIs etc.) from the updated 1GP there is no actual need to update your 2GP's dependencies (or release a new version of your 2GP) at all. Dependencies effectively identify the minimum version that you depend on in this scenario since 1GP versioning is entirely linear.

On the other hand, if your 2GP is to be enhanced to use new features from your 1GP then you will need to first provide at a minimum a new beta release for your 1GP then update the 2GP to depend on that new version before you can update it to use the new features, then release a new 2GP version.

Yes, a 2GP can depend on a 1GP beta release (we have had to use this approach when providing an integration 2GP between our own 1GP and a third-party 1GP, since the third party would not give us access to a full release version). Obviously if that 1GP beta includes changes that are later abandoned and that the 2GP was changed to use you will find you have a "dead branch" in the 2GP version tree.

1
  • Thank you, you saved my time.
    – Mr Smith
    Jul 8, 2021 at 15:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .