Created
August 11, 2011 16:56
-
-
Save steveluscher/1140173 to your computer and use it in GitHub Desktop.
A Mojo->Dojo connector; re-implement these methods in another library, and you can use Mojo 2.0 without Dojo.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Mojo-Dojo connector */ | |
(function() { | |
if(typeof mojo == 'undefined') mojo = {}; | |
mojo.addOnUnload = dojo.addOnUnload; | |
mojo.clone = dojo.clone; | |
mojo.config = dojo.config; | |
mojo.connect = dojo.connect; | |
mojo.declare = dojo.declare; | |
mojo.destroyElement = dojo._destroyElement; | |
mojo.disconnect = dojo.disconnect; | |
mojo.hasClass = dojo.hasClass; | |
mojo.hitch = dojo.hitch; | |
mojo.isArray = dojo.isArray; | |
mojo.isObject = dojo.isObject; | |
mojo.isString = dojo.isString; | |
mojo.place = dojo.place; | |
mojo.provide = dojo.provide; | |
mojo.publish = dojo.publish; | |
mojo.query = dojo.query; | |
mojo.registerModulePath = dojo.registerModulePath; | |
mojo.require = dojo.require; | |
mojo.string = dojo.string; | |
mojo.style = dojo.style; | |
mojo.subscribe = dojo.subscribe; | |
mojo.unsubscribe = dojo.unsubscribe; | |
})(); |
Yeah. CoffeeScript kind of bums me out. I don't know why. I'm sure I'll warm up to transpilers, someday. Maybe.
Anyway – I agree with everything you've just said, but it doesn't satisfy my original requirements, which were to fire Dojo and hire some other library on a legacy Mojo project.
If you like PHP: http://www.harmony-framework.com/
If you like C#: http://jsil.org/
If you like Skulpt: http://www.skulpt.org/
One day, every developer can write in their favourite language and it'll just compile to JavaScript!
https://gist.github.com/1192286
mojo.define("app.controller.RegistrationController", {
addObservers: function() {
},
addCommands: function() {
},
addIntercepts: function() {
}
});
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yo @steveluscher, have you checked out CoffeeScript out? cc/ @loyalchow
Compiles to
If Mojo were to go CoffeeScript, we'd be able to detach our dependencies to libraries for features like class creation / inheritance -- things that typically come with the language itself, as well as, make controllers/commands/services easier to write.
The initiative to proxy everything through mojo.* is great but I feel like it's too much of a short-term solution as it doesn't address the problems with writing a controller. I feel like there's little value in being library agnostic if there's no gains on productivity (unless the developers really love jQuery or something). There's just too much cruft in writing a controller, command, service and it should ultimately be easier/quicker/cleaner. Let me know what you think about CoffeeScript though! :o)
You may know this already but Rails 3.1 will land with sass and coffeescript! Exciting times for people who love transpilers!
Things to discuss in regards to a coffeescript rewrite
Doh, now it feels like 2 steps forward, 1 step back -- our core features still need to be tied to a library.
These are just my thoughts on the subject of upgrades to Blast Mojo Framework. I haven't actually dove into coding any prototypes yet.