Is there a bundler analog to npm's patch-package
or yarn patch
?
#8580
Unanswered
keithlayne
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Over the years I've occasionally searched for a tool like this. I'm fairly certain this isn't built into bundler. I'd be really surprised if this hasn't been discussed at least once around here, but if so I've missed it.
AFAIK there are really only a couple of viable solutions for making local/project-specific changes to gems installed via bundler: forking/copying from source control and using e.g. a git reference in your
Gemfile
or vendoring a gem and applying changes there. (Please correct me if I'm missing something else that's obvious). I've done both in the past, and I don't really like doing either, but that's mostly an opinion thing with me.I've used both
patch-package
andyarn patch
quite a bit, and I'm assuming that many or most people are familiar with the concept and the problems they're trying to solve. Normally the use cases are around rejected patches upstream or highly specific changes that you need but don't apply generally.I'm not even sure how something like this would work in the context of bundler. Is it something that could be done in a bundler plugin? Would patching need to happen at bundle time, or would it need a runtime component to patch files on the fly when loaded? That seems like it would need to probably hook into ruby more deeply with e.g.
require
.Am I missing anything? It's certainly pretty easy to fork and then just rebase your patch on the upstream if it makes releases for probably 99% of cases. Is that the best guidance still?
Beta Was this translation helpful? Give feedback.
All reactions