monokrome / jaded-brunch

Jade for brunch, supporting both dynamic and static loading jade.
MIT License
23 stars 10 forks source link

watch doesn't take included jade files into account #10

Open rriemann opened 10 years ago

rriemann commented 10 years ago

I included some jade files in my index.static.jade. if the included file changes, nothing happened. i have to restart brunch.

For the official jade plugin there is a patch. Maybe you can apply it to yours as well?

https://github.com/brunch/jade-brunch/pull/6/files

Best, Robert

monokrome commented 10 years ago

@rriemann Thanks for posting this issue!

Does this actually work in the jade plugin? Jaded uses es128/progeny to tell brunch which files are included from where. In my previous testing, it seemed that Brunch just ignored the output even though it is provided properly.

monokrome commented 9 years ago

@rriemann Sorry for the delay, I was waiting on a response to the previous comment and hadn't looked here in a while. I think that this issue is specific to files that are included from other files? I will take a look sometime this weekend or earlier if so!

rriemann commented 9 years ago

Thank you! :+1:

monokrome commented 9 years ago

@rriemann Hey, not sure if you missed my question there but just trying to make sure that I understand the issue fully. Is this issue specifically regarding when a jade file includes another file? or do you have an example that would cause it to occur?

rriemann commented 9 years ago

Yes, it's about jade dependencies created by inclusion.

My index.static.jade:

  body(data-ng-controller='BodyController', data-ng-cloak='', data-ng-class='body_class()')
    #ui-wrapper(data-ui-view='', data-ng-class='body_class()')
    script(type='text/javascript', src='/js/app.js')
    script(type='text/ng-template', id='login.html')
      include ./partials/login.jade
    script(type='text/ng-template', id='dashboard.html')
      include ./partials/dashboard.jade

My attempt for a workaround:

exports.config =
  files:
    templates:
      joinTo: 'javascripts/app.js'
      dependOn:
        'app/index.static.jade': /^app(\/|\\)partials/
monokrome commented 9 years ago

@rriemann Did your workaround solve the problem (at least temporarily)?

rriemann commented 9 years ago

There was never a problem to build the final project. Only the 'watch' was the issue. My workaround triggered a refresh, yes. However, I do not know if I broke something else (a feature I have not used).

My team decided to refrain from the use of brunch in the meanwhile.

michaek commented 9 years ago

I've also run into this - making changes to the dependent files (those that would be identified by progeny) doesn't result in a build. It seems like the filesystem watch doesn't include the dependent files.

monokrome commented 9 years ago

@rriemann @michaek I feel like there is an issue with Brunch if I am identifying the proper files to it but they aren't being updated. I'm wondering if @paulmillr has run into this with other plugins on Brunch's side or if I should look into it a bit more?

paulmillr commented 9 years ago

No idea what's that. @es128 ?

es128 commented 9 years ago

https://github.com/brunch/brunch/issues/916#issuecomment-73981647

Moral of the story is that brunch will eventually need to get better at handling static html and other such cases that currently require workarounds.

In the meantime, it may be possible for jaded-brunch to fix this with further workarounds by tweaking how it responds to compiling the static files to return to brunch a blank or insignificant javascript output for the template compilation (in order to not short-circuit the regular pipeline) while still retaining control over writing the html file.

monokrome commented 9 years ago

Hey, @dnalot. You just referenced this issue from within itself. I'm guessing that you meant something else there?

texastoland commented 9 years ago

Thanks for catching that; I was trying to connect the issue with brunch/auto-reload-brunch#12.

JoshWillik commented 8 years ago

Any movement on this? The linked issue seems to say that the problem lies with jaded-brunch

monokrome commented 8 years ago

@JoshWillik The linked issue doesn't say that the problem is with jaded brunch as much as it says there is a hack (which produces unwanted code) to get it to work until the problem is solved in the other issue. I'll work on a fix, but this is still an issue in brunch.

monokrome commented 8 years ago

@JoshWillik @es128 Unless you know off hand, I'm going to see if this is fixed in the latest brunch version. If it hasn't been fixed (I'm guessing not since https://github.com/brunch/brunch/issues/916 is still open) then I'm going to see if I can come up with a hack to get around it, but hopefully brunch is prioritizing this soon?

Kind of funny to see that every build system runs into this same problem. WebPack, Brunch, SystemJS...

JoshWillik commented 8 years ago

I don't know off hand.

I ended up just putting a small gulp script together to get the job done. It works pretty well for my use case.

monokrome commented 8 years ago

@JoshWillik If your script takes care of the dependencies, have you open sourced it by any chance? I'd like to know what you used to solve the problem.

JoshWillik commented 8 years ago

@monokrome I haven't open sourced the whole project yet. (I'm pretty sure I have API keys buried somewhere in the git history, and I wouldn't want someone to find them).

The bits needed to do the static site rendering are here.

I ended up using nunchucks instead of jade for the project, but I'm hoping you should find it pretty easy to adapt it to jade.

monokrome commented 8 years ago

@rriemann Does this look to be fixed in the latest version?

DoumanAsh commented 8 years ago

@monokrome Just in case you're still wondering it is not fixed yet.