jquery/jquery-mobile — Issue #2853: Improve page enhancement performance
Author: jblas
Created: 2011-10-26 17:00:26+00:00
State: open

Now that most components within a page are decoupled, they are each doing their own traversal through the DOM of the page being enhanced whenever a pagecreate or create event is dispatched. For large documents this could be a problem. Prior to the decoupling, the page code used to search for all data-role elements, as well as all form elements and then filter these lists for each component which was much faster.

We need to look into the possibiity of creating a jquery.mobile.role.js plugin that can gather this info from the page once, and then either add these lists to the pagecreate or create events so that the other components can use them. Of course this would mean its pagecreate/create handlers would need to be registered first before all others.

Another possibility would be to have the components not listen for pagecreate and just listen for a single event like "create" that gets dispatched by the role plugin or by a developer.