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

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

Open
runspired opened this issue Sep 18, 2023 · 0 comments
Labels
🏷️ feat This PR introduces a new feature v4-to-v5 Tickets related to v4 to v5 migration paths

Comments

@runspired
Copy link
Contributor

runspired commented Sep 18, 2023

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 runspired added 🏷️ feat This PR introduces a new feature v4-to-v5 Tickets related to v4 to v5 migration paths labels Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ feat This PR introduces a new feature v4-to-v5 Tickets related to v4 to v5 migration paths
Projects
Status: needs champion
Development

No branches or pull requests

1 participant