-------- Ursprüngliche Nachricht --------
Von: Thomas Müller <[email protected]> 
Datum:06.03.2014  00:54  (GMT+01:00) 
An: [email protected] 
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
[email protected]
http://mailman.owncloud.org/mailman/listinfo/user
_______________________________________________
Devel mailing list
[email protected]
http://mailman.owncloud.org/mailman/listinfo/devel

Reply via email to