-
-
Notifications
You must be signed in to change notification settings - Fork 284
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
Improve watch mode to reduce recompilation #366
Conversation
Not 100% ready. Needs some cleaning up and testing. Also, I can't figure out why, but additional builds in watch mode seem to ignore the string extraction. |
3d05e31
to
7945dfd
Compare
It seems some "phantom |
This was the issue. I had a running |
The PR is now ready to be reviewed @a-h Side note: I also modified |
48ddffb
to
df75324
Compare
Waiting on a review 🙏🏾 @a-h |
Apologies. I want to have a good sit down and really understand it. With the holidays, I've just been picking up small stuff. I will get on it though, I'm excited about the change. Think it will be a big improvement to dev performance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, really awesome work, thanks so much for putting this together, and I'm really sorry it took me so long to get to looking at this.
I think there's a few bits to clear up, but it's brilliant.
I've asked for a few changes, and put in a few suggestions. Once that's sorted, I'll merge it, and put together an integration test as per #381 (comment)
Again, thanks so much.
Ready for another review @a-h |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mutex lock/unlock needs to move to the getWatchedStrings function to properly protect against reading and writing the map concurrently since there's a chance of a "concurrent map read and write" error, but other than that, it's awesome.
I'll add the mutex change in a subsequent commit.
Brilliant work, thanks a lot. I think it's worth a blog post to explain the improvement, and how it's a potential game changer for development experience with templ. If you want to write it, go ahead, if not, I will - just let me know. The next thing to deal with is to switch out the very basic "walk the directory every second" with a filesystem watcher implementation. I couldn't get fsnotify to work properly on my Mac, but maybe I was using it wrong. With that in place, the reload time will be incredible... |
Hi @a-h what was the problems you encountered with |
I will write something about this. It's been too long since I wrote a blog post and this definitely deserves one. |
@philippefuentes the issue I had was inconsistent notifications. Sometimes it would work, sometimes not. |
Basically, the watch implementation needs some automated integration tests, including one that can be ran for extended periods to identify issues that crop up over time. |
Implementation for #318 and #340