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

Set async=false for all relationships. #410

Open
jamescdavis opened this issue Oct 1, 2018 · 0 comments
Open

Set async=false for all relationships. #410

jamescdavis opened this issue Oct 1, 2018 · 0 comments

Comments

@jamescdavis
Copy link
Member

jamescdavis commented Oct 1, 2018

We should set async=false for all relationships (see reference below). Since we are using decorators, an easy way would be just to define custom @hasMany and @belongsTo decorators that do this by default and import them in place of the ember-decorators decorators.

Having a guarantee that writing post.get('comments') in JavaScript or {{post.comments.length}} in Handlebars won't trigger any side effects is a big benefit for developers – synchronous templates and computed properties are straightforward and predictable. And if they do forget to load something, instead of having the template's rendering pass try to do it for them, the developer would just see missing data and go load it explicitly themselves somewhere, perhaps in a route or a component hook using an Ember Concurrency task.

Reference: https://embermap.com/notes/83-the-case-against-async-relationships

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant