bminer / node-blade

Blade - HTML Template Compiler, inspired by Jade & Haml
Other
320 stars 28 forks source link

Meteor : update to latest version 0.6 with blade #165

Closed vraptor75011 closed 11 years ago

vraptor75011 commented 11 years ago

I did a mrt update and it appears to break the collection behavior.

Capture d e cran 2013-04-13 a 14 41 49

It looks like the javascript files of the Meteor projects are loaded but not executed, excepted for those inside client/views.

Is it a bug with meteor-blade or with meteor ?

vraptor75011 commented 11 years ago

Apparently this issue is due to a new feature in Meteor : "We've added file-level JavaScript variable scoping. Variables declared with var at the outermost level of a JavaScript source file are now private to that file. Remove the var to share a value between files."

In coffee files, il I write : "@Posts = new Meteor.Collection ..." I can access the collection. But when accessing the posts variable in posts.blade (loop foreach), the helper Template[posts/posts].posts doesn't work well and throw

Exception from Deps afterFlush function: @http://0.0.0.0:3000/packages/blade/runtime-meteor.js?7c5904495c94aa75a5773b28d6e4671d29e90f23:45

The problems seems to be with the include in my foreach loop "include 'post' exposing post

Still investigating ...

vraptor75011 commented 11 years ago

Working if I copy from v3.0.3 runtime-meteor runtime

and if the included files are : "../posts/post"

bminer commented 11 years ago

I'm confused. What, exactly, is the problem here?

vraptor75011 commented 11 years ago

with latest meteor-blade version tag: https://github.com/bminer/meteor-blade.git#v3.2.2meteor2

Capture d e cran 2013-04-16 a 20 51 31

Looks like #154 , include post exposing post in a foreach loop

If i copy runtime-meteor.js and runtime.js from v3.0.3 (which solved #154 )

Capture d e cran 2013-04-16 a 20 46 30

bminer commented 11 years ago

I cannot replicate this bug. Please post your post.blade and posts.blade files.

Also, in posts.blade try adding the following right before your include:

- console.log("posts.blade info", __)

and post the output of the console.

vraptor75011 commented 11 years ago

Project visible at : git://github.com/vraptor75011/MeteorBladeBlog2.git Here is the output :

Object _id: Object body: "C est un post" createdAt: Sun Apr 07 2013 20:05:43 GMT+1100 (NCT) nbComments: 0 submitted: true title: "Post 1" updatedAt: "" userId: "C79gpCTDdbiiFqAjL" proto: Object posts.js:19posts.blade info ["<$label:5HyqiH632cxatiwJD><$label:yjGPQRcL3WGE2ygBG><$data:LJu8pMXEjPpMNicPR><$landmark:ryCRJGDaWqypbBqrd><$events:XKjrtw79jprCgRGmD><$watch:qi7Nyz8wCMLBqj8mu><$isolate:CExe7ePMaMnxr5xPZ><$events:sNeqo7QYqH9jEY4cu><$watch:RBQgoLo9DjaHZSYRr><$label:TEgmf8vtbuncXNSGg><$label:JbfYiqCZr2gAu9Q2p><$data:xf5d7aQ59qHrsXFoR><$landmark:ctZjz9pFYotakDepk><$events:NEbfT2ppF97nhMRiF><$watch:WwypgsJX7iDcnYdpM><$isolate:9yPfJipqtkrTFR4KF><$events:gqdL8ZLjx4mmnDSLj><$watch:796i5CY4BpizZ6scH>

</$watch:796i5CY4BpizZ6scH></$events:gqdL8ZLjx4mmnDSLj></$isolate:9yPfJipqtkrTFR4KF></$watch:WwypgsJX7iDcnYdpM></$events:NEbfT2ppF97nhMRiF></$landmark:ctZjz9pFYotakDepk></$data:xf5d7aQ59qHrsXFoR></$label:JbfYiqCZr2gAu9Q2p></$label:TEgmf8vtbuncXNSGg><$label:oSZmX5WfbzZiiuaGv><$label:PJnXdjWXLt8WzcN4v><$data:PoNT4toQbPSkWMqzR><$landmark:xBNaEup5aj2nFxd8n><$events:GWyRwandgknADYXxM><$watch:qhhQFR37JsEjqjCAr><$isolate:Pu8tNT6yacJ27wMze><$events:cMBwTByeEZ5JnEGex><$watch:bPjc8GtsGmjxfsNbX>

Bonjour

</$watch:bPjc8GtsGmjxfsNbX></$events:cMBwTByeEZ5JnEGex></$isolate:Pu8tNT6yacJ27wMze></$watch:qhhQFR37JsEjqjCAr></$events:GWyRwandgknADYXxM></$landmark:xBNaEup5aj2nFxd8n></$data:PoNT4toQbPSkWMqzR></$label:PJnXdjWXLt8WzcN4v></$label:oSZmX5WfbzZiiuaGv><$label:oWGnfb9Jqi9DmRkCY><$label:noQb3Gj5gEbBLcgzn><$data:gwR7sWznJbKRdWnEL><$landmark:ya8oKi5BupfuACP8r><$events:ibpNcw2WHjsb6fAWm><$watch:3FcbKDb7Za6kpRysA><$isolate:FE67NPaLsb6L497kx><$events:FziLxFX3L76p8gMDQ><$watch:j9i6z4ncdq7uaA8Yb>
<$label:ERdMPwr4hBzgKCo7i><$label:wikBe8LujoTGBD8sw><$data:ZFq8q3YozYKyKShQ5><$landmark:2qDDX44XrHajJSxCd><$events:7jrLPdxfxnMbHPzqg><$watch:kbHEj2tGMWqLhD6AT><$isolate:AfPStE8GPjGs23Lko><$events:f3GQtv5c9rD3Lhgth><$watch:dNz2vBYmFwytP9SNp> Nouveau Post</$watch:dNz2vBYmFwytP9SNp></$events:f3GQtv5c9rD3Lhgth></$isolate:AfPStE8GPjGs23Lko></$watch:kbHEj2tGMWqLhD6AT></$events:7jrLPdxfxnMbHPzqg></$landmark:2qDDX44XrHajJSxCd></$data:ZFq8q3YozYKyKShQ5></$label:wikBe8LujoTGBD8sw></$label:ERdMPwr4hBzgKCo7i>
<$label:K6EsdH6X4aWSxmjwt><$label:TtM2KrC5BativzPGi><$data:Dj8h8vRHXhoHfZ2RM><$landmark:65ZyAwo6osAN8Fe48><$events:YQwtmQ2KZkSRhzS3Z><$watch:borfjfs3SNFEDPpbG><$isolate:CskL3KiC9P76crges><$events:xiphTMC3QFZe29HLH><$watch:57tNApFGBuJop4ora><$label:Hqd2eg9DoBhN3k4y6><$label:J6bjsKesMXdhFSGTQ><$data:WmXd7wtx2q3Yz9wgj><$landmark:KM6BLtCWJQRaB22Ek><$events:r3nsm6ztnLgQDcmee><$watch:QhXH3nBDkhxTz8ifF><$isolate:jmktfiqSFqfoReSe8><$events:kxpBPiiYuYTDkvvfW><$watch:n3FHeSRYDno3SfpXB></$watch:n3FHeSRYDno3SfpXB></$events:kxpBPiiYuYTDkvvfW></$isolate:jmktfiqSFqfoReSe8></$watch:QhXH3nBDkhxTz8ifF></$events:r3nsm6ztnLgQDcmee></$landmark:KM6BLtCWJQRaB22Ek></$data:WmXd7wtx2q3Yz9wgj></$label:J6bjsKesMXdhFSGTQ></$label:Hqd2eg9DoBhN3k4y6><$list:ypLku89pBpDtwomCn></$list:ypLku89pBpDtwomCn></$watch:57tNApFGBuJop4ora></$events:xiphTMC3QFZe29HLH></$isolate:CskL3KiC9P76crges></$watch:borfjfs3SNFEDPpbG></$events:YQwtmQ2KZkSRhzS3Z></$landmark:65ZyAwo6osAN8Fe48></$data:Dj8h8vRHXhoHfZ2RM></$label:TtM2KrC5BativzPGi></$label:K6EsdH6X4aWSxmjwt>
</$watch:j9i6z4ncdq7uaA8Yb></$events:FziLxFX3L76p8gMDQ></$isolate:FE67NPaLsb6L497kx></$watch:3FcbKDb7Za6kpRysA></$events:ibpNcw2WHjsb6fAWm></$landmark:ya8oKi5BupfuACP8r></$data:gwR7sWznJbKRdWnEL></$label:noQb3Gj5gEbBLcgzn></$label:oWGnfb9Jqi9DmRkCY><$label:tzZahj47WvGA4TDCi><$label:pfShmnxmxLXbdjKd5><$data:yMAzwaqGAvoS5AyrG><$landmark:6jGjzrkh2BowwmmK8><$events:pYa42Ca3TCsBcSoyr><$watch:iBvtFT3H5RNCAkgNs><$isolate:hCDbe43yoPiDN9Xvj><$events:3cjszH7MhRifz9vS4><$watch:YJTC4Y8GuHPCuci6d></$watch:YJTC4Y8GuHPCuci6d></$events:3cjszH7MhRifz9vS4></$isolate:hCDbe43yoPiDN9Xvj></$watch:iBvtFT3H5RNCAkgNs></$events:pYa42Ca3TCsBcSoyr></$landmark:6jGjzrkh2BowwmmK8></$data:yMAzwaqGAvoS5AyrG></$label:pfShmnxmxLXbdjKd5></$label:tzZahj47WvGA4TDCi></$watch:RBQgoLo9DjaHZSYRr></$events:sNeqo7QYqH9jEY4cu></$isolate:CExe7ePMaMnxr5xPZ></$watch:qi7Nyz8wCMLBqj8mu></$events:XKjrtw79jprCgRGmD></$landmark:ryCRJGDaWqypbBqrd></$data:LJu8pMXEjPpMNicPR></$label:yjGPQRcL3WGE2ygBG></$label:5HyqiH632cxatiwJD>"]

bminer commented 11 years ago

I cannot replicate any bugs... probably because my Mongo DB is empty. Could you provide me with some sample values that I can load into the DB? Or, can you simplify this bug into a simple example that I can run and test?

Thanks for your help.

vraptor75011 commented 11 years ago

posts.json

{ "_id" : { "$oid" : "347a0a1a7406a503bddfadc2" }, "body" : "fffff", "createdAt" : { "$date" : 1365901868581 }, "nbComments" : 0, "submitted" : true, "title" : "lllll", "updatedAt" : "", "userId" : "virEdEdkfBwPyafNL" }
{ "_id" : { "$oid" : "3ed9cb73f31b9b4e73d0c800" }, "body" : "C est un post", "createdAt" : { "$date" : 1365325543823 }, "nbComments" : 0, "submitted" : true, "title" : "Post 1", "updatedAt" : "", "userId" : "C79gpCTDdbiiFqAjL" }
{ "_id" : { "$oid" : "9300f568be0d0c2f22c402a5" }, "body" : "zzzz", "createdAt" : { "$date" : 1365326283027 }, "nbComments" : 0, "submitted" : true, "title" : "zzzz", "updatedAt" : { "$date" : 1365326294798 }, "userId" : "C79gpCTDdbiiFqAjL" }

I think it s the same issue as #154

Thanks for your help

vraptor75011 commented 11 years ago

Was a bug in my code