-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add builds folder for monitoring #13
Conversation
The only downside to adding this path instead of replacing is we get duplicate reload requests if say,
With these gems, we probably want just the Any ideas on how we could improve that? @jorgemanrubia |
Just added this to my local app and it works decently right out of the box w/ We "solved" this in Because of how tw filters rules by looking at which ones your templates use, you need to wait for it to build before updating for both view and stylesheet changes. |
Fwiw, this works just fine: config.hotwire.spark.css_paths = ["app/assets/builds", "app/views", "app/components"] It fires 3 update events when you update templates but it works just fine. |
@excid3 thanks for working on this. I'd leave the stimulus paths untouched here. As you say, supporting jsbundling will require a more dedicated effort. For CSS bundling, instead of adding paths, would it be enough to just monitor the builds folder only? config.hotwire.spark.css_paths = %w[ app/assets/builds ] # not appending, replacing! That should remove the duplicated signals. Also, with this approach, it doesn't make sense to reload individual stylesheets, you only care about reloading the built CSS, right? I haven't looked into this path properly yet, so maybe I'm missing something. Here I'm happy with an approach where the engine detects that "css bundling" is used and configures proper defaults here. |
Thanks for the insight @mikker. We'll probably need to add some kind of debouncing too at some point. The thing is that it needs to be more fine-grained:
|
57df5da
to
25da29a
Compare
Considering only Tailwind (and
Both could be made into 1 update by debouncing but I can't come up with a good argument for why 2 updates per change is bad enough to make things more complex |
I pushed up a new version that just checks for the existence of that folder. cssbundling and tailwindcss-rails both create that directory and possibly other gems, so this would be the most flexible. That said, the |
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.
Thanks @excid3. That looks like a good heuristic. Let's see...
This adds
app/assets/builds
for monitoring.Closes #11