twigphp / Twig

Twig, the flexible, fast, and secure template language for PHP
https://twig.symfony.com/
BSD 3-Clause "New" or "Revised" License
8.18k stars 1.25k forks source link

[Doc] Provide an alternative for the deprecated spaceless filter #4308

Closed javiereguiluz closed 2 months ago

javiereguiluz commented 2 months ago

When a feature is deprecated, it's recommended to provide an alternative for it (or mention that there's no alternative).

So, let's mention the whitespace control features in the deprecation message of the spaceless filter.

stof commented 2 months ago

The mention should be expanded IMO to make it clear that whitespace control is not a drop-in replacement of spaceless. It is a different feature (that might satisfy the need of the project if their intent was to remove spaces coming from indentation in the Twig template)

javiereguiluz commented 2 months ago

@stof in Symfony Docs, in similar situations, we don't do that because it's like duplicating some doc content. Also, the admonition messages look bad when they are too long.

I'd say it's better to just link to the new docs so visitors can quickly learn about it ... but if Twig Docs does differently, tell me and I'll update this. Thanks.

stof commented 2 months ago

Well, the message as is can make people think that this is a direct replacement, while it is a totally different feature.

I'm not asking to duplicate the documentation of whitespace control in the admonition message. I'm only asking to make it explicit that whitespace control is not a direct replacement.

fabpot commented 2 months ago

Thank you @javiereguiluz.