-
Notifications
You must be signed in to change notification settings - Fork 362
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
Deprecate model hooks and events #473
Conversation
I added one more commit to fix @raymondfeng @ritch ping, is this good to be merged? |
List of deprecated hooks: - beforeValidate - afterValidate - beforeCreate - afterCreate - beforeSave - afterSave - beforeUpdate - afterUpdate - beforeDestroy - afterDestroy Also add a lightweight browser version of "depd", because the "depd" does not support browser and it is not trivial to fix that. This commits adds a lightweight implementation of depd's "deprecate" function.
List of deprecated events: - changed - deleted - deletedAll
edc52f1
to
37d7721
Compare
I made one more change. Initially, event deprecation messages were printed at the time when the deprecated event was emitted. That's a wrong approach, because The PR is ready for review and merge. |
LGTM |
…-and-events Deprecate model hooks and events
@crandmck could you please update the docs and reword the warning to a deprecation note? http://docs.strongloop.com/display/LB/Model+hooks I am not sure if the we have the model events ( |
Added deprecation notice. I removed
Also removed the following events from http://docs.strongloop.com/display/LB/Events and http://docs.strongloop.com/display/LB/Basic+model+object:
@bajtos Please confirm that is correct, and I will also remove from http://apidocs.strongloop.com/loopback/#model. |
@crandmck Thank you.
Yes please,
Can that page mention that there are Operation hooks that should (and can) be used instead of the deprecated events? Also perhaps the page http://docs.strongloop.com/display/LB/Basic+model+object should link to "Operation hooks" instead of "Model hooks"? |
OK, added note about afterInitialize, and note about using operation hooks instead of the deprecated events. |
Deprecate the following Model hooks:
Deprecate the following Model events:
Closes strongloop/loopback#617.
/to @raymondfeng @ritch please review