Currently replacing is only possible on the application as the package metadata is not read for libraries but only the current project. Thus releasing a library which is based on patching would render it impossible to use for other people.
The alternative is to recursively go through all dependencies and check whether one of them has metadata set. If so one would be able to patch that dependency locally and use the replace on the current project to allow building, pretty much as it is done right now.
The disadvantage of this approach is that we might see libraries which will require the use of this tool making it more difficult for newcomers to use libraries.
Currently replacing is only possible on the application as the package metadata is not read for libraries but only the current project. Thus releasing a library which is based on patching would render it impossible to use for other people.
The alternative is to recursively go through all dependencies and check whether one of them has metadata set. If so one would be able to patch that dependency locally and use the replace on the current project to allow building, pretty much as it is done right now.
The disadvantage of this approach is that we might see libraries which will require the use of this tool making it more difficult for newcomers to use libraries.