Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

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

Open
mhujer opened this issue Apr 13, 2019 · 5 comments

Comments

@mhujer
Copy link
Contributor

mhujer commented Apr 13, 2019

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
Copy link

manu-sparheld commented Jun 21, 2019

Waiting for this to be update. Getting too many deprecation 💯

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

@sampart
Copy link
Owner

sampart commented Jun 22, 2019

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
Copy link
Contributor Author

mhujer commented Jun 30, 2019

@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
Copy link
Owner

sampart commented Jul 1, 2019

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
Copy link
Contributor Author

mhujer commented Aug 27, 2019

Fixed this in my fork (see #106 (comment)) with a simple change: mhujer@5cb5476

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants