Opened 14 years ago

Closed 13 years ago

Last modified 12 years ago

#262 closed defect (fixed)

make sure dojo.hostenv.* methods are deprecated

Reported by: Brian Douglas Skinner <openrecord@…> Owned by: James Burke
Priority: high Milestone:
Component: Core Version: 0.2
Keywords: Cc:
Blocked By: Blocking:

Description

background:

dojo.hostenv.conditionalLoadModule() has been superceded by dojo.kwCompoundRequire(), but there doesn't seem to be a new replacement for dojo.hostenv.moduleLoaded()

possible tasks:

  • create a dojo.moduleLoaded() (or something like it) to replace dojo.hostenv.moduleLoaded()
  • mark dojo.hostenv.moduleLoaded() as dojo.deprecated()
  • mark dojo.hostenv.conditionalLoadModule() as dojo.deprecated()
  • make sure there aren't other dojo.hostenv.* that still need to be deprecated

Change History (4)

comment:1 Changed 13 years ago by alex

Owner: changed from anonymous to James Burke

comment:2 Changed 13 years ago by James Burke

For the 0.3 build, I will only fix the following (If you have a problem with this, please speak now, otherwise I'm doing it within the next 24 hours):

  • Change dojo.hostenv.conditionalLoadModule() references to dojo.kwCompoundRequire() (and move kwCompoundRequire from the 0.2.2.js compat package back into boostrap2.js -- oops)
  • Merge the functionality of dojo.hostenv.moduleLoaded() and dojo.provide() (which is really dojo.hostenv.startPackage(). Then change all dojo.hostenv.moduleLoaded() references to dojo.provide() references. dojo.hostenv.startPackage() will contain the code that moduleLoaded used to have. The end result would be this:
dojo.hostenv.startPackage = function(packname){
	//Old moduleLoaded code
	var modref = dojo.evalObjPath((modulename.split(".").slice(0, -1)).join('.'));
	this.loaded_modules_[(new String(modulename)).toLowerCase()] = modref;

	//Old startPackage Code
	var syms = packname.split(/./);
	if(syms[syms.length-1]=="*"){
		syms.pop();
	}
	return dojo.evalObjPath(syms.join("."), true);
}
  • Move dojo.hostenv.moduleLoaded() and dojo.hostenv.conditionalLoadModule() to the compat/0.2.2.js package (won't be available to code that runs 0.3, unless they include that compatibility package). Is that too severe? Should I just keep the methods in bootstrap2.js with deprecated messages?

comment:3 Changed 13 years ago by James Burke

Resolution: fixed
Status: newclosed

Fixed now.

s/dojo.hostenv.moduleLoaded/dojo.provide/ s/dojo.hostenv.conditionalLoadModule/dojo.kwCompoundRequire/ s/dojo.hostenv.setModulePrefix/dojo.setModulePrefix/ s/dojo.hostenv.modulesLoadedListeners.push/dojo.addOnLoad/

Moved these functions to compat/0.2.2.js:

  • dojo.hostenv.moduleLoaded
  • /dojo.hostenv.conditionalLoadModule

comment:4 Changed 12 years ago by (none)

Milestone: 0.3release

Milestone 0.3release deleted

Note: See TracTickets for help on using tickets.