Closed TzviPM closed 7 years ago
CC @lemonmade as an FYI, but maybe best not to review, since we worked on this together.
Hey. Won't find time to review this. I will add another reviewer :)
This means all the consumers who were using autobind()
will now have to use bind()
, correct?
If that holds true, then this will be a breaking change to consumers. i.e a v2.0.0
bump.
I think it's time we add a CHANGELOG.md
for this repo. Do you mind adding one? I guess we can leave a Pre-2.0.0
sections that has a comment mention we didn't keep a changelog pre-2.0.0
Am I reading it right that we are just importing and exporting lodash-decorators
's bind
, debounce
and memoize
?
If this is the case, why don't we just use lodash-decorators
directly in neutron
and polaris
instead ?
@ismail-syed, @autobind should still work as normal. bind
is being used as the default export, so any name will do. Also, note that I export bind()
, not bind
, in order to keep a consistent interface with our autobind
.
@michelleyschen I feel it's better to use our own abstraction around this for 2 reasons:
core-decorators
fixed its issues with typescript, it may make more sense to use their autobind
decorator instead of the bind
decorator in lodash-decorators
.Also, @ismail-syed, what are your thoughts about moving autobind
to the decorators
folder? Is there a reason it isn't there now? legacy reasons, maybe?
what are your thoughts about moving autobind to the decorators folder?
I'm pretty sure this one will need consumers to update since the paths will be @shopify/javascript-utilities/decorators
.
I don't know the original reason, but I think it should be there since it's used as a decorator. It might have originally been in root as a mistake.
We went with
lodash-decorators
(including typings), because thecore-decorators
versions or debounce and memoize are deprecated, and the version ofautobind
doesn't work properly with typescript.