Ning Developer Network

Ernie H.

IMPORTANT ANNOUNCEMENT Regarding the Dojo Javascript Framework

Hi everyone,

We want to let you know about an important change we'll be making in our next release. We will be transitioning away from using the Dojo JavaScript framework. If you’ve done custom development on your network that touches this code, you will need to make changes.

Currently, we are using version 0.3.1, and we will be replacing it with jQuery 1.2.6. This change is scheduled for September 25, 2008. There are a couple of reasons for this. The primary one is that Dojo 0.3.1 is an older version and, for various backward-compatibility reasons, we had not been able to upgrade to newer versions that include their popular Dojo Widget Library.

At this point, we’ve made the decision to move from Dojo to jQuery. jQuery, along with having a lighter footprint, also has a more extensive community and documentation with a higher amount of plug-ins and extensions.

What this means for Network Creators:
Hopefully nothing. Any of the Ning-authored developer hacks and Javascript tutorials don't use the Dojo libraries, although if you're using a third-party service that actively uses the Dojo-based libraries on Ning, this could be an issue. If you're using a third-party application or non-Ning code, check with the third party application provider to see whether their code will be impacted.

What this means for Developers:
If you've been using Dojo, you should start transitioning your JavaScript to jQuery. That said, we've developed a thin code layer called the Dojo-adapter that maps existing Dojo calls to the corresponding jQuery calls so your applications will still work. Here is the list of most commonly used functions that we have mapped:

  • dojo: byId, provide, require, addOnLoad, declare, render.html.*
  • dojo.event: connect, browser.stopEvent
  • dojo.io: bind
  • dojo.string: trim, escape
  • dojo.lang: filter, forEach, extend, hitch, inArray, isEmpty, map, mixin
  • dojo.html, dojo.style, dojo.dom: a lot of useful methods to work with DOM nodes, CSS classes and browser-specific behavior.
  • dojo.json: evalJson, serialize
  • dojo.lfx: wipeIn, wipeOut, fadeIn, fadeOut, highlight
  • dojo.widget: implemented a light-weight (but fully functional) custom widget engine

In a later Ning release, we will likely remove the Dojo adapter (Dojo-adapter) layer, so we highly encourage everyone to start using jQuery as quickly as possible.

Important note for developers that start using jQuery:
Because we don't want to break existing code that already uses prototype.js or jQuery, so the jQuery library is available thru the "x$" shortcut instead of "$" to avoid any conflicts. If you have a lot of code that is written using "$", just wrap it as follows:

  (function($){    ...  })(jQuery);

Let us know if you have any questions!

[Note: This release has been pushed back a week to September 25th. Please see this note on the Network Creator forums for more details.]

Share

Reply to This

Replies to This Discussion

Great news! Shall we put our jquery code into our own x$(document).ready() function or is there a clean way to inject it into Ning's own version of x$(document).ready()? If our own code is at the bottom of every page we need to get it executed as soon as the document is ready rather than waiting for all other elements to load.

Good choice of js framework. :-)

Reply to This

Hi Gary,

You'll have to put your jQuery code into your own x$(document).ready() function for now.

Thanks,
- Ernie

Reply to This

It's early (for me anyway), and I'm feeling a little dense right now. Does this mean we will have to remove or re-install gadets/widgets such as SitePal, Youtube video players, and Atomz? (pass the coffee!)

Reply to This

This is great news (jquery's good stuff!). I have a site i'm trying to roll out in about a week from now though so I'm concerned how this will affect what I've currently got working. I've got source code access and have been making some changes there (including some JS work). Just to confirm, this change won't effect our site unless we do a code merge manually, is that correct?

This is a great step, just slightly awkward timing for our particular project!

thanks,
Martin

Reply to This

Hi ThunderX - Nope, all your gadgets and widgets won't be effected. The only ones that will are gadgets and widgets that piggyback off of the dojo libraries of your social network. (If that sounds confusing, chances are you're probably good to go.)

Thanks,
- Ernie

Reply to This

Hi Martin! That's correct; if you're on decentralized code, you should be alright.

Thanks! -Ernie

Reply to This

Thankx Ernie!

Reply to This

Thank for all ..
This is fabulous..

Today i hard work for put JQuery functions in my script.
My users in yours page's need another text box how i can add another???

Reply to This

Will this affect translation files? I notice that in the custom js file there are many references to dojo.

Reply to This

Hi Everyone - the release date has been pushed back one week to September 25, 2008.

Thanks, Ernie

Reply to This

Susan - the custom.js does have many references to dojo. I'm fairly certain that this will be be addressed once the dojo libraries get ported to jQuery, or at the very least this will be addressed by the dojo-adapter. I'll double check on that as well.

Thanks,
- Ernie

Reply to This

Thanks Ernie :)

Reply to This

Reply to This

RSS

© 2009   Created by Ning Developer Admin

Badges  |  Report an Issue  |  Privacy  |  Terms of Service