introduce the concept of opt-in package conflicts #14314
Labels
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
proposal
This issue suggests modifications. If it also has the "accepted" label then it is planned.
zig build system
std.Build, the build runner, `zig build` subcommand, package management
Milestone
Extracted from #14265. Depends on #14288.
Motivation: to discover when a dependency tree contains cruft, in the form of fundamentally redundant code.
The idea here is that packages could declare a set of labels which are features that the package provides:
Importantly, if two different packages in the dependency tree provide the same functionality, tooling would emit a warning:
In this case, despite how cool
taylors_cool_crypto
is, perhaps it might be better from a bloat perspective to forkez_request
and make it usenetworking_utils
instead, and then send a polite merge request upstream. If the ez_request maintainers don't want to merge it, then the ecosystem forks, ever in search of reducing bloat.For another example, consider that infamous package, left-pad. We could imagine the underscore library having something like this:
Here, underscore would have not listed every function it provided, but would list the functionality that it provided that competed with existing, tiny packages. With this proposal implemented, it may have lead to many JavaScript developers asking themselves why they were carrying redundant dependencies in their trees, and worked a little bit to come up with coherent sets of dependencies that reduced bloat. Perhaps more people would have migrated towards utilities such as underscore, or some people might have migrated towards truly independent sets of small packages. Either way, there would have been less redundant code in the dependency tree.
Speaking of underscore, there is another interesting package to bring up: lodash. This package is intentionally competing with underscore. With the
provides
feature that I propose here, this could actually be codified, by directly putting the other package's ID into the provides field:This would be an aggressive move, explicitly documenting that a package is competing with another package. When an application developer finds such a situation in their tree, it is clear that there could be bloat reduced by picking a lane:
Open-source communities need more drama! 🔥 🍿
The text was updated successfully, but these errors were encountered: