Since #865536: drupal_add_js() is missing the 'browsers' option got in, We now have a lot of similar code between drupal_get_js and drupal_get_css which we should consolidate.

Specifically drupal_pre_render_scripts, drupal_pre_render_styles, drupal_group_js, drupal_group_css, drupal_aggregate_js, drupal_aggregate_css.

These 6 functions can probably be combine into 3.

Comments

fubhy’s picture

Status: Active » Closed (won't fix)

I was thinking the same initially, but after looking at the code more carefully and actually trying to combine these 6 functions I figured that it would require quite a bunch of conditional statements and thereby make it overly complex (and hard to read). For example the aggregation groups are built differently (no media queries for js, inline js doesn't get preprocessed in the case of js, js has settings while css doesn't, etc. ...

I think it is fine the way it is.

Do you mind if I close this?