On 5/27/07, Jeremy Bowers <[EMAIL PROTECTED]> wrote: > > Russell Keith-Magee wrote: > > <link ...css link 1.../> > > <link ...css link 2.../> > > <link ...css link 3.../> > > <link ...js link 1.../> > > <link ...js link 2.../> > > <link ...js link 3.../> > > > > This is a bad thing. Requests are extremely expensive and this is > encouraging scenarios where you end up with 30, 40, maybe more little > CSS and JS files. I'd never deploy this; I try to never deploy with more > than one of each. I generally fail and end up with two of each for > technical reasons, but certainly not two files per widget type.
The example was mostly to point out that multiple files _could_be returned, and that the resultant output is the union of all requirements of all widgets. It isn't intended to encourage the proliferation of CSS and JS files. My use case is this: You have a form that uses three widgets that, in turn, each require SuperWidgetToolkit.css. The template for the page using the form needs to have an easy way to identify that SuperWidgetToolkit.css is required for the page, and to make sure it is included once (and only once). To my mind, this proposal should _reduce_ the number of CSS/JS files that are included, because it will prevent accidental multiple inclusions, and if you remove the last calendar widget on a page, then DateTimeShortcuts.js will no longer be included on the page. > Is there any way to make it easier to bundle everything into one CSS > file and one JS file than to end up with this? If you have a specific proposal on how to bundle CSS files together in the way you describe, feel free to suggest it. This proposal isn't intended to address the issue of how you compose your CSS or your Javascript. If you want to use less CSS files, you can. And if you want to ignore form.media(), and continue manually inserting your media <link> statements, you're free to do that too. Yours, Russ Magee %-) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---
