gulp-twig icon indicating copy to clipboard operation
gulp-twig copied to clipboard

Update twig

Open piotrkulpinski opened this issue 9 years ago • 16 comments

Hi guys, Do you plan to update the package to use the latest Twig version? It's using 0.8.6 while the latest Twig version is 1.24.0

Thanks, Piotrek

piotrkulpinski avatar Apr 04 '16 09:04 piotrkulpinski

+1

sjova avatar Apr 22 '16 09:04 sjova

I think versioning in gulp-twig refers to twig.js releases and it uses the latest one https://github.com/twigjs/twig.js/releases

luboskmetko avatar Apr 27 '16 11:04 luboskmetko

You're right, but looks like twig.js lacks some of the original Twig functionalities.

piotrkulpinski avatar Apr 27 '16 12:04 piotrkulpinski

In latest version of twig.js, for example, they added support for source function: https://github.com/twigjs/twig.js/blob/master/CHANGELOG.md

But, source function not working in gulp-twig.

I suppose this line should be updated: https://github.com/zimmen/gulp-twig/blob/master/package.json#L16 0.8.6 -> 0.8.9

sjova avatar Apr 27 '16 12:04 sjova

Yep, you are right that it doesn't use the latest twig.js version, not sure why I thought otherwise. There is even a pull request for that here. Thanks for reopening.

luboskmetko avatar Apr 27 '16 12:04 luboskmetko

Please update to latest 0.9.5 version of TwigJS

igidas avatar May 24 '16 08:05 igidas

+1

lazar-vuckovic avatar May 24 '16 09:05 lazar-vuckovic

Sorry, but I couldn't wait any more so published an up-to-date package https://github.com/stowball/gulp-twig

stowball avatar May 27 '16 04:05 stowball

+1

mdmoreau avatar Jun 28 '16 21:06 mdmoreau

@stowball I believe that in npm pattern matching (e.g. ~) only works when applied to v>=1

fwiw this is also open as PR #27

olets avatar Sep 18 '16 18:09 olets

Hm I need twig >= 1.8.0 but when I try to type that in the package.json from gulp-twig-up-to-date he brings errors and said max 0.9.5 is Possible. @olets any Idea how I can fix that? What you mean with v>=1

davidhellmann avatar Oct 06 '16 12:10 davidhellmann

@davidhellmann it can get confusing: gulp-twig wraps twig.js, the js clone of Twig.

twig.js (currently v0.9.5) aims to match the latest Twig (currently v1.24.1 stable) (it does have some issues - bugs in embed and horizontal inheritance are the ones the average person is most likely to run into)

For a copy of gulp-twig using the latest version of twig.js link my fork (pr #27, with"gulp-twig": "olets/gulp-twig.git#update-dependencies") or @stowball's (https://github.com/zimmen/gulp-twig/issues/26#issuecomment-222060473, with "gulp-twig-up-to-date":""0.6.1") . (For now those two forks are identical except for the name change.)

What I was saying about pattern matching is stowball's fork added the dependency using "twig": "~0.9.5". That ~ made me think he might expect it to automatically update for 0.9.5 <= twig.js < 1.0, but as far as I know semver ranges (like the ~) don't work for npm dependencies until you pass v1.0 (so, for npm dependencies, ~x.y --> x.y <= v < x.(y+1) when x>1 but ~0.x --> v = 0.x). stowball may well already know this, but I wanted to give him a heads up that until twig.js passes 1.0 the dependency's version will need to be updated manually as if the ~ wasn't there.

(I'm not an expert in npm semver… there might be more nuance to it)

olets avatar Oct 06 '16 18:10 olets

OK thanks, I'm now using the twig u2d for the moment. And the version was a error in reasoning by myself. Sorry for that :) And my embed problem was this one: http://twigfiddle.com/itfr4h But I changed the If condition and now it works.

Thanks!

davidhellmann avatar Oct 06 '16 22:10 davidhellmann

#27 fix it

ryuran avatar Oct 27 '16 09:10 ryuran

Update was merged.

simon-dt avatar Oct 27 '16 09:10 simon-dt

@stowball would you consider unpublishing your gulp-twig-up-to-date? It's now well behind and people are still downloading it, presumably thinking it's the latest. gulp-twig is more actively maintained now, and between #32 and twigjs/twig.js/issues/450 this problem won't come up again for a long time, if ever (it'll take Twig.jsv2). Thanks for stepping in when it was needed!

olets avatar Sep 11 '17 14:09 olets