Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor away from async relationships #248

Open
oskarrough opened this issue Jul 26, 2018 · 1 comment
Open

Refactor away from async relationships #248

oskarrough opened this issue Jul 26, 2018 · 1 comment

Comments

@oskarrough
Copy link
Member

Normally channel.get('tracks') will get local properties off of objects. But in the case of an async relationship, it will also trigger network requests. We don't control when the data is fetched.

Currently most or all of our model relationships are marked as async.

Instead it is recommended to set async: false and explicitly load the data when we need it. More information here: https://embermap.com/notes/83-the-case-against-async-relationships.

As an example, going to /200ok will not fetch one channel, but 90. That is because channel.favorites is an async relationship. It will also load ~200 image models, because they are async, too. It works but it is slowing things down considerably. We are loading much more than we need.

Opening this issue so we won't forget to refactor one day.

@oskarrough
Copy link
Member Author

oskarrough commented Oct 9, 2018

@oskarrough oskarrough mentioned this issue Oct 10, 2018
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant