with dojo 1.0.2 I can debug code in Firebug without much troubles.
After upgrading to dojo 1.1.0 the required modules are no longer
available in the 'Script' tab, in place of them one finds:
eval -> undefineddojo._scopeArgs = [undefined];
I believe you should be able to replicate this behaviour with a dojo
test page, for example:
http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/test_Calendar.html
I've tried with Firebug 1.1.0b10, 1.1.0b12 and last 1.2 alpha.
Any hint about what is happening and possibly how to solve the issue?
Thanks in advance,
Nicola
OK, doing that I've discovered that the issue is specific to the deploy version.
At this address:
http://superfluo.org/firebug-and-dojo-1.1.0/
there are three version of the same sample:
index-devel-1_1_0.html
dojo 1.1.0 in development/debug flavour. The dojo.fx module is
required through xhr and is fully debuggable with Firebug.
index-deploy-1_1_0.html
dojo 1.1.0 in deploy flavour. The dojo.fx module is required through
xhr but doesn't appear in the available script sources and isn't
debuggable with Firebug.
index-deploy-1_0_2.html
dojo 1.0.2 in deploy flavour, for comparison with the previous. The
dojo.fx module is required through xhr and is fully debuggable with
Firebug.
Note: Firebug is version 1.1.0b12
An "issue" with the dojo 1.1.0 build system or a defect in Firebug or other?
I cross posted to dojo forum:
http://dojotoolkit.org/forum/dojo-core-dojo-0-9/dojo-core-support/firebug-and-dojo-1-1-0
and ttrenka added an insightful comment.
Regards.
better late than never:
at
http://superfluo.org/firebug-and-dojo-1.1.x/index-minimal-deploy-1_1_1.html
you find what I believe is the simplest possible test case.
The compressed dojo build
http://superfluo.org/firebug-and-dojo-1.1.x/release/dojo/dojo/dojo.js
includes only:
./jslib/dojoGuardStart.jsfrag
./../../dojo/_base/_loader/bootstrap.js
./../../dojo/_base/_loader/loader.js
./../../dojo/_base/_loader/hostenv_browser.js
./jslib/dojoGuardEnd.jsfrag
dojo._base.lang is required and works but firebug isn't able to show
its source and print instead the infamous:
undefineddojo._scopeArgs = [undefined];
string.
Notice that the issue is specif of the compressed flavour, in fact
everything works as expected using the dojo.js.uncompressed.js build.
See:
http://superfluo.org/firebug-and-dojo-1.1.x/index-minimal-deploy-uncompressed-1_1_1.html
Hope that helps, best regards,
Nicola
> In the compressed dojo case, the eval() is buried in a
> long line, so the simple solution fails.
also in compressed dojo 1.0.2 the eval is buried in a long line but
firebug works smoothly anyway.
So the heuristics is already very smart but not enough smart for dojo 1.1.1.
I've dissected the compressed file for 1.0.2 and 1.1.1 and I've
isolated the part where the problem resides, I believe:
(NB: with added line breaks for readability)
dojo 1.0.2 (it's OK)
dojo._loadUri=function(uri,cb)
{
if(this._loadedUrls[uri]){return true;}
var _39=this._getText(uri,true);
if(!_39){return false;}
this._loadedUrls[uri]=true;
this._loadedUrls.push(uri);
if(cb){_39="("+_39+")";}else{_39=this._scopePrefix+_39+this._scopeSuffix;}
if(d.isMoz){_39+="\r\n//@sourceURL="+uri;}
var _3a=d["eval"](_39);
if(cb){cb(_3a);}
return true;
};
dojo 1.1.1 (has problems)
dojo._loadUri=function(uri,cb)
{
if(this._loadedUrls[uri]){return true;}
var _2f=this._getText(uri,true);
if(!_2f){return false;}
this._loadedUrls[uri]=true;
this._loadedUrls.push(uri);
if(cb){_2f="("+_2f+")";}
var _30=d["eval"](_2f+"\r\n//@ sourceURL="+uri);
if(cb){cb(_30);}
return true;
};
In the few differences between this two parts there should be the
cause of the problem.
> If you put your information and links in an bug report I might take a
> deeper look to see if some simple tweek to the current solution will
> fix it.
done: http://code.google.com/p/fbug/issues/detail?id=695
> Also, is this an important case or one you happened to notice?
not sure to have understood your question, anyway:
it happens always, when using dojo 1.1.1 release if you require via
xhr a module (dojo.require), _any module_, the evaled source code
isn't debuggable with Firebug.
Thanks,
Nicola
working with not compressed dojo is terribly slow also for
development, so my habit is precisely to use the
packed-all-on-one-line version for dojo and require apart, in readable
form, the code I'm working on. The drawback of this approach is that
you can't debug dojo code but this is usually unnecessary.
I believe this is a common practice but I'm just guessing.
I've updated the bug report with new observations, best regards,
Nicola