Open piotrkulpinski opened 8 years ago
+1
I think versioning in gulp-twig refers to twig.js releases and it uses the latest one https://github.com/twigjs/twig.js/releases
You're right, but looks like twig.js lacks some of the original Twig functionalities.
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
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.
Please update to latest 0.9.5 version of TwigJS
+1
Sorry, but I couldn't wait any more so published an up-to-date package https://github.com/stowball/gulp-twig
+1
@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
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 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)
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!
Update was merged.
@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.js
v2). Thanks for stepping in when it was needed!
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