-
-
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
Feature/issue 117 #151
base: master
Are you sure you want to change the base?
Feature/issue 117 #151
Conversation
It works! :) Mainly, I would like to change the API of the ExternalAssets class to match that of Bundle more closely. This makes sense on a number of levels, I think. First, there will be a need to have multiple external asset definitions. For example, different application modules contributing stuff. To that end, if Second, the file specification of ExternalAssets should match that of the Bundle class. There is probably some potential for code sharing here, i.e. moving code like Bundle.resolve_contents() to a shared "Container" class. Certainly, it would be necessary for ExternalAssets to also call into the _normalize_source_path hooks so that third party extensions like Flask-Assets can support references within their modules. Also, I would suggest that we rename webassets.externalassets to just webassets.external. It's just a bit leaner. |
I've started to change the API for ExternalAssets to be more like Bundle, so it can now be registered as if it were just another bundle. Still some more to do there, though. I had to change the cssrewrite filter (which is one of the key parts of this to me, in terms of what I need it for at least...) so that the bundle being built can get knowledge of the ExternalAssets object required. To do this I added another keyword argument for the filter, As before, all comments welcomed! |
I thought that the cssrewrite filter would just loop through the bundles known to the environment, filter out the ExternalAssets instances, and then work with all of them. That is, the first ExternalAssets instance that finds the file in question is used. So I might be able to do:
And That means that in larger applications, different parts can add their own external assets. Also, it would potentially allow for things like filters (e.g. thumbnail creation) to be added in the future, which may only be needed on some files. |
I've merged your branch against the current master (https://github.com/miracle2k/webassets/tree/feature/issue-117); In master, significant changes have been made since when you branched off, so I would encourage you to work with the latest version. |
I'm trying out this fork and it seems to work really well on initial trial. I've only used a simple bundle ( I assume at this point we're looking at needing tests (plus the fixes found in developing them), docs and a few scraps of time to work on them? :) |
So much code write, so little time! I'll admit to being confused by the |
no preference at all really, whatever works for you. |
…eturned when a single was expected
…s causes it to often fail.
Feature/issue 117
Minimal starter docs
Guys, this seems to be coming along quite nicely. I need this now myself, so I'll have a closer look and hopefully we can get it finalized and merged soon. |
That would be great. Apologies for the lack of activity on this - started a new job, so time has been limited! |
I think I fixed this for myself in my pyramid_webassets fork 0 simply by making the resolver's As an aside, I leverage this in my app now to version assets referenced in the CSS 1. Is this something you'd like to add to the CSSRewrite filter (or add upstream as its own filter)? |
I realize everyone (including myself) is quite busy, but I was wondering about the general sentiment on this branch. Obviously it doesn't merge cleanly into master right now. On top of that, is it more a matter of design decisions or just time to polish/test? I'd like to help if I can. It's a shame to see such useful code languishing :) |
I would really appreciate if anyone could respond to my comment. I managed to get versioned images just fine. |
Hi @tilgovi sorry for the lack of response! As you can see this feature hasn't had a lot of time spent on it recently, sadly. Personally I would definitely want to add versioning for assets referenced in the CSS, but having not looked at the code for a while it's hard for me to say whether it should be in CSSRewrite or its own filter. @tgecho I think there are some design decisions to be made still, and certainly a lot of polishing and testing. Also I would think it's now a fair way behind master, so much work remains to be done. Unfortunately I have not had any time to work on this due to changing jobs and using a different system for static assets, but obviously feel free to dive in! Ed |
First pass at versioned images as described in #117 - thoughts and comments very welcome