Remove query_cache behavior from codebase#123
Remove query_cache behavior from codebase#123kasparsatke wants to merge 1 commit intoperplorm:mainfrom
query_cache behavior from codebase#123Conversation
|
Great, thank you for the initiative! I wonder though, should we just remove the behavior, or should we rather disable it? Just removing it leaves users with an unexpected Exception like "query_cache behavior not found". |
|
Actually I already had some doubts when authoring last week as we recently have been talking about deprecation before removal. I still PR’ed today partially because I forgot about this since last week, but partially also since in the back of my mind I thought nobody is using this anyways & I have already undocumented it. But you are right, it would be nice somehow to have some fallback at least in case anyone is actually using this behavior. |
|
I wonder how many people have it enabled without using it. This is one of those behaviors that's quickly enabled and then forgotten. Not sure what is the best way to disable it: There is There is the command OutputInterface, which has Which leaves simple |
|
I have also thought about something like this but any of those three options make no sense in production. If everything works and you aren't curious - chances are you will never see those messages at all. I could think of something while manually doing composer update but then again if you are doing automatic/scheduled updates the problem is the same again. I think there is no reliable way to gracefully notify the user while he is in production mode only. Either a hard error or he problably won't see the deprecation. Also, a deprecation notice alone would not disable something. We would have to actively write some disabling logic. But this would still not close the gap to the hard removal. I mean we could do it of course with a boolean config pref that respects the current environment of the user (behavior in use?) otherwise defaults to disabled for new installations and schema reversals. In the latter occasions, a user might then also even be able to see console warnings. Saying this, as we had already some new/updated features in the recent past that required config prefs, I predict we also will need to employ some more sophistication about config prefs as at some point in the near future they might become to many to handle them with ease. The only thing I can further imagine is preparing the user upfront with changelogs and sufficiently long grace periods between deprecation and removal. Still then, one has to read changelogs which might not happen with automatic updates. Best thing one can do is combining the grace periods with semantic versioning. How do you feel it about this in general (not only this PR) - maybe let's dicuss it in the discussions section? |
|
I would like to keep the door open for people switching from the fading Propel2 to Perpl as long as possible. Meaning I don't see the actual class going away anytime soon. So if a user does not care about the messages in console, log, or code, well, let them. We probably gain the least from creating exceptions that force them to deal with something they apparently do not want to deal with. For the changes we put behind config options, I would like to add notifications that are printed when certain cli commands are run, i.e. notifications about optional changes to the model classes could be printed when For query_cache, I would propose:
Eh voila. Not sure what else we could do. Make the behavior not do what it doesn't do well and try to tell people what they need to do to get rid of it and point them to where they can find out more. This does not have to be pretty, just obvious. |
I fully understand.
Fully agree.
I get it, my point is it just might not be obvious. For this example, I myself would never see this in a normal setting as I automatically run all this migration stuff and also composer update via Github Action on each commit. I would only see this once for whatever reason I have to do it manually.
Fair point. Maybe I should not have been so quick with un-documenting. I could put it there again, but this time with a warning or dustbin sign like MDN does like e.g. here: https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/mediaGroup Or we could hide it in an extra page for deprecated features in the documentation, so it does not look like we actively support those deprecated features (although that contradicts the „make it obvious“ intention a bit). Anyways, I will try to come up with a new PR along the lines of what you suggested. |
|
For now, I have reverted the documentation for |
Fixes #95 and removes the
query_cachebehavior from the codebase.