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

Component#sendAction is deprecated #155

Open
xtagon opened this issue Mar 26, 2019 · 16 comments · Fixed by #180
Open

Component#sendAction is deprecated #155

xtagon opened this issue Mar 26, 2019 · 16 comments · Fixed by #180

Comments

@xtagon
Copy link

xtagon commented Mar 26, 2019

Hi,

I'm seeing deprecation warnings like these every time I drag and drop something in my Ember app. I only started seeing this after updating from Ember 2 to Ember 3.

Is there a way to fix these warnings? I am using closure actions.

deprecate.js:120 DEPRECATION: You called <my-ember-app@component:draggable-object::ember1505>.sendAction("action") but Component#sendAction is deprecated. Please use closure actions instead. [deprecation id: ember-component.send-action] See https://emberjs.com/deprecations/v3.x#toc_ember-component-send-action for more details.
        at logDeprecationStackTrace (http://localhost:4200/assets/vendor.js:49870:23)
        at HANDLERS.(anonymous function) (http://localhost:4200/assets/vendor.js:49964:11)
        at raiseOnDeprecation (http://localhost:4200/assets/vendor.js:49897:11)
        at HANDLERS.(anonymous function) (http://localhost:4200/assets/vendor.js:49964:11)
        at invoke (http://localhost:4200/assets/vendor.js:49976:11)
        at deprecate (http://localhost:4200/assets/vendor.js:49935:30)
        at Class.sendAction (http://localhost:4200/assets/vendor.js:45268:46)
        at Class.getObject (http://localhost:4200/assets/my-ember-app.js:5665:28)
        at Class.handlePayload (http://localhost:4200/assets/vendor.js:153712:41)

Thanks

@xtagon
Copy link
Author

xtagon commented Mar 26, 2019

I've traced it to here:

if (payload.ops.source) {
payload.ops.source.sendAction('action',payload.obj);
}
if (payload.ops.target) {
payload.ops.target.sendAction('action',payload.obj);
}

@dgavey
Copy link
Collaborator

dgavey commented Mar 27, 2019

Funny, I thought we had refactored all of these out. I'll try and get it fixed soon. Of course, PR's are always welcome.

@dgavey
Copy link
Collaborator

dgavey commented Mar 27, 2019

I don't think that model is even getting used anymore. That's legacy code.

@xtagon
Copy link
Author

xtagon commented Mar 27, 2019

Hmm that's funny. I'm using 0.6.3 in my package.json and yarn.lock:

ember-drag-drop@^0.6.3:
  version "0.6.3"
  resolved "https://registry.yarnpkg.com/ember-drag-drop/-/ember-drag-drop-0.6.3.tgz#65e2adfffd427875a0fb2e9f15f470dcad2e5d3d"
  integrity sha512-rVrJW66IjFdujdbxEm24lX8XbaqMdGyqIQsF5iEOUlxHttNA1Fyqr8tXb2dL5VSAl32jv9WhLuGBpsOPMlgvBQ==
  dependencies:
    ember-cli-babel "7.1.3"
    ember-jquery-legacy "^1.0.0"

which is the latest version on the releases page right now.

@xtagon
Copy link
Author

xtagon commented Mar 27, 2019

Always happy to help out with a PR but in this case I don't really understand how that code is used or how to safely remove it.

@dgavey
Copy link
Collaborator

dgavey commented Mar 27, 2019

No problem, yeah I need to look into this a bit more. I'm sure we don't need this model anymore, but I need to verify that.

@RobbieTheWagner
Copy link
Contributor

@dgavey do you guys still need help removing these? I'm getting the warnings in my code.

@bensane
Copy link

bensane commented Aug 28, 2020

Any update on this depreciation refactor?

@RobbieTheWagner
Copy link
Contributor

@dgavey please let me know if you need help removing these.

@dgavey
Copy link
Collaborator

dgavey commented Jan 4, 2021

@rwwagner90 If you want to create a PR for this, I'd happily merge and release a new version.

@RobbieTheWagner
Copy link
Contributor

@dgavey not sure if this works or not, but should fix the deprecation #180

@xtagon
Copy link
Author

xtagon commented Oct 16, 2023

Appears to be fixed in https://github.com/mharris717/ember-drag-drop/releases/tag/v0.9.0-beta.0 but it says once it's been declared stable there will be an 0.9 release, but that was in 2021. Is this project dead?

@RobbieTheWagner
Copy link
Contributor

@dgavey @mharris717 would you be interested in transferring this to adopted-ember-addons or adding some of us as maintainers here?

@dgavey
Copy link
Collaborator

dgavey commented Nov 3, 2023

Yes, but I don't own the repo. So I can't transfer it to you. I would suggest forking it instead and republishing, then I can shut this down and point to a different one. Maybe NPM can somehow also point to the new repo, not sure.

@RobbieTheWagner
Copy link
Contributor

Do you have any contact with @mharris717? Would he be willing to transfer it?

@dgavey
Copy link
Collaborator

dgavey commented Nov 6, 2023

I don't have any contact with him or ability to contact him anymore.

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

Successfully merging a pull request may close this issue.

4 participants