sampart / BreadcrumbsBundle

A small breadcrumbs bundle for Symfony
Other
188 stars 68 forks source link

The spaceless tag is deprecated since Twig 2.7, use the spaceless filter instead #103

Open mhujer opened 5 years ago

mhujer commented 5 years ago

With a recent version of Twig I'm getting a deprecation warning because the use of the spaceless tag in the template: https://github.com/whiteoctober/BreadcrumbsBundle/blob/78214890393fa5dd9cea632873ee10e0a290b33b/Resources/views/microdata.html.twig#L1-L3

It suggests to use spaceless filter instead. But only to avoid extra whitespace between HTML tags to avoid browser rendering quirks under some circumstances.

On the other hand, it says:

If you want to optimize the size of the generated HTML content, gzip compress the output instead.

So the question is for which reason is the spaceless used here. Should it be replaced with a filter or removed?

manu-sparheld commented 5 years ago

Waiting for this to be update. Getting too many deprecation :100:

Same is available in WhiteOctoberBreadcrumbsBundle::json-ld.html.twig

sampart commented 5 years ago

I imagine that the reasons for this tag are lost in the mists of time. If you've the time, I'd recommend simply experimenting with removing it locally and checking that the output is sensible. If it is, you could make a PR to remove it permanently.

It's worth bearing #106 in mind - we've unfortunately little time for work with this project now, sorry!

mhujer commented 5 years ago

@sampart @manu-sparheld I'm using this bundle in several projects, so I plan to have a look at this issue over the summer and eventually maintain a fork - as suggested in #106

sampart commented 5 years ago

That's great. Thank you, @mhujer! Once your fork is at an advanced enough stage, add a note onto #106 and we can look into updating the README to point to it. Thanks again.

mhujer commented 5 years ago

Fixed this in my fork (see https://github.com/whiteoctober/BreadcrumbsBundle/issues/106#issuecomment-525323526) with a simple change: https://github.com/mhujer/BreadcrumbsBundle/commit/5cb54766dc71b700ff1ad8b7a7caffa98b0845fb