-
-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(NFC) mixin/**.php - Add @since tags #23423
Conversation
This is a follow-up/correction for civicrm#22959 (circa 5.50.alpha1; specifically fdc67a7). The prior revision had updated the behavior of `mgd-php`, so it should have also updated the version-number.
(Standard links)
|
@totten one question about this: the |
@totten thinking about this some more, I'm not sure how civix is going to make sense of the
And in that example, the |
@colemanw Good point. I was wondering about that too. We should probably break that down as a couple distinct things:
For the current situation... Perhaps this would be a reasonable approach:
|
@totten was that a response to my 1st comment or my 2nd? |
Crossed wires. It's a reply to the first comment, which came through about the same time you posted the second comment.
Right, important distinction. For making the optimization in mosaico#520, I think it's more useful to note when this particular revision was merged into core.
But if the semantic of |
This makes me think you have a plan in your head that I'm not privy to. Because I can't imagine why civix would need to know that |
This got a bit long... 📜 but I guess there was a lot of ground to cover...
For this specific update of It's easier for me to imagine with other mixins - eg
I guess, in this, it doesn't really matter much if it's done as SemVer MINOR or MAJOR - either works. If we were looking at heavier mixin like
It could check I suppose I have some additional constraints in mind, which we may not have fully discussed. I'll just braindump a bit...
All those conditionals+contingencies makes it sound complicated, but (in my mind) the rule of thumb should be simple (though I haven't tried to write it down). Like this:
This discussion is reminding me about why
|
Interesting, I hadn't imagined a scenario where a new minor version of a mixin would cause a non-backward-compatible break. But in your example the @totten am I missing something or are you perhaps over-engineering this solution :) |
We chatted a bit by phone (yesterday). I scribbled some take-aways and wanted to cleanup/post for anyone watching the queue:
|
Overview
Adds extra metadata to the mixin files.
This will enable better code-generation -- ie
civix
would be able to skip unnecessary backports. It is an off-shoot from discussion in veda-consulting-company/uk.co.vedaconsulting.mosaico#520NOTE: This PR builds on #23422, so you'll see 1-2 extra lines in the diff. It does not fundamentally depend on 23422, but they touch on adjacent annotations, and they would conflict if merged in parallel. One has to go before the other. This one can go second.
Before
Hard to tell when a mixin was introduced (unless you go poking through git history).
After
Each mixin reports when it was introduced (
@since
).Technical Details
You can inspect the parsed metadata and see the 'since' value: