node-rate-limiter-flexible icon indicating copy to clipboard operation
node-rate-limiter-flexible copied to clipboard

docs and naming are using `memcache` and not `memcached`

Open avifenesh opened this issue 9 months ago • 6 comments

Title. Just a typo, but breaking changes...

avifenesh avatar Mar 19 '25 16:03 avifenesh

Hi @avifenesh Could you clarify? Would you like to rename RateLimiterMemcache to RateLimiterMemcached (with d at the end) ?

animir avatar Mar 21 '25 09:03 animir

It should be with Memcached since this is the right name. But if your users are already using RateLimiterMemcache renaming will break the code. So it's your call, I'm just pointing it out. If you are ok with breaking changes (maybe using a new major) I can make the changes.

avifenesh avatar Mar 21 '25 09:03 avifenesh

Could we support both names and deprecate the one with typo?

animir avatar Mar 21 '25 09:03 animir

Hmm we can, yes. It is just duplicating the files, renaming, and adding @depracted on top of the old docs

avifenesh avatar Mar 21 '25 09:03 avifenesh

Or it can be extended from the renamed class like:

class RateLimiterMemcache extends RateLimiterMemcached {
  constructor(options) {
    super(options);

    console.warn(
      'RateLimiterMemcache is deprecated and will be removed in a future version. ' +
      'Please use RateLimiterMemcached instead.'
    );
  }
}

I guess it should work in javascript as there is no real private methods or variables in classes inheritance.

animir avatar Mar 21 '25 10:03 animir

True, probably better

avifenesh avatar Mar 21 '25 12:03 avifenesh