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

rfc: ember-data | deprecate-model-reopen #738

Merged

Conversation

runspired
Copy link
Contributor

Full Text: Rendered

@runspired runspired added T-ember-data RFCs that impact the ember-data library T-deprecation labels Apr 24, 2021
Copy link
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed today in the ember-data meeting, and we are 👍👍 with moving this forward into final comment period.

new model types or (better) utilize a megamorphic solution such as ember-m3 to achieve their needs.

In all cases, using `reopen` after a class instance for a record has already been created has *always*
resulted in at least minor and potentially major errors in application state.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we could expand on this? Are examples you have seen involve messing with some of the Model states? Overall, I think we can help user's understand a specific case where reopen may have lead them astray.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically there are three issues though I don't think they need to be laid out here in the rfc text itself:

  1. is that we cache the metas for relationships and attributes, so if a reopen were to redefine a relationship (or add a potential resolvable inverse to a relationship where none was before) then those definitions would likely not get applied to new instances as expected (we'd use old metas anywhere we pulled from cache which is most places).

  2. is that existing instantiated relationships don't get reconfigured which means that if their definition has been changed they are now potentially a significantly different shape.

  3. is a subset of (1). Serialization and normalization typically breaks because eachAttribute/eachRelationship will often be missing necessary definitions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Final Comment Period T-deprecation T-ember-data RFCs that impact the ember-data library
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants