There is a tension that I see in the design of Spree/Solidus extensions, which is that extension maintainers increasingly want a single master branch compatible with many (ideally, all) currently supported versions of Spree/Solidus, rather than having a separate v2.10, v2.11, v3.0, etc. branch for each release.
I generally think that this makes sense and is a good practice.
However there is a problem with this in that the Deface override hashes are likely to be different across those versions. Some maintainers refuse to use original hashes for this reason. Users' logs will fill up with Deface: [WARNING] No :original defined messages.
Other maintainers decide which branch of Spree/Solidus to track. For all other versions of Spree/Solidus, the overrides still work, but those users' logs fill up with Deface: [ERROR] The original source has changed.
What if there was a better way?
Well, it occurs to me that the simplest solution here is for original to take an array of hashes (or alternately, for it to be possible to define original multiple times), and if any of those hashes match, no error or warning is thrown.
This way maintainers could simply include one hash for each branch; one hash for the 2.10 release, one for the 2.11 release, and one for the 3.0 release, etc.
What do you think?
If there is interest in merging a feature like this, I would be happy to prepare a PR.
There is a tension that I see in the design of Spree/Solidus extensions, which is that extension maintainers increasingly want a single
masterbranch compatible with many (ideally, all) currently supported versions of Spree/Solidus, rather than having a separatev2.10,v2.11,v3.0, etc. branch for each release.I generally think that this makes sense and is a good practice.
However there is a problem with this in that the Deface override hashes are likely to be different across those versions. Some maintainers refuse to use
originalhashes for this reason. Users' logs will fill up withDeface: [WARNING] No :original definedmessages.Other maintainers decide which branch of Spree/Solidus to track. For all other versions of Spree/Solidus, the overrides still work, but those users' logs fill up with
Deface: [ERROR] The original source has changed.What if there was a better way?
Well, it occurs to me that the simplest solution here is for
originalto take an array of hashes (or alternately, for it to be possible to defineoriginalmultiple times), and if any of those hashes match, no error or warning is thrown.This way maintainers could simply include one hash for each branch; one hash for the 2.10 release, one for the 2.11 release, and one for the 3.0 release, etc.
What do you think?
If there is interest in merging a feature like this, I would be happy to prepare a PR.