I've been busy getting advagg working with just about all 3rd party CSS/JS aggregation tweak modules. Middle of next week I hope to have CSS Embedded Images working with only hooks, because preprocess hooks do not work in this case #1078060: CSS Embedded Images - Add in support for advagg's hooks. I already have advagg and LABjs working together. My question is if we where to do this without preprocess_page hacks hooks what would LABjs need to make it happen?

Comments

jcisio’s picture

Hi mikeytown2,

Quite bad timing here, I'm busy this week and the next two, I can't dig further in your links. Thus I don't really understand your question.
- LABjs without preprocess_page: no, I don't any other mechanism coming in my mind.
- Why the question, when here every module already has its own preprocess page and move others' up and down to work with all (ok, I haven't had a chance to look into advagg and css_emimage, so I don't get that issue).

mikeytown2’s picture

advagg doesn't use the files/js directory for aggregation in short. Most modules make that assumption. Also there is a TON of duplicate code being used to get aggregation to do what we want. It's also inefficient because a lot of them will rebuild the aggregate at least twice if not more. In short core's aggregation is broken in my opinion so advagg is a replacement for it.

For LABjs I was thinking of having the ability to swap out the function that generates the script tags. I'll copy the pattern I use for CSS as that has the ability to use different markup in order to support Unlimited CSS.

mikeytown2’s picture

created a variable for using a different rendering function for creating the script tags.

  $conf['advagg_js_render_function'] = 'labjs_render';

then copy what is done in advagg_js_builder() but have it output different markup. That should eliminate the $variables['scripts'] & preg_match oddness.

_labjs_rewrite_js still needed for $variables['content'] & $variables['closure']; but this brings us one step closer to a better API. Also means one can use advagg to add JS/CSS to a JSON request.

mikeytown2’s picture

Status: Active » Closed (duplicate)

ended up using this function to fix an issue with PHP's preg and long strings.
#1087056: LABjs - Drupal.behaviors/Drupal.settings issue