-
Notifications
You must be signed in to change notification settings - Fork 374
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
yesod-bin: make yesod devel
watch extra files for changes
#955
Comments
Yup, this is what I did in my |
The reason yesod devel got this incredibly complicated logic was because of the Lucius and Julius files. In those cases, it would be a major burden on developers to have to recompile every time one of them changes. However, it caused lots of confusion for people when variables were added and the recompilation wasn't automatic. I suppose we could consider doing the stupid thing for Hamlet files, I don't feel strongly on the subject. Perhaps some others want to weigh in here? |
I think it's unfortunate that yesod devel doesn't pick up changes in .cassius files typically. I'd like to see it recognize all .hamlet changes. Ideally, it would recognize that something like .cassius shouldn't have to recompile Haskell files or anything, just update the CSS… |
@wolftune I guess this is not as easy as it seems. What about interpolation? If you add something like
how compiler should update Css file without recompilation? |
I don't really mean no recompiling, I guess somehow the whole system should know that only this text area needs to be updated and not redo lots of other math that was already done. I suppose this probably goes into GHC or something beyond Yesod… I don't know, I'm no expert. |
Gosh, I'm not sure why I didn't realize this, but it looks like I can save things in .cassius files and they simply show up when I reload the website without yesod devel even restarting! I'm not sure at one point this breaks, but I feel silly, I think I actually believed that I needed to make yesod devel restart in order to see .cassius changes. I think the real issue is that I hadn't (don't?) trust that I've got the final results for sure until it recompiles, but I can indeed see simple style changes right away… So, at least some of my comments here were mistaken, although some level of file recognition seems to remain per the original ticket… |
@wolftune, my original complaint was about how .hamlet files are handled. It seems like It would work better for me if Although maybe there are people who have a lot of .hamlet files that are often being updated, but are not actually used by any Handlers? It's kind of hard to imagine someone being in this type of scenario. |
Interesting coincidence, I was just researching a different problem and realized that there's a much better solution to the issue here. Instead of trying to guess dependent files, we can just ask GHC via the .hi file, by running |
You can also try using |
@wolftune note that this is not true for |
This is planned for the new yesod devel in the GSoC project, closing in favor of that. |
I am in favour of this, yes. |
yesod devel
doesn't pick up .hamlet files that are not directly referenced from Haskell files. For my personal blog, I create some handlers with Template Haskell. The Template Haskell adds the calls towidgetFile
. The actual Hamlet files I am using are not hard-coded anywhere in my Haskell files.yesod devel
will only force a recompile for changed Hamlet files if it sees they are being used from the Haskell files. Hamlet files added through Template Haskell (like I am doing) do not get noticed byyesod devel
.Is there some way to make
yesod devel
watch extra files for changes (and then re-runcabal build
if it finds any)? I hacked around it in the following commit by hard-coding the files I want to be watched, but it would be nice if there was a better way to do this:cdepillabout@ccdc46a
Is there a reason that
yesod devel
doesn't do the stupid thing and just watch all .hamlet files for changes? In the current project I am working on, there is never a time when I have .hamlet (or .lucius, .julius, etc) files that I don't wantyesod devel
to watch.Do other people have projects where there are many .hamlet files that are not referenced from Haskell files, and where these .hamlet files are frequently changed?
The text was updated successfully, but these errors were encountered: