- Issue created by @catch
- Status changed to Needs review
8 months ago 6:21pm 28 March 2024 - π¬π§United Kingdom catch
Maybe we can do this. If not, we need to change the the tables plugin and add an upgrade path.
- πΊπΈUnited States smustgrave
Could we put a small comment for the str_replace just so we know why?
- π¬π§United Kingdom catch
Added a comment, but I'm not sure this approach will actually get committed - we might need to go the full config upgrade path/hook_view_presave() route to rename the options instead.
Also not at all sure what this means for stable9 - is it supposed to add back the old classes or something?
- π¬π§United Kingdom longwave UK
Hmm this feels a bit hacky - surely there is a chance of false positives here and debugging this is going to be tricky for some. I think it's better to fix the problem at source, permanently and more specifically.
Thinking about this and π Use regex instead of DOM parsing in BigPipe::getPlaceholderOrder() RTBC also gave me an idea of how we could deprecate CSS classes: an event subscriber that parses the entire response (DOM parsing or maybe regex if we're feeling lucky) and issues deprecations if they are found in the output? Not perfect, but not sure what other options we have.
- πΊπΈUnited States smustgrave
π [policy, then docs] Change how we deprecate classes Fixed not sure if this follows under this policy
- Status changed to Needs work
8 months ago 9:09pm 28 March 2024 - π¬π§United Kingdom catch
Pushed a commit to get rid of the str_replace() and rename the options - but no upgrade path for that yet.
also gave me an idea of how we could deprecate CSS classes: an event subscriber that parses the entire response (DOM parsing or maybe regex if we're feeling lucky) and issues deprecations if they are found in the output?
Would probably need to be toggled like Twig debug because nothing stops themes implementing CSS for those classes, and adding them back via preprocess/templates.
- π¬π§United Kingdom catch
@smustgrave π [policy, then docs] Change how we deprecate classes Fixed is for PHP classes.
- πΊπΈUnited States smustgrave
Oops feel like I've seen a policy ticket around this topic though.
- π¬π§United Kingdom longwave UK
So even with removing the classes from the table options it's quite possible someone is using these handy classes elsewhere in the custom class fields in Views, or in a template, because they've been around forever and it saves you making your own. If we just delete them from CSS we risk breaking layouts, because we didn't tell people not to use them.
- π¬π§United Kingdom catch
unless this is a hardcoded list in Views already?
It is a hard-coded list in views already, it looks like it's generic, but it's fake-genericism - there are just three classes used in Tables.php and the preprocess only runs on tables.
I also wonder whether this is even a legit feature, seems like explicit, hard-coded text alignment doesn't fit with RTL languages. I guess it's OK if you leave it unconfigured, and it'll mostly be on custom views, but it would be tempting to offer only nothing (which defaults to left or right alignment depending on language direction) and center. That'd be an even bigger change though.
- π¬π§United Kingdom catch
@longwave
If we just delete them from CSS we risk breaking layouts, because we didn't tell people not to use them.
Isn't that what
core/themes/stable9/css/views/views.module.css
is for? - π¬π§United Kingdom longwave UK
Oh yes, I forgot about that. Wonder if we should try and do more of these before Drupal 11 and make a leaner and cleaner stable11 theme or if it's too late for that.
- Status changed to Needs review
8 months ago 7:16am 29 March 2024 - π¬π§United Kingdom catch
Added an upgrade path.
Having done that though, I wondered if we should make the config keys 'left', 'center', 'right' and then expand those to the class names in preprocess, that way if core ever updates these classes, we wouldn't need another update path. So went ahead and did that too.
- Status changed to Needs work
8 months ago 3:49pm 30 March 2024 - Status changed to Needs review
8 months ago 5:30pm 30 March 2024 - πΊπΈUnited States smustgrave
Can a comment be added to stable9 then so we know why thatβs needed there.
- Status changed to RTBC
8 months ago 9:56pm 30 March 2024 - Status changed to Needs work
8 months ago 11:55am 1 April 2024 - π¬π§United Kingdom alexpott πͺπΊπ
I think we need to go through the deprecation process so that module maintainers get information to update any views provided by modules.