Make ancestorClass option consistency to underscore#351
Make ancestorClass option consistency to underscore#351shakaran wants to merge 30 commits intoKnpLabs:masterfrom
Conversation
garak
left a comment
There was a problem hiding this comment.
We can't just change an option like this.
We need to keep BC: add new option, deprecate old option. Then we can remove old option in the next major version.
I just add deprecation contracts as symfony way and allow the support for both options during the transition for avoid BC. Let me know if it suitable for you now |
| {%- set classes = classes|merge([options.currentClass]) %} | ||
| {%- elseif matcher.isAncestor(item, options.matchingDepth) %} | ||
| {%- set classes = classes|merge([options.ancestorClass]) %} | ||
| {# ancestorClass will be deprecated in future, use ancestor_class #} |
There was a problem hiding this comment.
this does not report the deprecation AFAICT.
.github/workflows/build.yaml
Outdated
| php-version: ${{ matrix.php }} | ||
| - run: | | ||
| sed -ri 's/"symfony\/(.+)": "(.+)"/"symfony\/\1": "'${{ matrix.symfony }}'"/' composer.json; | ||
| sed -ri '/symfony\/deprecation-contracts/!s/"symfony\/(.+)\symfony\/deprecation-contracts/;": "(.+)"/"symfony\/\1": "'${{ matrix.symfony }}'"/' composer.json; |
There was a problem hiding this comment.
we need a space between ! and s
There was a problem hiding this comment.
you added it before the wrong s...
|
Please, let me know if there are something more needed to get this merged. I would like sent the next PR with the other options |
|
One month later, I still didn't receive feedback about why the PR is not merged or if I need to change something. |
I'm sorry to see your expectations about time disappointed. Unfortunately, there's no guarantee about that, since everyone is working in their free time. |
|
Please @stof there are any chance that this will be approved soon? I would like integrate the changes in other of my projects It should be quick to check for you. Thanks for your time. |
|
Should I fork this project and create a parallel project since maintainers doesn't have time to attend issues or resolve the pull request? I know that everybody is working in his free time here. But if main maintainers don't have time, the open source community dies, and the workaround is assign new people that wants to contribute, or in my side I only have the option to fork (which I don't like to do it, but if more time without response or progress I will have to initiate) |
|
The issue I have with accepting this PR is that I'm totally unsure about the effectiveness of the BC layer. There are 2 places impacted by this renaming:
And I'm even less sure about the effectiveness of the deprecation warnings for that second case. This means that this PR is risky, without much benefit (the existing name still works fine), while I only have limited free time dedicated to this project, and the same seems to be true for @garak |
…estor_class deprecation
|
First, thanks @stof for your time and quick response today.
I try to catch the deprecation in twig render here 4abbba4 The test is not fully working, I don't know exactly how to mock the deprecation, so I need a bit of help with that lines. Peer review and suggestions are appreciated.
I am not sure of this case, could you provide a example of project in that situation, so I can see the problem?
In theory, if this is released under a new version, they can use old version without BC until we can figure out how to address the problem.
The idea here when this PR gets accepted, is send more PR with the other names affected and close the issue of options consistency #171 |
|
@shakaran the whole point of using deprecations is to allow to release the change in a minor version (so without BC breaks) and having projects than migrate their code based on the warnings they get.
and fixing this consistency issue is about theoretical purity, not about actually making this package better for its user. The benefit of fixing this is small (it would help people learn the right option name without looking in the doc), but doing so at a high cost would be a no-go.
When using the symfony/phpunit-bridge deprecation reporting for the testsuite (which we do), you need to use the trait of that package to define deprecation expectations instead of relying on the |
Ok, minor release then (3.3) as pointed. As far it gets merged and released finally.
After this PR gets accepted I will provide the other cases and options rewriten with BC layer support of deprecations.
ok, I added, but it seems that for Symfony 4.4 with PHP 7.4 it breaks since no trait available |
|
@shakaran this is an issue in the way Symfony-specific jobs are configured. The phpunit-bridge should not be affected (it is a special component, that is not replaced by the monorepo package either) |
ok, then, it is good to merge, or do you need that I make more changes? Thanks |
|
@stof almost a year for get this merged. Please, could you consider it? Thanks, only remains your approve vote |
|
My comment in #351 (comment) still reflects my opinion on this subject. And my comment in #351 (comment) describes the hard parts of the Twig BC layer. The second point is still not solved IMO (users can implement their own templates to customize the rendering, in which they could read the options. |
|
I am not sure how to resolve the worflow broken for PHP 8.1 and Symfony 6, it seems a weird dependency hell. I am not sure if 8.1 should be supported since is EOL. |
|
Workflow changes should be submitted as a dedicated PR doing only that IMO. |


Applied renaming over the repo with:
grep -ril ancestorClass | xargs sed -i 's@ancestorClass@ancestor_class@g'