-
Notifications
You must be signed in to change notification settings - Fork 59
Description
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