Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
Posts: 60
Registered: ‎06-08-2011
My Device: n/a
My Carrier: n/a

Backbone.js support

Has anyone used backbone.js is a webworks app? Any success with os 6 or 7 smartphone devices?
Retired
Posts: 856
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: Backbone.js support

I haven't tried it myself, but I don't see why there would be a problem. If you do try it out, please let us know about your experience and if we can help with any issues you do find.

Tim Windsor
Open Source Technical Lead
Developer
Posts: 34
Registered: ‎05-20-2012
My Device: Playbook
My Carrier: Vodafone

Re: Backbone.js support

[ Edited ]

I use backbone.js with Qjuery mobile(for events). Its works perfect with webWorks. What kind of help do you need?

 

Small example for you

Example

Contributor
Posts: 17
Registered: ‎08-23-2012
My Device: developer
My Carrier: n/a

Re: Backbone.js support

Have had success with Backbone for OS 6.0 up.

 

Had problems with OS 5.0 and so have others.

Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Backbone.js support

Does backbone offer any unit tests to see what features it requires from a browser?  that would be great to he identify what might be failing, otherwise it would be looking for a needle in a haystack.

 

OS 5 has a very different JavaScript engine than BB6+ so I imagine there must be some element that is not supported that could be failing. My guess is the issue is backbone's dependency on JavaScript prototype constructor.  I don't believe this is supported on OS 5.0.

 

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Contributor
Posts: 17
Registered: ‎08-23-2012
My Device: developer
My Carrier: n/a

Re: Backbone.js support

[ Edited ]

Backbone does have a test suite and so does underscore which backbone depends on. However these don't seem to run at all on my blackberry browser so its not much help(unless I modify the tests that is).

I am still busy investigating this while trying to get a backbone, underscore and zepto app to work completely in OS 5.
Thinking that backbone itself is at fault might have been a bit premature though, so far it seems that the fault lies more with underscore and zepto. Once I have everything working I am happy to list all isses and modifications to underscore etc that are needed to get the libraries working (or mostly working), if anyone is interested that is  . . .

Edit:
I spoke too soon it seems. At least one change needed to backbone is to disable it using the hashchange event . . .

Contributor
Posts: 17
Registered: ‎08-23-2012
My Device: developer
My Carrier: n/a

Re: Backbone.js support


@astanly, is this what you mean by the prototype constructor?

 

Highlighted
Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Backbone.js support

That's exactly what I was asking for!  Thanks for posting those.  Just ran them on BlackBerry 7 and all tests pass as expected.

 

The test suite being used is QUnit, which depends on jQuery, which we know does not work 100% on BlackBerry OS 5.  Since jQuery and Zepto share a similar interface (yet different implementations), I would think that Zepto may be the issue.

 

Here is a DOM unit test for Zepto that displays its results to the screen and also the console.  Does this test run on OS5?

 http://mir.aculo.us/stuff/zepto/test/zepto.html

 

Otherwise, can you isolate Zepto itself?  Create a hello world sample that uses Zepto to test some of its functionality.  Does it work on OS 5?

 

 

For prototypes and their use in object inheritance, plesae see the following example: http://tobyho.com/2010/11/22/javascript-constructors-and/  Libraries like backbone.js use this construct to build their model,view and router object types.

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.