How can the delay before displaying meteor collections be best addressed?
Asked Answered
C

1

3

Before displaying the items from a collection, meteor seems to do some processing that leaves the client window without updates. You can see this live if you surf to http://madewith.meteor.com on a reasonable machine. My 2.6GHz 4GB RAM laptop takes about 5 seconds to render the items in the list, during which there is no indication of progress and a new user in a hurry could reasonably believe the page has finished loading.

Is there a way to incrementally display items from a collection, such that the server pushes to the client the first items of data on the wire, and the browser renders them, while new items are received? Akin to HTTP's chunked transfer.

Or is the only solution to display a spinner graphic while loading the collection, similar to what https://atmosphere.meteor.com/ does (the "doing something smart" message)?

Crystie answered 7/10, 2012 at 23:15 Comment(1)
It's not very meaningful. It can mean too many things. Maybe it's better you change it to incremental-display or something?Dvorak
T
1

If you examine the xhr of the madewith app, you'll see that all (87 at this moment) apps load in the same request. So I don't think 'incrementally' displaying data is going to help in this case.

The issue is just that meteor apps take a while to initialise. I'm not sure if this can be improved in the future, but for now, yes, I think displaying a spinner is the best solution.

Regarding how to know when the data is ready, you can use the onReady callback on a collection, or see this PR for a better solution coming soon.

Tree answered 8/10, 2012 at 1:40 Comment(2)
By incremental display, I mean a method similar to HTTP's chunked transfer, whereby the client doesn't need to wait for the content to finish transferring.Crystie
Hmm.. but the HTML sent is very simple. The JS is long and complex (this, along with the time taken to init the livedata-connection is no doubt the cause of the slowness). But I'm not sure browsers support incremental JS loading (do they?)Tree

© 2022 - 2024 — McMap. All rights reserved.