Skip to content

v3.1.0

Compare
Choose a tag to compare
@zero734kr zero734kr released this 26 Oct 21:12
· 8 commits to stable since this release
0ecf8cb

Breaking Changes (Summary)

  • v3.1 only compatible with Node.js v16.6 or above.
  • v3.1 only compatible with discord.js v13 or above.
  • Performance improvements by using undici instead of node-fetch.
  • Cache policy changed.
  • Discord#inviteUrl has been renamed to Discord#url.
  • The invite url format of Discord#url has been changed from https://discord.gg/<code> to https://discord.com/invite/<code>.
  • Added support for servers list. It is accessible with koreanbots.servers.fetch(). (Canceled in this version)

Dependency Changes

  • Removed dependencies related with commitlint because it was the root of the vulnerability alert, as they never (or sometimes?) published new versions with the update of their vulnerable dependencies.
  • node-fetch has been removed in favor of undici.
  • The abort-controller package has been removed in favor of the native Node.js v16 AbortController API.
  • All dependencies have been updated to the latest version.

Why undici instead of node-fetch?

  • node-fetch is not compatible with CJS imports from v3.

node-fetch/node-fetch#1263
sindresorhus/meta#15 (comment)

  • undici is faster than node-fetch. see benchmark results
  • undici is maintained by contributors of nodejs.

Why Node.js v16.6 or above?

With undici being used, koreanbots JS/TS SDK v3.1 will only be compatible with nodejs v16.6 and above, because undici only supports above that. Therefore, the sdk will only be compatible with discord.js v13 above.

LimitedCollection of discord.js and changed cache policies

LifetimeCollection removed in favor of LimitedCollection from discord.js

  • BREAKING: Cache policies have been changed as LimitedCollection only supports sweeping at certain intervals, so instead of maxAge being applied to all values ​​each by themselves, they will all be deleted after a few intervals , regardless of just entered the cache store.
  • max has been renamed to maxSize with use of LimitedCollection
  • maxAge has been renamed to sweepInterval with use of LimitedCollection, changing the cache policy as mentioned above.

What's Changed

Full Changelog: 3.1.0-rc.1...3.1.0