data icon indicating copy to clipboard operation
data copied to clipboard

feat: implement legacy field, resource and collection decorators for supporting @ember-data/model migration

Open runspired opened this issue 2 years ago • 0 comments

In order to enable a granular migration

  • field replaces attr and moves serialize/deserialize logic to the new location
  • resource replaces belongsTo and exposes a RelationshipDocument, no more async promises
  • collection replaces hasMany and exposes a RelationshipDocument, no more async promises

Constraints will be

  • these decorators do not work with classic ember syntax (e.g. Model.extend({ name: attr() }))
  • therefore these decorators do not work in mixins
  • probably some more things as we figure out how to interop with computed correctly

Implementation will be achieved by

  • the decorators will at install time pad additional information somewhere we can retrieve it. Existing schema extraction paths will be updated to pull from this information.
  • we will have to figure out how to make this work without instantiating a record class first

runspired avatar Sep 18 '23 22:09 runspired