[owncloud-devel] WG: [owncloud-user] App developers: We will remove the javascript code around OC.Router for ownCloud 7

Thomas Müller thomas.mueller at tmit.eu
Thu Mar 6 08:23:15 MET 2014

-------- Ursprüngliche Nachricht --------
Von: Thomas Müller <thomas.mueller at tmit.eu> 
Datum:06.03.2014  00:54  (GMT+01:00) 
An: user at owncloud.org 
Betreff: [owncloud-user] App developers: We will remove the javascript code
  around OC.Router for ownCloud 7 


during the ongoing performance improvement initiative we need to remove all code 
around OC.Router which includes OC.Router.generate(), OC.Router.registerLoadedCallback()
and most important OC.Router.routes_request, which causes an ajax call to /core/routes.json to 
load all route information from the server.

Especially this call has a bad impact on the client because all invocations of OC.Router.generate()
have to be postponed until the routes are loaded. In addition the payload can be pretty high (up to 23kB)
and is consumes server resources because the data is generates at runtime within php.

We will introduce a new function giving you almost the same functionality:

OC.generateUrl(url, params)

How does it work? What has to be changed?

The changes on the contacts app show pretty good how easy it actually is:

Instead of 

OC.Router.generate('contacts_address_book_export', {backend: ..., addressBookId: ...});

this is called now:

OC.generateUrl('apps/contacts/addressbook/{backend}/{addressBookId}/export',{backend: ..., addressBookId: ...});

This function will shortly arrive in the master branch and in the stable6 branch as well:

We decided to backport the function to give app developers a chance to adopt their apps right now 
during the OC6 life cycle and allow smooth migration once OC7 will be released.

In case you have any further question - just let me know.

Take care,


PS: In case you are interested this is the pull request which will kill OC.Router:

User mailing list
User at owncloud.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.owncloud.org/pipermail/devel/attachments/20140306/0d263581/attachment.html>

More information about the Devel mailing list