mjmlio / mjml

MJML: the only framework that makes responsive-email easy
https://mjml.io
MIT License
17.08k stars 960 forks source link

--watch doesn't re-render when mj-included mjml changes #333

Closed fzembow closed 7 years ago

fzembow commented 8 years ago

STEPS

ACTUAL

EXPECTED

NOTE

MJML is fantastic by the way, especially when combining mj-include with mj-attributes, now we have something close to sharable styles for a huge library of emails :)

iRyusa commented 8 years ago

Hi !

Thanks for reporting it @fzembow ! I'll take a look if we can do a quick fix about this

thepuzzlemaster commented 8 years ago

Could this be as simple as parsing through the input file that gets passed to the watch command and checking for any mj-include tags, and if so, add additional watches for those files, which trigger a render on the original input?

Just started using mjml today, so I'm super unfamiliar with things, but I ran into this problem as I'm using includes for global elements.

iRyusa commented 8 years ago

That's what I tried, but the main issue is, if you'll add some mj include during the recompile you have to check those new files too.

You have to check everytime if there's some new include, or include that doesn't exist anymore and the watch API from nodeJS isn't really designed with that in mind

thepuzzlemaster commented 8 years ago

Hmmmm... Gotcha. That makes sense. The trade-off between getting something up there that helps, but is not the right long-term solution, vs waiting for the perfect solution is real. I can understand why it's not an easy fix. Alright, hopefully I can have some time to take a deeper look at some point.

iRyusa commented 7 years ago

Hi @thepuzzlemaster @fzembow

Quick update here, we're about to release this in 3.2 ! A beta should be released this week, so feel free to give a try :)

ngarnier commented 7 years ago

Released in 3.2.0 🎉