Ticket #2528706 (closed defect)

Reporter


Kaven Yan
Opened: 03/21/10
Last modified: 09/7/10
Status: closed
Type: defect
Resolution: fixed

Owner


Adam Moore
Target Release: 3.2.0
Priority: P5 (trivial)
Summary: Universal Console is disable if not use event-custom-base module
Description:

Please see http://dancewithnet.com/lab/yui/bug/3.1.0pr1/console/universal-console.html

1.Create a universal console and use it in 3 YUI instance. eg:


<script src="http://yui.yahooapis.com/3.1.0pr1/build/yui/yui-min.js"></script>
<script>
//instance 1
YUI().use('console',function(Y){
(new Y.Console({
logSource : Y.Global
})).render()
Y.Node.one('body').addClass('yui3-skin-sam');
Y.log('It is successful to create a univarsal console.','info','YUI instance 1');
});
//instance 2
YUI().use('event-custom-base',function(Y){
Y.log('It appears in Log Console.','info','YUI instance 2');
});
//instance 3
YUI().use(function(Y){
Y.log('It appears in Log Console too.','info','YUI instance 3');
});
</script>

2.Run it, you can't get info of YUI instance 3 in the console.

3.Because YUI instance 3 doesn't use event-custom-base module, so Y.fire is undefined.

4.In order to use a universal console, I must use event-custom-base module. It's inconvenient.

Type: defect Observed in Version: 3.0.0
Component: YUI Global Object Severity: S5 (trivial)
Assigned To: Adam Moore Target Release: 3.2.0
Location: Library Code Priority: P5 (trivial)
Tags: console event-custom-base Relates To:
Browsers: N/A
URL: http://dancewithnet.com/lab/yui/bug/3.1.0pr1/console/universal-console.html
Test Information:

Change History

Luke Smith

YUI Contributor

Posted: 03/22/10
  • priority changed to P3 (normal)
  • status changed from new to infoneeded

Just about everything in the library requires event-custom-base. Can you give a real world use case where this is inconvenient?

Kaven Yan

Posted: 03/23/10
  • status changed from infoneeded to assigned

Yes, in my real world,
I create a very simple demo for my partners, it's only demo so that it don't require any module but yui, it's indeed YUI instance 3 above.
It's indeed uncommon too.

Luke Smith

YUI Contributor

Posted: 04/19/10
  • component changed from Console to YUI Global Object
  • owner changed from Luke Smith to Adam Moore
  • priority changed from P3 (normal) to P5 (trivial)
  • severity changed from S3 (normal) to S5 (trivial)
  • version changed from 3.1.0 PR1 to 3.0.0

Adam,

Can you take this? Do you think it would be reasonable to test in yui-log for YUI.Env.globalEvents and fire from there if Y.fire is not present?

Adam Moore

YUI Contributor

Posted: 04/20/10
  • location changed to Library Code
  • milestone changed to 3.2.0
  • status changed from assigned to accepted

Yes, this is a a simple change that seems worth it.

YUI 3.1.0 supports a logFn configuration parameter. The OP could define this in the global YUI_config object to work around the issue.

Adam Moore

YUI Contributor

Posted: 07/19/10
  • status changed from accepted to checkedin

Adam Moore

YUI Contributor

Posted: 07/20/10
  • resolution changed to fixed

log will fire the global log event if the instance doesn't have the
event system but the global does. [fixes #2528706].
View Commit:

George

YUI Developer

Posted: 09/7/10
  • status changed from checkedin to closed