Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jade compatibility #11

Closed
markshust opened this issue Aug 3, 2015 · 18 comments
Closed

jade compatibility #11

markshust opened this issue Aug 3, 2015 · 18 comments
Labels

Comments

@markshust
Copy link

If I create a layout template file in jade (https://github.com/mquandalle/meteor-jade), the initial transition kicks off, then the following route is completely blank:

template(name="frontend")
  .transitions-container(style="height:100%")
    +yield

If I remake the template in html, everything works:

<template name="frontend">
  <div class="transitions-container" style="height:100%">
    {{> yield}}
  </div>
</template>

Is this a bug with transitions, or meteor-jade?

@jamielob
Copy link
Owner

jamielob commented Aug 3, 2015

Hi @markoshust - tbh I've never used Jade before. Do you have a public facing example I can look at?

@markshust
Copy link
Author

I don't, however if you remove the frontend template (html), and just make a new file with templates.jade with the above content, that would be a good example.

@markshust
Copy link
Author

Referencing https://github.com/jamielob/transitions-demo as example

@jamielob
Copy link
Owner

jamielob commented Aug 3, 2015

I unfortunately don't have time right now to investigate but as a guess I would think it will be related to how I'm attaching _uihooks to the container. Possibly that it's firing before Jade is ready for it.

@mibcadet
Copy link

mibcadet commented Aug 3, 2015

Same situation here, not working:

.transitions-container(style="height:100%")
    +yield

@jamielob
Copy link
Owner

jamielob commented Aug 3, 2015

I can try and take a look if someone puts together a git repo with a reproducing case for me.

@mibcadet
Copy link

mibcadet commented Aug 3, 2015

Maybe next week I will, due to lack of time I have to skip this function at the moment :(

@markshust
Copy link
Author

here you go... i just switched the layout template from transitions.html to transitions.jade -- that does it

https://github.com/markoshust/transitions-demo-jade

@mibcadet
Copy link

mibcadet commented Aug 5, 2015

Seriously you think I have jade template not in .jade file?? ...

EDIT: mymissunderstanding, pardon

@jamielob
Copy link
Owner

jamielob commented Aug 5, 2015

@mibcadet - I think @markoshust was providing me with the example I requested not providing you with an answer.

@mibcadet
Copy link

mibcadet commented Aug 6, 2015

@jamielob You must be right

@jamielob
Copy link
Owner

jamielob commented Aug 6, 2015

@markoshust - thanks for this. It looks like the 'next' property in the insertElement: function(node, next) _uihooks callback is blank when using Jade. I'm looking for a workaround but it looks like it may be a bug with the meteor _uihooks.

@markshust
Copy link
Author

@mibcadet yes sorry, reread my post and i wasn't completely clear. that was an example of jade implemented, not working.

@jamielob jamielob added the bug label Aug 6, 2015
@daveeel
Copy link

daveeel commented Jan 5, 2016

I'm using another package https://atmospherejs.com/ccorcos/transitioner and have similar issue. i.e. The top level .jade template doesn't work but standard html template does. If you take a look at the compiled template, you'll find the code from .jade is much cleaner than that from html template (with some extra newline , non display stuff etc...). Maybe it's too "clean" for transitioner to work ? Anyway it's only the top level template, so I didn't investigate. Just to report here.

@jamielob
Copy link
Owner

jamielob commented Jan 5, 2016

Thanks @daveeel.

@daveeel
Copy link

daveeel commented Jan 5, 2016

Another observation of using https://atmospherejs.com/ccorcos/transitioner with .jade is that sometimes some transition effects will prevent reactive content to render in "to" routes. I'll see if I could isolate them in future. Not sure if this package has similar issue.

I'm looking into this transitioner because of it's inline transition feature missing in other packages. :)

@gantrim
Copy link
Contributor

gantrim commented Feb 20, 2016

Since it wasn't specifically mentioned above, you can still use jade templates for everything besides your layout file. Im doing the following as a temporary workaround.

layout.html:

<template name="layout">  
    <div class="transitions-container" style="height:100%">
        {{> yield}}
    </div>
</template>

home.tpl.jade:

.transitions-content    
        a.home-menu-link(href="{{pathFor 'page2'}}" data-transition-out="slideFadeLeftOut" data-transition-in="slideFadeRightIn") page2     

page2.tpl.jade

.transitions-content
        | page2

@jamielob
Copy link
Owner

Thanks @gantrim - If you get the time to send a PR for the Readme about how to get it working with Jade that would be great.

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

No branches or pull requests

5 participants