Skip to content

Set async=false for all relationships. #410

@jamescdavis

Description

@jamescdavis

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions