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

[BREAKING] Replace deprecated implicit injections with explicit injections #367

Merged
merged 6 commits into from
Jan 5, 2022

Conversation

dgeb
Copy link
Member

@dgeb dgeb commented Jan 5, 2022

See https://deprecations.emberjs.com/v3.x#toc_implicit-injections for details about ember's deprecation.

A new utility method has been added, applyStandardSourceInjections, which can be invoked to apply standard injections (schema, keyMap, normalizer, and validatorFor) to a source during construction. Alternatively, these injections can also be applied on a per-source basis.

This should be considered a breaking change because applyStandardSourceInjections must now be invoked for previously defined sources other than the store.

For instance:

// /app/data-sources/remote.js
import SourceClass from '@orbit/jsonapi';
import { applyStandardSourceInjections } from 'ember-orbit';

export default {
  create(injections = {}) {
    applyStandardSourceInjections(injections);
    injections.name = 'remote';
    return new SourceClass(injections);
  }
};

…tions

See https://deprecations.emberjs.com/v3.x#toc_implicit-injections for details about ember's deprecation.

A new utility method has been added, `applyStandardSourceInjections`, which can be invoked to apply standard injections (`schema`, `keyMap`, `normalizer`, and `validatorFor`) to a source during construction. Alternatively, these injections can also be applied on a per-source basis.

This should be considered a breaking change because `applyStandardSourceInjections` must now be invoked for previously defined sources other than the `store`.
@dgeb dgeb added the breaking label Jan 5, 2022
@dgeb dgeb merged commit 9b0b1ec into main Jan 5, 2022
@dgeb dgeb deleted the implicit-injections branch January 5, 2022 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant