-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Deprecate the use of map/fiter/reduce (see #505) #856
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 the use of map/fiter/reduce (see #505) #856
Conversation
function deprecateFunction(RecordPrototype, functionName) { | ||
RecordPrototype[functionName] = function(...params) { | ||
console.warn(`Record${functionName} has been deprecated. See https://github.com/facebook/immutable-js/issues/505 for more details`); | ||
return KeyedCollection.prototype[functionName].call(this, ...params); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have used super to access KeyedCollection prototype, but the transpiler refuses it.
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
// https://github.com/facebook/immutable-js/issues/505 | ||
function deprecateFunction(RecordPrototype, functionName) { | ||
RecordPrototype[functionName] = function(...params) { | ||
console.warn(`Record${functionName} has been deprecated. See https://github.com/facebook/immutable-js/issues/505 for more details`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like you're missing a separator between Record
and the ${functionName}
, otherwise it will be parsed into: Recordfilter
😊
It looks like this PR has been abandoned since that last comment never got any response. I am going to close it under that theory but if you are still interested in working on this please feel free to reopen! |
Hey, sorry for not updating before, since I didn't get any feedback on the PR, I dropped it! I amended my commit, but I think that since you closed the PR, it doesn't show up anymore. I can rebase my branch on top of master if you want! |
OK let's see what we should do here. I guess one question is how we should handle deprecations. I don't think the approach of doing a |
As said in #505 some functions of Record don't behave as expected. They plan to be removed, but for now, it's confusing for anyone not aware of the problem (you can easily lose a couple of hours because of that), so warning the user should be reasonable way to let them know.
You mention "other API methods", but not knowing which ones you're talking about, I'll add them later if needed :)