Description
In the Augmentation Libraries specification, we have the following:
- In the augmentation library side, we must declare it as a
library augment <main library url>
; - In the augmented (main) library side, we must import the augmentation with
import <augmentation library url>
; - A given augmentation file can only be used to augment a single library.
This structure is similar with what we have today (part
and part of
).
However, isn't it redundant to have to import an augmentation if the augmentation can only refer to a single library? In the current proposal, it is possible that an augmentation library exist but the main library does not import it. Does it makes sense? Considering that an augmentation library refer to specifically a single main library, this augmentation library would be completely useless.
For me, the following makes sense:
- An augmentation library does not need to declare the main library it augments. Instead, any library may import it as an augmentation, as long as the declaration rules are followed;
- An augmentation library must declare the main library it augments. The main library does not need to import the augmentation library, as it is obviously intended that it should be applied;
I am in favor of the seconds, as the first one would be considerably confusing and it would be fairly rare the cases where an augmentation library would be applicable from more than one main library.