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 Helper Functions #742

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions text/0742-ember-data-deprecate-helper-functions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
Stage: Accepted
Start Date: 2021-04-23
Release Date: Unreleased
Release Versions:
ember-source: vX.Y.Z
ember-data: vX.Y.Z
Relevant Team(s): ember-data
RFC PR: https://github.com/emberjs/rfcs/pull/742
---

# EmberData | Deprecate Helper Functions

## Summary

Deprecates the exported util functions `errorsHashToArray` `errorsArrayToHash`
and `normalizeModelName` that were recommended for deprecation by the [RFC#395 packages](https://github.com/emberjs/rfcs/blob/master/text/0395-ember-data-packages.md)

## Motivation

These utils are a legacy remnant of when parts of the codebase were shared with each other
by a `DS` global. Over time their utility has shrunk and today they no longer align with
the direction of [error management](https://github.com/emberjs/rfcs/blob/master/text/0465-record-data-errors.md) or [type constraints](https://github.com/emberjs/rfcs/pull/740).

## Detailed design

Users would receive a build-time deprecation when importing these methods using the paths
specified in [RFC#395 packages](https://github.com/emberjs/rfcs/blob/master/text/0395-ember-data-packages.md).

They would receive a run-time deprecation when using these methods via the `DS` global.

The deprecation would target `5.0` and would become `enabled` no-sooner than `4.1` (although
it may be made `available` before then).

Users making use of these methods can trivially copy them into their own codebase to continue
using them, though we recommend refactoring to a more direct conversion into the expected errors
format. For refactoring `normalizeModelName` we also recommend following [RFC#740 Deprecate Non-Strict Types](https://github.com/emberjs/rfcs/pull/740).

## How we teach this

Generally usage has not been widely observed and these are not methods commonly shown in
examples or docs. We should make sure to audit for usages and remove them if they exist.

## Drawbacks

A trivial amount of churn for users that did utilize them.

## Alternatives

Leave them to waste away.