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

@ember/string deprecation warnings #853

Closed
Windvis opened this issue Jan 6, 2023 · 4 comments
Closed

@ember/string deprecation warnings #853

Windvis opened this issue Jan 6, 2023 · 4 comments

Comments

@Windvis
Copy link

Windvis commented Jan 6, 2023

I noticed that the ember-canary scenario started showing a lot of deprecation warnings which seemed to be triggered be this addon.

DEPRECATION: Importing from `@ember/string` without having the `@ember/string` package in your project is deprecated. Please add `@ember/string` to your `package.json [deprecation id: ember-string.add-package] This will be removed in ember-source 5.0.0. See https://deprecations.emberjs.com/v4.x/#toc_ember-string-add-package for more details.

import { dasherize, classify, underscore } from '@ember/string';

@kategengler
Copy link
Member

@Windvis Thanks for opening the issue! Handling this (and any other @ember/string deprecations in a new app) is my next step.

@kategengler
Copy link
Member

fixed by #862 and released in v10.0.0

@pzubar
Copy link

pzubar commented Feb 1, 2023

Thanks for this fix @kategengler!
Still, I have a question regarding the case when the only package that imports from @ember/string is ember-resolver. Should I still add @ember/string to my package.json to avoid getting the warning, or there is a better solution? Thank you in advance!

@kategengler
Copy link
Member

@pzubar @ember/string is a peerDependency, but not an optional one. ember-resolver requires @ember/string to be added to the host project to work correctly. It is a peer dependency rather than a dependency because many packages may use @ember/string but there should only be one copy of it to share the caches in @ember/string. See https://nodejs.org/es/blog/npm/peer-dependencies/ for more about peerDeps and #862 (comment) for more on why we chose a peerDep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants