eviltrout / ember-cloaking

Support for not rendering offscreen views in an Ember app for performance
MIT License
294 stars 29 forks source link

Doesn't work with DS.FilteredRecordArray? #4

Closed kgautreaux closed 4 years ago

kgautreaux commented 10 years ago

I've tried to narrow this down to a small case that exhibits the behavior. This JSBin is as close as I've come:

http://emberjs.jsbin.com/elUTijU/1/edit?html,js,output

In the IndexRoute model hook I've commented out some returns that work and left in the DS.Store.filter call that returns a DS.FilteredRecordArray. This results in no data showing in the template. If I just return a DS.RecordArray (using a simple find) then the data populates correctly.

I'm not smart enough to figure out why that is so I'm hoping @eviltrout or someone smarter than me can.

I know you guys don't use ember-data in @discourse but I would like to get this working for the filtered record case to help mitigate memory usage with a large list of items, especially on mobile.

Let me know if I can help further. Thanks so much for your time.

eviltrout commented 10 years ago

There was an issue with us using content instead of context that might cause this. Can you try again with the latest changes I've merged in? I'd be curious to see if it fixes your problem.

kgautreaux commented 10 years ago

I will try to test it later today. Thanks!

kgautreaux commented 10 years ago

@eviltrout I tried testing it using my previous jsbin here: http://emberjs.jsbin.com/elUTijU/1/edit?html,js,output

In preliminary testing it seems that this change didn't fix the issue, but I can't even get it to actually render with a regular DS.RecordArray using ember-cloaking master. It still doesn't work with DS.FilteredRecordArray either.

I don't have more time today to dive into it but I'll try to investigate more next week when I have more time.

kgautreaux commented 10 years ago

@eviltrout I looked into this some more and it turns out I was wrong in my JSBin. It wasn't working there because the FixtureAdapter doesn't support filter. I still don't know why it doesn't work in my project but I'm hoping to figure it out.