Because all script dependencies are/should be declared, the 'weight' key in library files declaration is now useless.

State of the patch:
Everything seems to be working
Was a problem with dependencies in contextual module

Needs testing :)

#4 core-js-lib-diet-1945262-4.patch11.76 KBnod_
PASSED: [[SimpleTest]]: [MySQL] 56,760 pass(es).
[ View ]
core-js-lib-diet.patch8.61 KBnod_
PASSED: [[SimpleTest]]: [MySQL] 53,338 pass(es).
[ View ]


Issue tags:+JavaScript clean-up

forgot tags

Yup.... Dependencies should determine asset order, not "weight".

Status:Needs review» Needs work

This broke at least two tricky edge cases:

  1. contextual.toolbar.js wants to hide its pencil icon in the toolbar when the overlay is open. Including when the URL fragment indicates that the overlay should open, meaning that the drupalOverlayOpen event is triggered and Drupal.behaviors.contextualToolbar.attach() must already have been executed. The removal of the weights broke that. Note that we may not introduce a dependency here because contextual.toolbar.js does not depend on overlay-parent.js, but instead it listens to it in case it exists.
  2. tour.js adjusts its tour icon in the toolbar (and the corresponding tour tips) when the overlay is open. Analogous additional info here.

I think the only way to solve this is by setting up the listener outside of the Drupal behaviors, so that it runs earlier. I hope I'm wrong :)

Status:Needs work» Needs review
new11.76 KB
PASSED: [[SimpleTest]]: [MySQL] 56,760 pass(es).
[ View ]


Looks like contextual links work. Tour is still broken.

Title:hook_library_info() diethook_library_info() diet (or: get rid of weights in favor of dependencies)

I had no idea what this issue was about — it's witty, but this is hopefully a bit more clear :)

Title:hook_library_info() diet (or: get rid of weights in favor of dependencies)hook_library_info() diet, get rid of weights in favor of dependencies

You're right, wasn't clean. Little small adjustment to make it easier on the eyes.

Issue tags:+front-end performance

This is blocked on a mechanism that uses a DAG (Directed Acyclic Graph) to determine the order of the assets. We can then work around the problem in #3 by having the ability to mark a library to be loaded before another one, and having the DAG take that into account.

(As per a call with sdboyer and a discussion with nod_.)

Related: #1014086-114: Consider using imagecache style generation of CSS and JS aggregates.

Let's revisit this — I think we were able to remove some of the weights in the libraries.yml patch already, but there are certainly lots of remaining instances.