--
You received this message because you are subscribed to the Google Groups "CS-Script" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cs-script+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Having the custom probing as you mention does help. However, it would be a big productivity boost if CSS supported the alternative filesystemwatcher solution (or any other faster way) out of the box. I was looking through the source and It looks like the dependency checking is quite thorough but... Take a decent amount of time for the average dev to reuse.
Thanks for the explanations! :)
I was hoping I'd convince you to implement the advance approach as filesystemwatcher to avoid having to rewrite my own custom version specific that would be more limited :)
In case you were curious how I was planning to solve:
1. Add filesystemwatcher watcher on all scripts/assembles
2. When change is fired, purge script and all parent scripts upward.
3. Next time scripts are loaded, they won't be in cache and hence forced to compile.
Just my two cent but the advance checking approach would probably be better as default. I would guess most use case scenario don't require super high performance requirements -- hence more accurate dependency check would avoid unecessary questions as to why the default behavior does not cause scripts to reload correctly.
Agree, I was not sold on the default for the caching algorithm neither. I just wanted the HotFix to have the fastest option just out of box and review the defaults again before merging the HotFix with the main stream codebase. And you are right the more conservative probing ("advanced") seems safer.
I was hoping I'd convince you to implement the advance approach as filesystemwatcher to avoid having to rewrite my own custom version specific that would be more limited :)
It is actually easy to implement but I am very skeptical about the use-case for this feature
In case you were curious how I was planning to solve:
1. Add filesystemwatcher watcher on all scripts/assembles
2. When change is fired, purge script and all parent scripts upward.
3. Next time scripts are loaded, they won't be in cache and hence forced to compile.
static void VerifyScriptCache(string script) { IsOutOfDateResolver isOutOfDate = CSScript.CachProbing.Advanced;
string assembly = CSScript.GetCachedScriptPath(script); if (File.Exists(assembly) && isOutOfDate(script, assembly)) File.Delete(assembly); }
You will only need to provide the concurrency and error handling and of course a file system monitoring to trigger the cache verification.
I have prepared for you the simple/prototype to demonstrate the idea https://dl.dropboxusercontent.com/u/2192462/pingmustard/pingmustard.7z
Just be careful with FileSystemWatcher as it is not as practical as it seems. For example VS does not updated source files when you edit them. Instead it keeps your changes in the temp file and when you click "save" it deletes the original file and renames the temporary one. Thus the FileSystemWatched never raises "Update" but "Delete" and "Create" instead.