[ 3 posts ]

aaditya sood

  • Username: aaditya
  • Joined: Tue Mar 23, 2010 1:55 am
  • Posts: 15
  • Location: Bangalore
  • Twitter: aaditya
  • GitHub: aadis
  • Gists: aadis
  • IRC: aadis
  • Offline
  • Profile

loader giving inconsistent result with combine:true & groups

Post Posted: Sat Jul 30, 2011 6:30 am
+0-
I'm trying to use yui3, gallery and my custom modules (all under the name epsilon-) locally. I've also setup the PHP combo loader to server 3.3.0pr3, latest gallery build and my own custom modules.


My Config is:

YUI config

Click here to see the revision history on this Gist.

With this config the YUI3 modules are loaded correctly, however the requires of gallery- and epsilon- modules are not loaded leading to init errors.

Any help/pointers would be appreciated.

aaditya sood

  • Username: aaditya
  • Joined: Tue Mar 23, 2010 1:55 am
  • Posts: 15
  • Location: Bangalore
  • Twitter: aaditya
  • GitHub: aadis
  • Gists: aadis
  • IRC: aadis
  • Offline
  • Profile

Re: loader giving inconsistent result with combine:true & gr

Post Posted: Mon Aug 01, 2011 8:18 am
+0-
I did some more debugging/tracing: using the debug versions (and a liberal sprinkling of console.debugs) and comparing the combine:true logs with the combine:false logs.

So far it seems that 2 separate instances of YUI get loaded. The initial one is loaded by the include of yui.js. The second fresh one is instantiated from the combo file (which includes yui-base.js. This second instance does not have access to the loader created by the first yui.js.

Thus when gallery-dispatcher is loaded, it cannot get the loader instance to add the requires to. AFAIK the relevant portion is (in yui.js):

Code:
        for (i in instances) {
            console.info("T1",i);
            if (instances.hasOwnProperty(i)) {
                console.info("T2");
                loader = instances[i].Env._loader;
                if (loader) {
                    console.warn("Loader Found: T3",instances[i].Env);
                    if (!loader.moduleInfo[name]) {
                        console.info("T4");
                        loader.addModule(details, name);
                    }
                } else {
                    console.warn("No loader!:",instances[i].Env);
                }
            }
        }

aaditya sood

  • Username: aaditya
  • Joined: Tue Mar 23, 2010 1:55 am
  • Posts: 15
  • Location: Bangalore
  • Twitter: aaditya
  • GitHub: aadis
  • Gists: aadis
  • IRC: aadis
  • Offline
  • Profile
Tags:

Re: loader giving inconsistent result with combine:true & gr

Post Posted: Mon Aug 01, 2011 9:02 am
+0-
Another data point.

Currently the HTTP load requests are:

    * /static/vendor/lib/3.3.0pr3/build/yui/yui-debug.js
    * /static/vendor/lib/3.3.0pr3/build/loader/loader-debug.js
    * /combo.php?3.3.0pr3/build/dump/dump-debug.js
    * /static/vendor/lib/gallery/build/gallery-dispatcher/gallery-dispatcher-debug.js

The combo call for dump-debug.js also pulls in yui-base-debug.js which initializes the new YU instance (as noted in my previous post).

If I manually edit the combo loader metaconfig (config_3.3.0pr3.php) to remove yui-base from the requires list of dump everything works!

I'm not sure if this is the right fix, or I'm missing something in loader and yui config.

regards
  [ 3 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum