-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
unfixable deprecation issue [deprecation id: ember-string.add-package] #370
Comments
@st-h I believe in this case the deprecations are likely coming from an addon that itself needs to have |
@kategengler thanks for the reply. Yes, I have plenty of stacktraces. Usually more than 1.500 when the app is rendered once. The problem is that they only reference the content of my vendor.js file and I need to go into the js file and try to find out what add-on the source I am looking at might belong to. I have tried a few and they all seem to come from different addons. I am not totally sure about this, but they sometimes could even stem from ember itself. Here is one:
When I add this code to my application routes constructor, I can filter out most of them. Then I end up with around 150 stacktraces when initially rendering the app:
I have no clue why some still remain, though... |
@st-h You can use On the version ember-source in which we added the deprecation, no code in Ember itself uses the deprecated code. The stacktrace you posted looks like it is coming from |
Ok, probably it would be good to update the docs and remove the registerDeprecationHandler stuff, if that no longer works reliably? Yes, I can confirm both:
If I understand what I read correctly, it seems to happen that both implementations - ember internal and @ember/string - get mixed up and it is not clear when which implementation is being used, which leads to the deprecation warnings being printed. |
I don't believe the implementations ever were mixed up but that when any addon previous brought in Even with the correct versions in your app, the deprecations can show up when addons are using those ember string methods without having |
I don't think the addon reliably wins over ember's internal deprecated version. And the deprecation message is misleading. It doesn't really have any package-awareness. If the addon was reliably winning, adding The way to debug this is to look at all the places in your All of that goes for classic builds. Under embroider, packages that declare a dependency on the addon should reliably get the addon. (EDIT to add: as long as you disable the part of the compat system that is mimicking the bad old behavior, by setting staticAddonTrees to true.) |
@ef4 I tested a bunch with classic builds when I implemented the deprecation -- having @st-h Trying 5.0 via the |
@kategengler unfortunately, that is not an easy thing to do. I started patching a few addons to make them ember 5 compatible, but more and more keep popping up. And as things look, there is no real alternative to removing embers internal implementation of the string package, right? So, all I can do is bear with the massive deprecation warnings until v5 is ready and out - unless there will be a v4 release that removes the duplicate implementation, which will likely solve a few headaches for other people as well. |
@st-h v4 cannot remove the internal implementation, it would be a breaking change. I want to be sure that v5 will solve your problem, which, right now, I am not sure it will. I've tried to reproduce this in a clean app (starting with |
@kategengler I understand that. However, at this moment in time, given the state the ember ecosystem is in, it is not possible for me to provide that information. First, there is no documentation I am aware of, so I need to encounter every breaking change by trial and error. Then I need to find a way to fix those issues. Then I need to patch all the addons in my app, that are not ember v5 compatible. Then there are addons that simply do not link locally, which makes it very difficult to patch them.
I think a branch where the duplicated implementation is removed could be a good way forward, if you want to further investigate this. Building ember locally would certainly be easier than to fix all the quirks that exist in often quite popular addons that our app relies on. I am absolutely ok with the deprecations that remain after applying registerDeprecationHandler until v5 is out. But I am happy to help, if I can. |
Any updates on this? I have a project that started throwing hundred of ember/string deprecation warnings even when ember/string is a dev dependency. Here a list of the main project dependencies
Downgrading Following up one of the multiple stack trace errors, I traced one down to
The weird thing is that |
Alright, took some time to create reproduction steps. Here is the repo that reproduces this error The steps taken to create were: new ember project, upgraded all dependencies, added fastboot. Only after adding fastboot the issue happens. |
There's an ordering issue. Right now, the only option is to silence the deprecation with something like ember-cli-deprecation-workflow, but we are working on a fix to make the deprecation solveable. |
Another case of this is in ember-classic-decorator. I haven't found a workaround and I removed |
@boris-petrov I just reproduced this -- the @ember/string deprecation isn't exactly why |
@kategengler yes, I noticed it's not the same. Are you saying that actually the deprecation warnings that are triggered on Ember 4 because of |
@boris-petrov Yes. The |
After upgrading to ember 4.10, I noticed that I am seeing thousands of this deprecation warnings when my app boots up. I checked and to my surprise I was having
"@ember/string": "^3.0.1"
withindevDependencies
in mypackage.json
. A discussion on discord pointed be to @ef4 comment: #235 (comment)Looks like this is describing a similar issue, where it is unclear which implementation (ember-string vs ember internals) is being used.
Is there anything that can be done other waiting for ember to remove its own implementation, or manually silence deprecation warnings?
Additionally it looks like in this case the deprecation message is quite misleading - however, I guess that is part of ember and not ember-string?
The text was updated successfully, but these errors were encountered: