Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
fubhy CreditAttribution: fubhy commentedI 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?