No it is me that is missing something, sorry long day! Yes, that looks right and cleans thing up a lot :)

-------- Original message --------
From: Ben Hockey <notifications@github.com> 
Date:  
To: dojo/dojo <dojo@noreply.github.com> 
Cc: Stephen Simpson <me@simpo.org> 
Subject: Re: [dojo] Initial WebWorker host environment (#43) 
 
In dojo.js:

> @@ -168,6 +168,25 @@
>  		rhinoDojoConfig(defaultConfig, baseUrl, rhinoArgs);
>  	}
>  
> +	has.add("config-cacheBust", (userConfig.cacheBust || defaultConfig.cacheBust) !== undefined);
> +	has.add("host-webworker", ((typeof importScripts !== 'undefined') && (typeof document === 'undefined')));
> +	if(has("host-webworker")){
> +		var dojoPath = userConfig.baseUrl;
> +		
> +		for(var i = 0; i < userConfig.packages.length; i++){
> +			var cPackage = userConfig.packages[i];
> +			if(cPackage.name == "dojo"){
> +				dojoPath += cPackage.location.replace(/^\.\//,"") + "/";
> +			}
> +		}
> +		
> +		importScripts(
> +			dojoPath+"_base/configWebworker.js"+
i'm expecting that if you inline configWebworker then you don't need to do any path calculations. am i overlooking something? i'm not certain this snippet is everything but i expect it's close to all that's needed if you inline the config.

if(has("host-webworker")){
    // update hasCache to match the environment
    mix(defaultConfig.hasCache, {
        "host-browser": 0,
        "dom": 0,
        "dojo-dom-ready-api": 0,
        "dojo-sniff": 0,
        "dojo-inject-api": 1,
        "host-webworker": 1
    });

    // reset some configuration switches with webworker-appropriate values
    defaultConfig.loaderPatch = {
        injectUrl: function(url, callback){
            try{
                importScripts(url);
                callback();
            }catch(e){
                console.info("failed to load resource (" + url + ")");
                console.error(e);
            }
        }
    };

    // in addition, ensure that getText from https://github.com/dojo/dojo/blob/1.9.1/dojo.js#L292 is active in workers
}
—
Reply to this email directly or view it on GitHub.