[ 4 posts ]

robdavis967

  • Joined: Wed Sep 22, 2010 4:50 am
  • Posts: 4
  • Offline
  • Profile

problem with code in a wrapped call not being executed

Post Posted: Mon Oct 25, 2010 11:46 am
+0-
I have an odd bug using the wrapper. Maybe 1 out of ever 10 times or so the code inside my function does not get executed. See the alerts in the following code to see what I mean. It's difficult to reproduce so i haven't had much luck tracking it down. I don't get any javascript errors when it happens and wrapping it in a try catch does not catch any errors. I'm out of ideas as to why this would occassionally not work.


YAHOO_config = {
base: '/tmp/javascript/yui/build/',
comboBase: '',
combine: false

};
var overlayWrapper;

YUI(
{
base: '/tmp/javascript/yui3/build/',
modules:
{
'gallery-yui2':
{
path: 'gallery-yui2/gallery-yui2.js',
requires:
[
'node-base'
,'get','async-queue'
],
optional:
[
],
supersedes:
[
]
}
}
}).use
(
'base',
'node',
'event',
'event-custom',
'event-key',
'gallery-yui2',
'overlay',

function(Y)
{
alert("I always see this alert");
Y.yui2({base: '/tmp/javascript/yui/build/'}).use("button", function ()
{

alert("sometimes I don't see this alert");

... code removed for brevity ...

Y.on('available', searchFunctions._init, '#mypanel');


}); //yui2.use
}
); //YUI.use

Caridy Patino

YUI Contributor

  • Username: caridy
  • Joined: Mon Dec 08, 2008 5:40 pm
  • Posts: 491
  • Location: Miami, FL
  • Twitter: caridy
  • GitHub: caridy
  • Gists: caridy
  • IRC: caridy
  • YUI Developer
  • Offline
  • Profile

Re: problem with code in a wrapped call not being executed

Post Posted: Mon Oct 25, 2010 2:13 pm
+0-
Hey,

This component is deprecated, we have a built-in solution now as part of the loader. You don't need to use the wrapper anymore. Just use this:

Code:
YUI().use('yui2-button', function (y) { 
  var YAHOO = Y.YUI2;
  /* do your magic here */ 
});


I'm waiting for the next release of the gallery website to be able to mark it as deprecated.

You can get more info here:
http://www.yuiblog.com/blog/2010/03/11/ ... ming-soon/

Best Regards,
Caridy

robdavis967

  • Joined: Wed Sep 22, 2010 4:50 am
  • Posts: 4
  • Offline
  • Profile

Re: problem with code in a wrapped call not being executed

Post Posted: Tue Oct 26, 2010 4:01 am
+0-
Thanks I appreciate that. Do you think switching to the other way will solve this problem though? It's going to be a tough sell to convince them to allow me to make that significant a change right now unless I can be pretty sure that it will permanently resolve the problem. It's hard to be sure since it doesn't reproduce 100% of the time.

Caridy Patino

YUI Contributor

  • Username: caridy
  • Joined: Mon Dec 08, 2008 5:40 pm
  • Posts: 491
  • Location: Miami, FL
  • Twitter: caridy
  • GitHub: caridy
  • Gists: caridy
  • IRC: caridy
  • YUI Developer
  • Offline
  • Profile

Re: problem with code in a wrapped call not being executed

Post Posted: Tue Oct 26, 2010 7:07 am
+0-
Yes, this migration is a MUST for everybody. The built-in solution is way more stable, and it's being maintained by YUI Core Team. You can be 99.9% sure that it will solve the problem, if the problem is related with the loading process.

Best Regards,
Caridy
  [ 4 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
cron