[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 

Hi,

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:
https://github.com/owncloud/contacts/pull/431/files

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:
https://github.com/owncloud/core/pull/7579
https://github.com/owncloud/core/pull/7578

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,

Tom

PS: In case you are interested this is the pull request which will kill OC.Router:
https://github.com/owncloud/core/pull/7494

_______________________________________________
User mailing list
User at owncloud.org
http://mailman.owncloud.org/mailman/listinfo/user
-------------- 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