use with other libraries - dojo

27 views
Skip to first unread message

Confucius

unread,
Dec 17, 2009, 4:58:35 PM12/17/09
to JavaScriptMVC
The wiki appears to deal with v 1.5.5 and some depricated practices,
like turning on 'no conflict mode' when using other libraries.

I found that I can utilize dojo just by including it as a resource and
omitting the 'no_conflict()' call, but was wondering if there was a
2.0.2 wiki in general and more about using dojo in particular.

1.5.5 doesn't appear to favor any particular library, but 2.0.2 has
some ties to jQuery. Why is that?


Regards

Justin Meyer

unread,
Dec 17, 2009, 5:08:03 PM12/17/09
to javasc...@googlegroups.com
JMVC 2.0 'should' work in jQuery's no conflict mode.  It doesn't have it's own (everything is under the jQuery namespace except include).

If dojo uses $, then before you include dojo, in the first line of your app do:

jQuery.noConflict();


Why did 2.0 move to not using jQuery.  Because it was too hard for me to maintain everything other libraries do (and in most cases did better).  jQuery was the only popular library that didn't enforce its own set of  best practices while also not polluting the global namespace.  It was an easy choice.


However, to encourage more people to start using parts of JMVC, we are breaking off the compress/test/document/error-reporting/updating parts of JMVC into its own project for 3.0.  It will be possible to use this with any library.  
But, if you want to use the MVC stuff, you'll have to use jQuery.



Justin Meyer

Jupiter Consulting
\Development\Training\Support
847-924-6039
justin...@gmail.com



--

You received this message because you are subscribed to the Google Groups "JavaScriptMVC" group.
To post to this group, send email to javasc...@googlegroups.com.
To unsubscribe from this group, send email to javascriptmv...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javascriptmvc?hl=en.



Justin Meyer

unread,
Dec 17, 2009, 5:10:42 PM12/17/09
to JavaScriptMVC
I realized I didn't tell you of what JMVC "doesn't have its own"
of ....

There is no JMVC no conflict mode. There is only jQuery's.

If this breaks JMVC, please tell me where and I will fix it
immediately.

On Dec 17, 4:08 pm, Justin Meyer <justinbme...@gmail.com> wrote:
> JMVC 2.0 'should' work in jQuery's no conflict mode.  It doesn't have it's
> own (everything is under the jQuery namespace except include).
>
> If dojo uses $, then before you include dojo, in the first line of your app
> do:
>
> jQuery.noConflict();
>
> Why did 2.0 move to not using jQuery.  Because it was too hard for me to
> maintain everything other libraries do (and in most cases did better).
>  jQuery was the only popular library that didn't enforce its own set of
>  best practices while also not polluting the global namespace.  It was an
> easy choice.
>
> However, to encourage more people to start using parts of JMVC, we are
> breaking off the compress/test/document/error-reporting/updating parts of
> JMVC into its own project for 3.0.  It will be possible to use this with any
> library.
> But, if you want to use the MVC stuff, you'll have to use jQuery.
>
> Justin Meyer
>
> Jupiter Consulting
> \Development\Training\Support
> 847-924-6039

> justinbme...@gmail.com


>
>
>
> On Thu, Dec 17, 2009 at 3:58 PM, Confucius <overmei...@gmail.com> wrote:
> > The wiki appears to deal with v 1.5.5 and some depricated practices,
> > like turning on 'no conflict mode' when using other libraries.
>
> > I found that I can utilize dojo just by including it as a resource and
> > omitting the 'no_conflict()' call, but was wondering if there was a
> > 2.0.2 wiki in general and more about using dojo in particular.
>
> > 1.5.5 doesn't appear to favor any particular library, but 2.0.2 has
> > some ties to jQuery. Why is that?
>
> > Regards
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "JavaScriptMVC" group.
> > To post to this group, send email to javasc...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > javascriptmv...@googlegroups.com<javascriptmvc%2Bunsubscribe@goog legroups.com>

Confucius

unread,
Dec 21, 2009, 1:27:00 PM12/21/09
to JavaScriptMVC, robert_van...@choicehotels.com
1 - no conflict)

Adding 'MVC.no_conflict()' to my (2.0.2) apps 'init.js', gives me
this:

MVC is not defined

With 'jQuery.no_conflict()', I get this:

jQuery.no_conflict is not a function

So with these, execution stops and javascriptmvc doesn't render
anything.


2 - dojo)

I'm able to use dojo as a resource. Since I saved it in '../
resources/' as 'dojo14', I included it like this:

include.resources('dojo14/dojo/dojo');


3 - embedded jQuery)

My question stated that jmvc1.5.5 seemed to be less tied to jQuery
than 2.0.2 is, but you seem to be saying that the latter is less tied
to jQuery. Maybe so. I'm new to this so may have made a false
assumption.

Less tied to any particular JS library is the better paradigm. We just
wish there was an all-dojo mode where javascriptmvc used dojo
throughout.

Justin Meyer

unread,
Dec 21, 2009, 1:57:14 PM12/21/09
to javasc...@googlegroups.com
1)  In my previous post, that's exactly what I mean, there is no MVC.no_conflict()


3)  2.0 is entirely tied to jQuery.  And that is by far the better paradigm until:
  • there are core members who will spend their time to support other libraries
  • we receive enough in donations to hire someone to do this
  • I get a client who demands this of JMVC and is paying me accordingly
  • More people use dojo than jQuery
  • Many people want to use JMVC w/ dojo (extremely unlikely as dojo already has its own way of doing things).
If you want this, it is entirely possible to make this mode with 1.5.  I will certainly accept patches.

To unsubscribe from this group, send email to javascriptmv...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages