Giter Site home page Giter Site logo

Twig 3 Compatibility about html-compress-twig HOT 10 OPEN

nochso avatar nochso commented on August 22, 2024 10
Twig 3 Compatibility

from html-compress-twig.

Comments (10)

toxpal avatar toxpal commented on August 22, 2024 2

Sorry, my bad, I used it earlier (can't remember the reason, but I had to look for another solution), and switched to https://packagist.org/packages/voku/html-compress-twig later

from html-compress-twig.

MarelPup avatar MarelPup commented on August 22, 2024 2

It's ok, i had already moved to a homemade solution when writing my first comment , i think i'll use this solution

from html-compress-twig.

StasToken avatar StasToken commented on August 22, 2024

I am also interested in this question, I spent all day today trying to find something similar on the Internet, but not a single analogue can twig 3

from html-compress-twig.

antiftw avatar antiftw commented on August 22, 2024

Hi @nochso

Bump, since I've been having the same problem migrating my cms to Symfony 5, which uses twig 3.0 ;) Have spent multiple days now looking for something with similar functionality and that also works without much hassle, without any success.

Thanks in advance,

PS. I don't even mind doing so myself, since I have the idea there are no major changes required, just a version bump, or am I wrong and are you dreading the day to start the rewrite?? haha ^^ Have never worked with submitting anything myself to packagist/github so you would have to give me some pointers where to start ;)

from html-compress-twig.

ekyazilim avatar ekyazilim commented on August 22, 2024

Hi @nochso
I'm eagerly awaiting the upgrade to twig 3. thanks..

from html-compress-twig.

MarelPup avatar MarelPup commented on August 22, 2024

Hi @nochso
the repo is silent since 2017 ,
is our best option implementing the dependency
https://packagist.org/packages/wyrihaximus/html-compress
using kernel.response as such ?
https://stackoverflow.com/a/72082233
https://symfony.com/doc/current/event_dispatcher.html#before-filters-with-the-kernel-controller-event

from html-compress-twig.

toxpal avatar toxpal commented on August 22, 2024

Yes, I switched to the solution mentioned above (wyrihaximus/html-compress) earlier, but it doesn't minify inline JavaScript code...

from html-compress-twig.

MarelPup avatar MarelPup commented on August 22, 2024

strange, considering

    public function __construct($forceCompression = false)
    {
        $this->forceCompression = $forceCompression;
        $this->parser = Factory::constructSmallest();
        $this->callable = array($this, 'compress');
    }

    public function compress(Twig_Environment $twig, $html)
    {
        if (!$twig->isDebug() || $this->forceCompression) {
            return $this->parser->compress($html);
        }
        return $html;
    }

doesn't seem to be a different implemetation of wyrihaximus ' basic compression

from html-compress-twig.

toxpal avatar toxpal commented on August 22, 2024

If I understand right, you use wyrihaximus/html-compress as a base + some custom code?

from html-compress-twig.

MarelPup avatar MarelPup commented on August 22, 2024

yes, I use kernel.response , as cited in the stackoverflow link

from html-compress-twig.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.