FluidTYPO3 / flux

TYPO3 extension Flux: Dynamic Fluid FlexForms
https://fluidtypo3.org
146 stars 212 forks source link

backward compatibility !! #1342

Closed webloft closed 7 years ago

webloft commented 7 years ago

Dear developers,

please keep in mind a backward compatibility of flux, vhs and related components. Our extensions must work with every new version of these components.

Our last issue: The widget.grid viewhelper is gone. And every load of an upatched CE-file raises an unwanted exception, of course. If this happens in the extension manager for example, the Typo3 installation will be unusable till the extension which used the broken part will be unloaded again. Every exception thrown is very very bad. This behaviour makes updates of single components near impossible for simple users (aka customers).

Also please note, simple content elements can and will be used for view-logic. Thus it can be overwritten by a template override and every features you mark as deprecated need to patched again in every file!

Suggestion: Use of a missing deprecated viewhelper should return false and only raise a warning in the BE log in production mode. In case of the widget.grid viewhelper even no warning is really necessary or depending on the context, an exception can be thrown in developer mode.

I hope you understand the problem. Have a nice weekend and thank you for the great work!

NamelessCoder commented 7 years ago

Hi @webloft - sorry to hear you got caught by the removed ViewHelper.

This isn't an attempt to downplay your problem, but I would like to take this opportunity to explain our normal practice regarding deprecations, and explain the specific case of the Grid widget.

First, our normal practice:

So while I don't wish to dismiss your bad experience, I do sincerely think that we handle breaking changes and in particular removals of public API, very carefully and in accordance with normal TYPO3 practices; e.g. deprecate ahead of time.

Now that the general stuff is hopefully well explained, I do have some comments for the practices you describe:

If this happens in the extension manager for example, the Typo3 installation will be unusable till the extension which used the broken part will be unloaded again

This is very true and it is indeed a rather serious issue when this can happen. Our normal strategy to avoid this is to be very careful what we allow to process when we detect the install tool is being used (as in: ext_localconf.php gets loaded in install tool and if this causes any errors, it's a critical problem). Therefore: if you do spot any such cases don't hesitate to report them and we'll make sure the case is prevented. However, outside the install tool we face a different situation: even in production mode, if for example Flux is unable to process a template, this is every bit as serious a problem as if you had misconfigured TCA or an Extbase plugin. Such issues also cause exceptions to be thrown (with a limited message when you're in production mode) - but there are even exceptions to this, for example some Flux methods will swallow Exceptions when detecting templates if the template can't be processed, and instead of reporting an error, log a warning. In a way, we already took your suggestions into consideration ;) - but please don't stop giving feedback!

If you spot places where a logged warning is better in production mode we're happy to consider it, absolutely!

This behaviour makes updates of single components near impossible for simple users (aka customers).

This is just personal advise (also based on experience with exactly customer sites where customer is not a dev) - I would not allow my customers to update extensions. I would instead aim to sell them for example an upgrade plan where the customer is entitled to have you do the upgrades if/when a vital upgrade is available. There are also utilities around (I'll find links if you are interested) which lets you remotely monitor extension versions and warn about available upgrades. In any case, I would consider some way to prevent your customers from having admin access. It's rarely a good idea (not only for FluidTYPO3 extensions but also realurl, powermail, news and many others). Having a qualified person do upgrades (one who understands risks, knows how upgrade scripts work, reads changelogs and understands semantic versioning - so, a dev!) is quite important for the end user impression - on any platform.

Also please note, simple content elements can and will be used for view-logic. Thus it can be overwritten by a template override and every features you mark as deprecated need to patched again in every file!

This too is very true! And I will add that this is as much a problem for FluidTYPO3 extensions as it is for - just as an example - customised EXT:news templates. It is a very new thing, but quite recently we got a command line utility which can actually detect such problems in all templates which follow conventions (FluidTYPO3 does, and you do to if you follow our advise of using a provider extension for templates, which I hope you do). There are two utilities you may find useful:

In addition to that I'll do my best to contribute a feature for TYPO3 for the install tool which can catch template issues just like the precompiler, and works along the lines of the "check for broken extensions" button. While that doesn't immediately do anything to prevent issues when you upgrade an extension, it would allow a nice way to detect all issues without visiting each page to render templates and it would obviously catch issues that can occur when you upgrade TYPO3 and due to version constraints also have to update some extensions.

I encourage you to point out any places you may come across these issues. We depend on user feedback for those issues we don't encounter ourselves, and we'd rather have one bug report too many than too few. I also encourage you read our change logs (although they are just git log exports, you can get a quick overview of REMOVAL and FEATURE changes which are the important ones when it comes to potentially breaking changes). And last, I hope my advise above can be useful to you in the future, especially the one about not letting customers be admins ;)

Have a nice weekend to you as well :)

Cheers, Claus

webloft commented 7 years ago

Thank you for the links and your explanation. I agree on breaking changes in code files in major versions but imho fluid files are (static) template files and such files should not to have to be changed too much if possible - otherwise one reason to use them is gone (as it is a new feature, this would not lead to a good reputation at all). Since unloadable classes of missing viewhelpers are still a big problem in typo3, it should simply avoided removing them (classes and/or attributes) at the moment.

I see no benefit in total broken installations by such unnecessary and avoidable issues. Thany you for minding.

NamelessCoder commented 7 years ago

Hi again @webloft - just wanted to let you know that this thread gave me some ideas about how TYPO3 could decrease the severity of these issues quite significantly when production mode is enabled. I'll bring this up with the others on the code sprint tomorrow and I think we can come up with a nice solution that will be in the next TYPO3 LTS.

NamelessCoder commented 7 years ago

Oh and by the way, the reason I talk about putting this in TYPO3 (rather than for example saying we will stop removing ViewHelper classes in FluidTYPO3 or use a much longer deprecation time frame) is that a solution there is a solution for every community extension and third party ViewHelper out there. We've got a nice chance to prevent headaches not just for FluidTYPO3 users ;)

webloft commented 7 years ago

Sounds great =) I hope core team will notice and accept!

NamelessCoder commented 7 years ago

See https://github.com/TYPO3/Fluid/pull/271 for a followup PR. Will close this one - and promise not to forget our discussion ;)