-
-
Notifications
You must be signed in to change notification settings - Fork 260
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
Allow filters to provide paths for "depends" #240
base: master
Are you sure you want to change the base?
Conversation
Only having this work "after" a filter has run is not good enough; that would means it work sometimes, and then sometimes not (e.g. right after a dev server restart); it would be confusing. There really needs to be a way for the filter to parse the dependencies at the time when they are needed, which is before the build. I'm thinking a filter could have a I also have to say that I'm still unhappy with the fact that this is necessary in the first place. I'd be curious to find out who other asset compilers handle it. |
In my case (i have custom filter for compass) after filter was run i can list files which were used - which can be: fonts, images, other scc’s. If there will be parser for getting dependencies it would have to read compass mixins too (cause you could write some foreach inside to include sprites/fonts/etc). What if filter deps could be cached? When new file is created it will be compiled & cached in some way (i don’t really know how it works now) and so would deps, so after restart deps can be read from cache and later eventually updated. If it is possible i will give it a try and see how it turns out :) Don't know if anything changed but in AsseticBundle for Symfony2 the fix was: when in dev - make compiler run every request ;) |
I've added caching for filter deps + deps recalculation after bundle is compiled. @miracle2k - when doing above i found issue with hash in python>=3.3 - since hash'ing is used for creating keys for cache files, in newer version hash() return value is randomized per process - so it will change every time process is restarted. I'll try to use some hashlib function so it'll be constant again. |
i've found out that in Assetic problem is now resolved by adding |
make pyScss filter dependencies/import aware so it can be recompiled when child is changed
I've updated pyscss filter to support functionality from this PR. Currently deps are cached between app reloads so we have consistent state.
|
aka automatic dependency detection.. by filters.
Not sure if it is the best way to bite it but looks easy and problem free (?).
Problem is discussed in #186
In this implementation if filter at any given time knows about existence of other deps (eg. after compass sources compilation or before when manually parsing files) it should just set depends property.