0

Given the following example.

enter image description here

1 - Is it possible to make such reference happen given the fact that the dependent package exist through the same namespace?

2 - if the previous statement is true, then when it comes to package upgrades: if I update the component on main package and then attempt to upgrade the main package, will the component be automatically upgraded or the extension package should also need a new version to rely on the new version link as part of dependency package creation?

1 Answer 1

4

Is it possible to make such reference happen given the fact that the dependent package exist through the same namespace?

Certainly. All 2GP can share a single namespace, and dependencies are allowed in the same namespace as long as there are no circular references.

if the previous statement is true, then when it comes to package upgrades: if I update the component on main package and then attempt to upgrade the main package, will the component be automatically upgraded or the extension package should also need a new version to rely on the new version link as part of dependency package creation?

A package with a dependency can use any future version of the version they are dependent on. They cannot use any earlier version or any alternative branch. For example, let's say that you have the following hierarchy:

     1.0.1
    /     \
1.1.0      1.0.2
     \          \
  1.1.1          1.0.3

If your extension package uses 1.0.2 of the main package as the dependency, then you can install 1.0.3 without a problem, but you won't be able to install 1.1.0 or 1.1.1, because the dependency will no longer be met. If you don't create such branches, this wouldn't be a concern.

3
  • Thanks for the insight fox, maybe I should have created a question number 3. My concern is that if we update the exposed component on main It may not reflect the updated component as part of the extension package. Mar 22 at 17:39
  • After a re-read im assuming its safe to do it, and the extension package will contain the newly updated component as part of the reference since we are invoking the reference and not its contents, correct me if im wrong Mar 22 at 17:46
  • 1
    @RaulPereyra The extension will use the component that is in the main package that's installed. Upgrading the main package won't affect the extension, because the extension does not actually "contain" the component, just a reference to it.
    – sfdcfox
    Mar 22 at 20:54

You must log in to answer this question.

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