-
Notifications
You must be signed in to change notification settings - Fork 26
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
Only watch what we need to #25
Comments
This would be straightforward for HTML files. For all other files, there's IMO two options:
|
I think the first one we can do now and could open another issue for a future improvement where we'd do the other one. It's a minor thing and wouldn't affect performances (apart from extreme cases). |
It's not only about performance. One could be working on different HTML files, have them open in different browser windows that he watches at the same time (e.g. both on second screen). He then changes a file that's only used in one of the HTML files, but both update -- this might irritate, since one then usually assumes that the change actually affected both views. But I agree, for first announcement doing it for HTML files is enough. Gumbo would provide a major piece of the final solution; we could then just traverse the tree and look only at tags that may reference files. |
I think that Gumbo.jl would not be enough, because CSS and ES6 can import recursively, so you would also need parsers for those, which is probably beyond the scope If the cost of file watching becomes a concern, I would go for #124 :) |
This is not urgent. I'm just thinking that at the moment, if we trigger lots of requests, lots of files will be watched for changes. This makes sense if all the requests come from new tabs. But otherwise doesn't (e.g. if it's the same tab asking different things we should only really track the file that is currently being watched).
Watching files is very cheap though so not a big deal and even in the case of a huge website, we'd basically have to do hundreds of thousands of requests and modify all these files for it to maybe be a bottleneck.
Suggestion: a doable intermediate step which would feel cleaner is to stop watching files for which there is no associated viewer.
The text was updated successfully, but these errors were encountered: