Conversation
b682005 to
ff2571f
Compare
6eeabf5 to
11a1b3b
Compare
Owner
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Merged
e4c7db2 to
44caf90
Compare
271c3c7 to
dd6a959
Compare
db27b18 to
80c7345
Compare
27214fa to
8e07a06
Compare
0b13a09 to
9732607
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Why
The upstream bottleneck library is no longer maintained, and its CoffeeScript source + ES5-targeted toolchain are increasingly out of step with the modern Node.js ecosystem. This PR rewrites the codebase and tooling so the fork can be a long-lived, easier-to-contribute-to home for further work (eventually a native TypeScript port).
What changes
This is a large diff but most of it is mechanical (CoffeeScript → JS, test renames, toolchain swaps). The runtime behavior is unchanged — same scheduling/limiting semantics, same job lifecycle, same events. The API surface does change in a few intentional v4 ways (see Breaking changes below), mostly around how Redis clients are wired in and the removal of the ES5 build.
Source modernization
src/to modern JS viadecaffeinate, then committed the JS as the source of truth (CoffeeScript is removed from the repo and the build).src/cluster/(datastore, connections, Lua scripts,Scripts.js) so the local-only "light" build no longer needs to know about Redis. Public exports are unchanged.redisv2/v3 client API; cluster mode now requiresredisv4+ (and works with v5) orioredisv5+.ioredisandredisoptional peer dependencies — the library no longer implicitlyrequire()s a Redis client; consumers bring their own and pass aRedisconstructor (or pre-builtclient/connection).Toolchain
oxlint,oxfmt) — the project previously had no lint or format tooling.es5.js/light.jsRollup configs with a singletsdown.config.ts. The ES5 build is removed; the UMD@sderrow/bottleneck/lightbuild remains for browser/non-Node consumers.tsconfig.json,.oxlintrc.json,.oxfmtrc.json,.nvmrc, and a Husky + lint-staged pre-commit hook..github/workflows/ci.yaml) plus a reusable setup composite action.Tests
vitest.config.tsdefining separate projects (local,ioredis,node-redis,light-smoke,memory).*.test.jsconvention and split the monolithiccluster.js/general.jsinto focused files (cluster.test.js,cluster-coordination.test.js,general.test.js,general-traffic.test.js, etc.).test/helpers/(limiter setup, call logging, job tracking, state waiting) and added Testcontainers-based Redis fixtures (global-setup-redis.ts) so cluster tests no longer depend on a manually-run Redis instance.test/smoke/andtest/memory/.Packaging
4.0.0-rc.0and renamed the package to@sderrow/bottleneck.exportsmap exposes.and./lightwith sharedbottleneck.d.tstypes;dist/is the published build output.Breaking changes (v4)
require("bottleneck/es5")is gone — use@sderrow/bottleneck/lightif you need a UMD build.redisv4+ orioredisv5+.ioredis/redismust be installed by the consumer (peer deps).Redisconstructor option is required whendatastoreis"redis"/"ioredis"unless you pass a pre-builtclientorconnection.src/cluster/(only matters if you imported from internal paths).Follow-ups (out of scope)
src/.