Changeset 7099

Show
Ignore:
Timestamp:
01/26/07 17:02:53 (22 months ago)
Author:
jburke
Message:

Fixes #2212 and #2282. Now can debug local modules when running in xdomain mode, and bootstrap2.js is no longer needed.

Location:
branches/0.4
Files:
2 added
1 removed
14 modified

Legend:

Unmodified
Added
Removed
  • branches/0.4/buildscripts/build.xml

    r7054 r7099  
    1111                  should we support these as HTML? Or just JS files? 
    1212                  NOTE: the following command issued from the top-level seems to work correctly: 
    13                         perl buildscripts/jslink.pl -pre cat -i release/testUsage.js -l src/bootstrap1.js -l src/bootstrap2.js -l src/hostenv_browser.js -l src/io/IO.js -l src/io/BrowserIO.js -o - > release/minimal.js 
     13                        perl buildscripts/jslink.pl -pre cat -i release/testUsage.js -l src/bootstrap1.js -l src/hostenv_browser.js -l src/io/IO.js -l src/io/BrowserIO.js -o - > release/minimal.js 
    1414                  This correctly "links" the files together, but mangles some 
    1515                  identifiers and places anonymous inner functions at the wrong places 
     
    716716        <!-- end buildFlash task --> 
    717717 
     718        <!-- intern-strings task --> 
     719        <target name="xd-dojo-config" depends="-fix-config" 
     720                description="Sets dojo.js to use xdomain loading and sets dojo module path to a specific URL."> 
     721                <java jar="./lib/custom_rhino.jar" failonerror="true" fork="true" 
     722                        logError="true"> 
     723                        <arg value="setXdDojoConfig.js" /> 
     724                        <arg value="${release_dir}/dojo.js" /> 
     725                        <arg value="${xdDojoUrl}" /> 
     726                </java> 
     727        </target> 
     728        <!-- end intern-strings task --> 
     729 
    718730        <!-- xdgenRelease task --> 
    719731        <target name="xdgenRelease" if="xdgenRun" depends="xdgenRemove, -set-profileFile"> 
  • branches/0.4/buildscripts/buildUtil.js

    r7089 r7099  
    4444                load("../src/loader.js"); 
    4545                load("../src/hostenv_rhino.js"); 
    46                 load("../src/bootstrap2.js"); 
    4746         
    4847                // FIXME: is this really what we want to say? 
     
    7372                dojo.hostenv.loadedUris.push("../src/hostenv_"+hostenvType+".js"); 
    7473        } 
    75          
    76         dojo.hostenv.loadedUris.push("../src/bootstrap2.js"); 
    7774         
    7875        if(dependencies["prefixes"]){ 
     
    269266                //Make sure we have a JS string and not a Java string by using new String(). 
    270267                dojoContents += new String(readFile(depList[i])) + "\r\n"; 
    271                 if(!insertedProvideMarker && depList[i].indexOf("bootstrap2.js") != -1){ 
     268                if(!insertedProvideMarker && depList[i].indexOf("hostenv_") != -1){ 
    272269                        dojoContents += "__DOJO_PROVIDE_INSERTION__"; 
    273270                        insertedProvideMarker = true; 
  • branches/0.4/dojo.js

    r4950 r7099  
    2525                        tmps.splice(1, 0, "hostenv_browser.js"); 
    2626                } 
    27          
    28                 tmps.push("bootstrap2.js"); 
    29          
     27 
    3028                if((this["djConfig"])&&(djConfig["baseScriptUri"])){ 
    3129                        var root = djConfig["baseScriptUri"]; 
     
    6058                } 
    6159         
    62                 if((this["djConfig"])&&((djConfig["isDebug"])||(djConfig["debugAtAllCosts"]))){ 
    63                         tmps.push("debug.js"); 
    64                 } 
    65          
    66                 if((this["djConfig"])&&(djConfig["debugAtAllCosts"])&&(!isRhino)&&(!isDashboard)){ 
    67                         tmps.push("browser_debug.js"); 
    68                 } 
    69          
    70                 //Support compatibility packages. Right now this only allows setting one 
    71                 //compatibility package. Might need to revisit later down the line to support 
    72                 //more than one. 
    73                 if((this["djConfig"])&&(djConfig["compat"])){ 
    74                         tmps.push("compat/" + djConfig["compat"] + ".js"); 
    75                 } 
    76          
    7760                var loaderRoot = root; 
    7861                if((this["djConfig"])&&(djConfig["baseLoaderUri"])){ 
  • branches/0.4/src/browser_debug.js

    r5521 r7099  
     1dojo.provide("dojo.browser_debug"); 
     2 
    13dojo.hostenv.loadedUris.push("../src/bootstrap1.js"); 
    24dojo.hostenv.loadedUris.push("../src/loader.js"); 
    35dojo.hostenv.loadedUris.push("../src/hostenv_browser.js"); 
    4 dojo.hostenv.loadedUris.push("../src/bootstrap2.js"); 
    56dojo.hostenv._loadedUrisListStart = dojo.hostenv.loadedUris.length; 
    67 
  • branches/0.4/src/debug.js

    r7087 r7099  
     1dojo.provide("dojo.debug"); 
     2 
    13dojo.debug = function(/*...*/){ 
    24        // summary: 
  • branches/0.4/src/hostenv_adobesvg.js

    r6372 r7099  
    499499} 
    500500*/ 
     501 
     502dojo.requireIf((djConfig["isDebug"] || djConfig["debugAtAllCosts"]), "dojo.debug"); 
  • branches/0.4/src/hostenv_browser.js

    r6615 r7099  
    527527 
    528528} //if (typeof window != 'undefined') 
     529 
     530//Load debug code if necessary. 
     531dojo.requireIf((djConfig["isDebug"] || djConfig["debugAtAllCosts"]), "dojo.debug"); 
     532 
     533//window.widget is for Dashboard detection 
     534//The full conditionals are spelled out to avoid issues during builds. 
     535//Builds may be looking for require/requireIf statements and processing them. 
     536dojo.requireIf(djConfig["debugAtAllCosts"] && !window.widget && !djConfig["useXDomain"], "dojo.browser_debug"); 
     537dojo.requireIf(djConfig["debugAtAllCosts"] && !window.widget && djConfig["useXDomain"], "dojo.browser_debug_xd"); 
  • branches/0.4/src/hostenv_jsc.js

    r3713 r7099  
    6565        return System.Environment.GetCommandLineArgs()[0]; 
    6666} 
     67 
     68dojo.requireIf((djConfig["isDebug"] || djConfig["debugAtAllCosts"]), "dojo.debug"); 
  • branches/0.4/src/hostenv_rhino.js

    r6416 r7099  
    246246        thread.start(); 
    247247} 
     248 
     249dojo.requireIf((djConfig["isDebug"] || djConfig["debugAtAllCosts"]), "dojo.debug"); 
  • branches/0.4/src/hostenv_spidermonkey.js

    r3713 r7099  
    6767} 
    6868 
     69dojo.requireIf((djConfig["isDebug"] || djConfig["debugAtAllCosts"]), "dojo.debug"); 
    6970 
  • branches/0.4/src/hostenv_svg.js

    r6020 r7099  
    212212        }; 
    213213} 
     214 
     215dojo.requireIf((djConfig["isDebug"] || djConfig["debugAtAllCosts"]), "dojo.debug"); 
  • branches/0.4/src/hostenv_wsh.js

    r3713 r7099  
    3535 
    3636dojo.hostenv.exit = function(exitcode){ WScript.Quit(exitcode); } 
     37 
     38dojo.requireIf((djConfig["isDebug"] || djConfig["debugAtAllCosts"]), "dojo.debug"); 
  • branches/0.4/src/loader_xd.js

    r7077 r7099  
    1111        //the xhr package until the one before it finishes loading. The text of the xhr package will be converted 
    1212        //to match the format for a xd package and put in the xd load queue. 
    13         //You can force all packages to be treated as xd by setting the djConfig.forceXDomain. 
    14         this.isXDomain = djConfig.forceXDomain || false; 
     13        this.isXDomain = djConfig.useXDomain || false; 
    1514 
    1615        this.xdTimer = 0; 
     
    2524dojo.hostenv.resetXd(); 
    2625 
    27 dojo.hostenv.createXdPackage = function(/*String*/contents){ 
     26dojo.hostenv.createXdPackage = function(/*String*/contents, /*String*/resourceName, /*String=*/resourcePath){ 
    2827        //summary: Internal xd loader function. Creates an xd module source given an 
    2928        //non-xd module contents. 
     
    5857        output.push("\ndefinePackage: function(dojo){"); 
    5958        output.push(contents); 
    60         output.push("\n}});"); 
     59        //Add isLocal property so we know if we have to do something different 
     60        //in debugAtAllCosts situations. 
     61        output.push("\n}, resourceName: '" + resourceName + "', resourcePath: '" + resourcePath + "'});"); 
    6162         
    6263        return output.join(""); //String 
     
    161162                 
    162163                if(this.isXDomain){ 
    163                         var pkg = this.createXdPackage(contents); 
     164                        var pkg = this.createXdPackage(contents, module, uri); 
    164165                        dj_eval(pkg); 
    165166                }else{ 
     
    224225 
    225226                //Save off the package contents for definition later. 
    226                 var contentIndex = this.xdContents.push({content: pkg.definePackage, isDefined: false}) - 1; 
     227                var contentIndex = this.xdContents.push({ 
     228                                content: pkg.definePackage, 
     229                                resourceName: pkg["resourceName"], 
     230                                resourcePath: pkg["resourcePath"], 
     231                                isDefined: false 
     232                        }) - 1; 
    227233 
    228234                //Add provide/requires to dependency map. 
     
    417423                        var contents = this.xdContents[pkg.contentIndex]; 
    418424                        if(!contents.isDefined){ 
    419                                 this.xdDefList.push(contents.content); 
     425                                var content = contents.content; 
     426                                content["resourceName"] = contents["resourceName"]; 
     427                                content["resourcePath"] = contents["resourcePath"]; 
     428                                this.xdDefList.push(content); 
    420429                                contents.isDefined = true; 
    421430                        } 
     
    472481        var defLength = this.xdDefList.length; 
    473482        for(var i= 0; i < defLength; i++){ 
    474                 //Evaluate the package to bring it into being. 
    475                 //Pass dojo in so that later, to support multiple versions of dojo 
    476                 //in a page, we can pass which version of dojo to use. 
    477                 dojo.hostenv.xdDefList[i](dojo); 
     483                var content = dojo.hostenv.xdDefList[i]; 
     484                if(djConfig["debugAtAllCosts"] && content["resourceName"]){ 
     485                        if(!this["xdDebugQueue"]){ 
     486                                this.xdDebugQueue = []; 
     487                        } 
     488                        this.xdDebugQueue.push({resourceName: content.resourceName, resourcePath: content.resourcePath}); 
     489                }else{ 
     490                        //Evaluate the package to bring it into being. 
     491                        //Pass dojo in so that later, to support multiple versions of dojo 
     492                        //in a page, we can pass which version of dojo to use.                   
     493                        content(dojo); 
     494                } 
    478495        } 
    479496 
     
    494511        this.resetXd(); 
    495512 
     513        if(this["xdDebugQueue"] && this.xdDebugQueue.length > 0){ 
     514                this.xdDebugFileLoaded(); 
     515        }else{ 
     516                this.xdNotifyLoaded(); 
     517        } 
     518} 
     519 
     520dojo.hostenv.xdNotifyLoaded = function(){ 
    496521        //Clear inflight count so we will finally do finish work. 
    497522        this.inFlightCount = 0;  
  • branches/0.4/tests/test_bootstrap.html

    r3849 r7099  
    99<script language="JavaScript" type="text/javascript" src="../src/loader.js"></script> 
    1010<script language="JavaScript" type="text/javascript" src="../src/hostenv_browser.js"></script> 
    11 <script language="JavaScript" type="text/javascript" src="../src/bootstrap2.js"></script> 
    1211 
    1312</head>