Hello,

We came across with the situation when we need to use 3d party scripts that MUST NOT be used in header. They were developed for being used in footer only. We found that you put all files into HEADER to reduce amount of aggregated files. We had to comment this out for a while.

We want to propose you to implement this optionally. For instance, there may be a checkbox to control do I want to gather all files in a header or leave scope as it is (header by default).

The change is very simple but may save lots of time to people that uses such javascripts.

Your thoughts?

Comments

pounard’s picture

I'm fine with that. I'd be glad to find a better solution where the header or footer location could be determined with such algorithm (from the more general to the more specific):

The location of JS:

  1. Is per default in the header
  2. May be per default the footer if manually set as-is
  3. May be pragmatically set by the module defining the file in any of those
  4. May be pragmatically set by the module including the file in any of those
  5. May be moved away by any other module (alter) - Not fond of this one

This algorithm would test all these cases from the later to the first and stop at the first one matching.

In any case, this algorithm must be done only once, once done, it must not differ in any case (and must remain the same throught all site). This will ensure aggreation groups will remain the same and cover the full site.

Any ideas? I wrote this really quick I'm not sure of the implications, any help welcome.

Can you describe a bit more your need, and give me examples of libraries with which you need this?

ardas’s picture

Hello,

Thank you for your work on this module. We like it and would like to include in our Drupal built.

We will send you a patch quite soon and then we can discuss these ideas...

As for your logic I don't think it should be too complicated. Lets think what exactly will give us valuable performance improvement. As I see we have 4 things:
1. Minification
2. More advanced aggregating (no groups just put everything in one file)
3. Aggregating all files regardless of which of them are needed on current page (does this help actually?)
4. Bypassing aggregation process (we didn't try it yet)

Meanwhile, we found a little issue: Since you gather all JS files even if not all are needed on this page (to get one big file) some files go without scope parameter and here a notice is thrown. For files without scope we set HEADER to remove this PHP notice. This will be included into our patch.

Please find me in Skype (my skype id: dmitry.kresin) and we can discuss everything faster.

Thanks.

pounard’s picture

Do you have a jabber (can be gtalk) account?

ardas’s picture

Sure.

pounard’s picture

I copied your email addres, I advise you to remove it from the post if you don't want it to be publicly visible. Next time send it via my the contact form :)

ardas’s picture

Agree.
Thanks I will :)

pounard’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

This module is dead.