Rendering a large collection can tie up the browsing context and generate long-running script errors.
It's pretty obvious that consumers with large collections should also consider partitioning/paginating their collections to make for an acceptable user experience. However, for consumers that are okay with rendering things in batches, it would be a good idea for CollectionBinder to support some sort of renderBatchSize option (or similar) and render in chunks of that size, calling setTimeout to return control back to the browser temporarily in between. If that option is not specified, all items would render synchronously. Ideally, this logic would activate both on initial bind calls and every time a collection add occurs with more than renderBatchSize models being added.
I'll work on a pull request along these lines in the next couple of days, but if anyone wants to have a go before I do, feel free.
Rendering a large collection can tie up the browsing context and generate long-running script errors.
It's pretty obvious that consumers with large collections should also consider partitioning/paginating their collections to make for an acceptable user experience. However, for consumers that are okay with rendering things in batches, it would be a good idea for CollectionBinder to support some sort of
renderBatchSizeoption (or similar) and render in chunks of that size, callingsetTimeoutto return control back to the browser temporarily in between. If that option is not specified, all items would render synchronously. Ideally, this logic would activate both on initialbindcalls and every time a collectionaddoccurs with more thanrenderBatchSizemodels being added.I'll work on a pull request along these lines in the next couple of days, but if anyone wants to have a go before I do, feel free.