#1735 closed defect (wontfix)
MochiKit 1.3.1 not working with Dojo 0.4
Reported by: | James Burke | Owned by: | James Burke |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | General | Version: | 0.3 |
Keywords: | mochikit | Cc: | |
Blocked By: | Blocking: |
Description
There was an issue reported using Dojo 0.4 and MochiKit? 1.3.1. This is the test file that was used (put in dojo tests directory, and put mochikit folder containing mochikit js in test directory too:
<html> <head> <title>Mochi Kit</title> <script type="text/javascript"> // Dojo configuration djConfig = { isDebug: true }; </script> <script type="text/javascript" src="../dojo.js"></script> <script type="text/javascript" src="mochikit/MochiKit.js"></script> </body> </html>
Note: See
TracTickets for help on using
tickets.
There were two issues:
1) In mochikit's package.js file, it uses dojo.hostenv.conditionalLoadModule() and dojo.hostenv.moduleLoaded(). These methods have been removed in 0.4. Instead, the package.js file should look like this:
That fixes the resource loading, but then I get an error in MochiKit? (using a non-packed version, just the loose, lib .js files):
"m has no properties" line 72 of MochiKit?.js. When I was in Firebug, I believe it was trying to do something with Signal at that point.
2) The test file needs to tell Dojo where it can find mochikit resources, and if it does this, it actually does not need the separate script tag include.
Note that this still suffers from the "m has no properties" error. If I do the following, this seems to load with no errors (but it would be nice if the dojo.require path worked):
Closing this bug now. It seems like the solution is to ask MochiKit? to update. Note that it can update to use the new methods in 0.4, but they will work in in 0.3.1 and earlier too.
Another option is to define this chunk of JS after dojo.js, but before any mochikit code:
but I don't think this will solve the "m has no properties error." Will need to ask Mochikit dev for that issue.