bullmq icon indicating copy to clipboard operation
bullmq copied to clipboard

refactor: remove redundant AC polyfill and use built-in UUID generator

Open v1rtl opened this issue 10 months ago • 9 comments

Why

  1. AbortController has been available since Node 14.17, there is no longer a need to polyfill it. Node 12 has been EOL for quite some time and is considered dangerous to use. There is no longer a need for uuid as a package, since Node 16.7.0 the crypto module provides a safe generator for UUIDs.
  2. Smaller supply chain, avoidance of downloading and loading unnecessary polyfills.

How

Removed both of the packages and replaced them with native functionality.

Additional Notes (Optional)

Tests pass locally on Node 18 / 20 / 22. Can't test on Node 16 because corepack is not compatible with it.

v1rtl avatar Feb 10 '25 09:02 v1rtl

Thanks. Always great to get rid of dependencies!

manast avatar Feb 10 '25 10:02 manast

oops, forgot to replace uuid in tests, gimme a moment

v1rtl avatar Feb 10 '25 10:02 v1rtl

it seems like there are still some references to the uuid module. Btw, we will need to decide if this can be merged in current major version or if we will need to make a breaking release as there are potential users out there using lower than 16 in production.

manast avatar Feb 10 '25 10:02 manast

it seems like there are still some references to the uuid module. Btw, we will need to decide if this can be merged in current major version or if we will need to make a breaking release as there are potential users out there using lower than 16 in production.

I'd say a breaking change would be better, as well as settings engines.node to >=16.7

or in case you'd like to drop all EOL, >=18

v1rtl avatar Feb 10 '25 10:02 v1rtl

@manast do I set the engines.node field to Node 16? or there is a better approach

v1rtl avatar Mar 03 '25 09:03 v1rtl

I think the engines.node is the most established way of doing this.

manast avatar Mar 03 '25 09:03 manast

@manast just added engines.node

v1rtl avatar Mar 03 '25 10:03 v1rtl

Is there anything to be done on this PR besides conflict merging?

v1rtl avatar Apr 26 '25 09:04 v1rtl

Is there anything to be done on this PR besides conflict merging?

No, but it is a breaking change so we must wait until next major release.

manast avatar May 03 '25 07:05 manast