Bundles should be theme specific

malc_b - March 5, 2008 - 17:49
Project:Support File Cache
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:postponed
Description

Bundles should be theme specific so their contents can be tailored to each theme, especially where users can change theme. For the situation where admin uses a different theme to the site it is also an annoyance but at least not a public one.

#1

kkaefer - March 9, 2008 - 23:39

The theme issue is on my to-do list. However, I don't want to make bundles theme-specific but rather just warn the user when she's about to add a file located in a theme directory to a bundle with non-theme files. Do you think that this is a good idea?

#2

malc_b - March 13, 2008 - 13:52

There are 2 ways to go about this. You can have, as I have at the moment as it is the only way that works, a set of bundles, so: common_to_all, theme_A, theme_B, theme_A_edit_mode, etc. The risk is that you start to lose the benefit of bundling the files. Taken to extreme you'd end up with bundles of 1.

The alternative is super bundles so theme_A_all == common_to_all + theme_A, that has just saved 1 file download which is after all the purpose of this module.

However, 1 file is nothing so not a big issue. What may be more of a problem is trying to work out what bundles are loaded for what. Making the bundles theme specific makes tracking down problems easier I think and you can limit using bundles to the core site.

Another alternative would be to have a best fit algorithm, say only add a bundle if ALL files are called for, or add the bundle that has the least number of unused files (you could do both with same code although ==0 is easiest). That would allow super bundles.

A log entry saying what was replaced would be useful to track problems and check bundles are optimum.

I think it works ok as is if adding theme specific is complex. If theme specific is simple then it is a quick way to overcome the issue with different themes.

Whatever the module needs more documentation:- how to find what files to bundle, what files to include (e.g. common, theme_A_only, theme_B_only etc.); plus how the module works, i.e. will only add a bundle which contains 1 or more files called for.

#3

kkaefer - February 20, 2009 - 20:37
Status:active» postponed

Users are now warned when they add theme files to an otherwise non-theme file or the other way around.

 
 

Drupal is a registered trademark of Dries Buytaert.