Le lundi 23 juillet 2018 18:12:32 UTC+2, Florian Apolloner a écrit : > > Hi Claude, > > a few things after a quick glance at it. Overall the feature seems rather > simple and I do not see any reason why this would have to be in core from > the start; ie it could easily evolve as a 3rd party app. >
I purposely kept minimal functionality to start with. The idea is to have a minimal common structure in core, so as 3rd party apps can build upon that minimal structure and add more functionality. e.g. more Asset subclasses can be created to customize behavior. > I am not that much into frontend dev, but from my experience a few things > popped up rather quickly: > > * I generally do not load all js/css in bulk, but rather only the > essential stuff in <head> and the rest before the <body> ends. (or even > just selecting files by type; css vs js etc…) > I think that once you have an asset list, you can program the logic specific to your application. The site_static template tag could be considered mainly as an implementation example. > * The app level seems to be a rather coarse grained separation, I could > imagine people wanting more control over it without generating more apps > for separation. > Once again, one can program a more specific logic by Asset subclasses in the app config assets. A JS() subclass could accept a 'section' parameter which could then be used to segment asset rendering. > * How would support for subressource integrity etc look like; integration > with the storage system would be interesting here > I think this is typically something that should be trivial to implement after this patch is in core. It might be as simple as adding an appropriate kwarg to the Asset() class. > * Any thoughts on asset pipelines? > Sure, the idea is to put a base structure in place to support such functionalities at a later stage (in core or as 3rd party like django-compressor). Thanks for your input! On Monday, July 23, 2018 at 5:36:05 PM UTC+2, Claude Paroz wrote: > > Hi, > > I just created a new feature request [1] to be able to define static > files per application, including a POC patch [2]. > > [1] https://code.djangoproject.com/ticket/29586 > [2] https://github.com/django/django/pull/10218 > > Feel free to discuss it here for general discussion on the feature > utility, or comment on the ticket or on the pull request for > implementation details. > > Cheers, > > Claude > -- > www.2xlibre.net > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/8601fa06-0b66-487d-8d76-165f8f334f65%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.