Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: redis/ioredis
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.28.5
Choose a base ref
...
head repository: redis/ioredis
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v5.0.0
Choose a head ref

Commits on Mar 14, 2022

  1. feat: Refactor code with modern settings

    BREAKING CHANGE: We now require Node.js v10.12.0 or newer.
    * We now only work with Redis v3.0.0 or newer.
    * `Redis` can't be called as a function anymore as it's now a class.
    Please change `Redis()` to `new Redis()`. Note that `Redis()` was already deprecated
    in the previous version.
    luin committed Mar 14, 2022
    Copy the full SHA
    a8ffa80 View commit details
  2. Copy the full SHA
    649d4d4 View commit details
  3. feat: drop support of third-party Promise libraries

    BREAKING CHANGE: Support for third-party Promise libraries is dropped. Related methods (`exports.Promise = require('bluebird')`) are kept but they don't take any effects. The native Promise will always be used.
    luin committed Mar 14, 2022
    5
    Copy the full SHA
    2001ec6 View commit details
  4. Copy the full SHA
    4e8c567 View commit details
  5. Copy the full SHA
    1e10c95 View commit details
  6. fix: Reset loaded script hashes to force a reload of scripts after re…

    …connect of redis
    marcbachmann authored and luin committed Mar 14, 2022
    Copy the full SHA
    60c2af9 View commit details
  7. Copy the full SHA
    bc1b168 View commit details
  8. feat: Pipeline-based script loading

    marcbachmann authored and luin committed Mar 14, 2022
    Copy the full SHA
    8df6ee2 View commit details
  9. Copy the full SHA
    bacf5a6 View commit details
  10. fix: improve typing for pipeline

    luin committed Mar 14, 2022
    Copy the full SHA
    d18f3fe View commit details
  11. feat: drop support of Node.js 10

    luin committed Mar 14, 2022
    Copy the full SHA
    f9a5071 View commit details
  12. chore: upgrade dev dependencies

    luin committed Mar 14, 2022
    Copy the full SHA
    df9330b View commit details
  13. Copy the full SHA
    d1d9dba View commit details
  14. Copy the full SHA
    80b3410 View commit details
  15. chore: Reduce amount of command args iterations

    The happy case should be slightly faster that way when there are multiple arguments
    marcbachmann authored and luin committed Mar 14, 2022
    Copy the full SHA
    fa4495f View commit details
  16. Copy the full SHA
    a29d9c4 View commit details
  17. Copy the full SHA
    7a436b1 View commit details
  18. chore: refactor tests

    luin committed Mar 14, 2022
    Copy the full SHA
    48ca227 View commit details
  19. Copy the full SHA
    94c1e24 View commit details
  20. Copy the full SHA
    334242b View commit details
  21. Copy the full SHA
    d5c2f20 View commit details
  22. chore: add API docs

    luin committed Mar 14, 2022
    Copy the full SHA
    816942f View commit details
  23. chore: update LICENSE date

    luin committed Mar 14, 2022
    Copy the full SHA
    e00d8d8 View commit details
  24. chore: update links to docs

    luin committed Mar 14, 2022
    Copy the full SHA
    756e1a7 View commit details
  25. Copy the full SHA
    06782e6 View commit details
  26. feat: add tests for cluster

    luin committed Mar 14, 2022
    Copy the full SHA
    1eba58b View commit details
  27. feat: skip ready check on NOPERM error

    Closes #1293
    
    BREAKING CHANGE: `Redis#serverInfo` is removed. This field is never documented so
    you very likely have never used it.
    luin committed Mar 14, 2022
    Copy the full SHA
    b530a0b View commit details
  28. Copy the full SHA
    747dd30 View commit details
  29. feat: add @SInCE to method comments

    luin committed Mar 14, 2022
    Copy the full SHA
    13eff8e View commit details
  30. Copy the full SHA
    aa3b3e9 View commit details
  31. Copy the full SHA
    687d3eb View commit details
  32. Copy the full SHA
    6b0dc1e View commit details
  33. docs: update API document

    luin committed Mar 14, 2022
    Copy the full SHA
    bafc2bf View commit details
  34. chore: rename package files

    luin committed Mar 14, 2022
    Copy the full SHA
    e93b39a View commit details
  35. Copy the full SHA
    53ca412 View commit details
  36. Copy the full SHA
    32eb381 View commit details
  37. Copy the full SHA
    04e68ac View commit details
  38. feat: always parse username passed via URI

    BREAKING CHANGE: `allowUsernameInURI` is removed and ioredis will always
    use the username passed via URI.
    Previously, the `username` part in `new Redis("redis://username:authpassword@127.0.0.1:6380/4")`
    was ignored unless `allowUsernameInURI` is specified: `new Redis("redis://username:authpassword@127.0.0.1:6380/4?allowUsernameInURI=true")`.
    Now, if you don't want to send username to Redis, just leave the username part empty:
    `new Redis("redis://:authpassword@127.0.0.1:6380/4")`
    luin committed Mar 14, 2022
    Copy the full SHA
    c6f41f6 View commit details
  39. docs: add example for Express

    luin committed Mar 14, 2022
    Copy the full SHA
    ccad22c View commit details
  40. chore(pipeline): Do not opt out of text concat performance optimizati…

    …on for mixed buffer and text based commands
    marcbachmann authored and luin committed Mar 14, 2022
    Copy the full SHA
    9afaac0 View commit details
  41. Copy the full SHA
    3261908 View commit details
  42. Copy the full SHA
    56081c7 View commit details
  43. Copy the full SHA
    ea77406 View commit details
  44. Copy the full SHA
    ba49eba View commit details
  45. Copy the full SHA
    c1c4c76 View commit details
  46. Copy the full SHA
    c267e16 View commit details
  47. Copy the full SHA
    f293b97 View commit details
  48. Copy the full SHA
    7b98355 View commit details
  49. Copy the full SHA
    46ade6b View commit details
  50. refactor: clean types warnings

    gkorland authored and luin committed Mar 14, 2022
    Copy the full SHA
    b02cc58 View commit details
Showing with 45,852 additions and 7,577 deletions.
  1. +0 −9 .dockerignore
  2. +0 −3 .eslintignore
  3. +73 −0 .eslintrc.json
  4. +0 −42 .eslintrc.yml
  5. +0 −46 .github/workflows/main.yml
  6. +9 −0 .github/workflows/push-requests.yml
  7. +27 −0 .github/workflows/release.yml
  8. +54 −0 .github/workflows/test.yml
  9. +5 −1 .gitignore
  10. +0 −2 .npmrc
  11. +16 −36 .releaserc.json
  12. +0 −53 .travis.yml
  13. +0 −492 API.md
  14. +149 −0 Changelog.md → CHANGELOG.md
  15. +1 −1 LICENSE
  16. +116 −85 README.md
  17. +1 −1 benchmarks/autopipelining-single.ts
  18. +1 −1 benchmarks/dropBuffer.ts
  19. +1 −1 benchmarks/errorStack.ts
  20. +11 −0 bin/argumentTypes.js
  21. +48 −0 bin/index.js
  22. +39 −0 bin/overrides.js
  23. +340 −0 bin/returnTypes.js
  24. +76 −0 bin/template.ts
  25. +21 −0 bin/typeMaps.js
  26. +1 −0 docs/.nojekyll
  27. +85 −0 docs/assets/highlight.css
  28. +1,043 −0 docs/assets/icons.css
  29. BIN docs/assets/icons.png
  30. BIN docs/assets/icons@2x.png
  31. +52 −0 docs/assets/main.js
  32. +1 −0 docs/assets/search.js
  33. +1,413 −0 docs/assets/style.css
  34. BIN docs/assets/widgets.png
  35. BIN docs/assets/widgets@2x.png
  36. +2,457 −0 docs/classes/Cluster.html
  37. +2,479 −0 docs/classes/default.html
  38. +1 −0 docs/index.html
  39. +46 −0 docs/interfaces/CommonRedisOptions.html
  40. +1 −0 docs/interfaces/SentinelAddress.html
  41. +5 −0 docs/interfaces/SentinelConnectionOptions.html
  42. +4 −4 examples/basic_operations.js
  43. +0 −2 examples/custom_connector.js
  44. +21 −0 examples/express/README.md
  45. +41 −0 examples/express/app.js
  46. +90 −0 examples/express/bin/www
  47. +2,228 −0 examples/express/package-lock.json
  48. +17 −0 examples/express/package.json
  49. +8 −0 examples/express/public/stylesheets/style.css
  50. +7 −0 examples/express/redis.js
  51. +11 −0 examples/express/routes/index.js
  52. +17 −0 examples/express/routes/users.js
  53. +6 −0 examples/express/views/error.jade
  54. +10 −0 examples/express/views/index.jade
  55. +7 −0 examples/express/views/layout.jade
  56. +7 −0 examples/express/views/users.jade
  57. +35 −0 examples/hash.js
  58. +26 −0 examples/list.js
  59. +12 −0 examples/module.js
  60. +6 −5 examples/redis_streams.js
  61. +19 −0 examples/set.js
  62. +49 −0 examples/stream.js
  63. +39 −0 examples/string.js
  64. +36 −0 examples/typescript/package-lock.json
  65. +13 −0 examples/typescript/package.json
  66. +39 −0 examples/typescript/scripts.ts
  67. +23 −0 examples/zset.js
  68. +166 −180 lib/{command.ts → Command.ts}
  69. +39 −30 lib/DataHandler.ts
  70. +394 −0 lib/Pipeline.ts
  71. +819 −0 lib/Redis.ts
  72. +3 −13 lib/ScanStream.ts
  73. +71 −0 lib/Script.ts
  74. +3 −6 lib/SubscriptionSet.ts
  75. +8 −13 lib/autoPipelining.ts
  76. +21 −14 lib/cluster/ClusterOptions.ts
  77. +18 −19 lib/cluster/ClusterSubscriber.ts
  78. +22 −30 lib/cluster/ConnectionPool.ts
  79. +6 −20 lib/cluster/DelayQueue.ts
  80. +301 −322 lib/cluster/index.ts
  81. +10 −12 lib/cluster/util.ts
  82. +0 −244 lib/commander.ts
  83. +6 −6 lib/connectors/AbstractConnector.ts
  84. +7 −0 lib/connectors/ConnectorConstructor.ts
  85. +5 −5 lib/connectors/SentinelConnector/FailoverDetector.ts
  86. +8 −7 lib/connectors/SentinelConnector/SentinelIterator.ts
  87. +58 −51 lib/connectors/SentinelConnector/index.ts
  88. +7 −7 lib/connectors/SentinelConnector/types.ts
  89. +12 −25 lib/connectors/StandaloneConnector.ts
  90. +4 −2 lib/constants/TLSProfiles.ts
  91. +2 −0 lib/errors/ClusterAllFailedError.ts
  92. +58 −10 lib/index.ts
  93. +0 −449 lib/pipeline.ts
  94. +0 −21 lib/promiseContainer.ts
  95. +106 −16 lib/redis/RedisOptions.ts
  96. +5 −9 lib/redis/event_handler.ts
  97. +0 −889 lib/redis/index.ts
  98. +0 −59 lib/script.ts
  99. +17 −5 lib/transaction.ts
  100. +19 −8 lib/types.ts
  101. +207 −0 lib/utils/Commander.ts
  102. +14,972 −0 lib/utils/RedisCommander.ts
  103. +15 −0 lib/utils/applyMixin.ts
  104. +24 −95 lib/utils/index.ts
  105. +1 −2 lib/utils/lodash.ts
  106. +15,311 −2,494 package-lock.json
  107. +46 −48 package.json
  108. BIN resources/ts-screenshot.png
  109. +151 −0 test/cluster/basic.ts
  110. +19 −0 test/cluster/docker/Dockerfile
  111. +4 −0 test/cluster/docker/main.sh
  112. +0 −11 test/docker/Dockerfile
  113. +0 −21 test/docker/main.sh
  114. +0 −14 test/docker/worker.sh
  115. +45 −46 test/functional/auth.ts
  116. +2 −2 test/functional/autopipelining.ts
  117. +12 −12 test/functional/cluster/ask.ts
  118. +8 −8 test/functional/cluster/autopipelining.ts
  119. +6 −6 test/functional/cluster/clusterdown.ts
  120. +57 −99 test/functional/cluster/connect.ts
  121. +6 −7 test/functional/cluster/disconnection.ts
  122. +2 −2 test/functional/cluster/dnsLookup.ts
  123. +1 −1 test/functional/cluster/duplicate.ts
  124. +65 −65 test/functional/cluster/index.ts
  125. +3 −3 test/functional/cluster/maxRedirections.ts
  126. +25 −25 test/functional/cluster/moved.ts
  127. +34 −34 test/functional/cluster/pipeline.ts
  128. +11 −11 test/functional/cluster/pub_sub.ts
  129. +1 −1 test/functional/cluster/quit.ts
  130. +41 −0 test/functional/cluster/scripting.ts
  131. +4 −4 test/functional/cluster/tls.ts
  132. +13 −13 test/functional/cluster/transaction.ts
  133. +5 −5 test/functional/cluster/tryagain.ts
  134. +5 −5 test/functional/commandTimeout.ts
  135. +28 −99 test/functional/connection.ts
  136. +7 −7 test/functional/disconnection.ts
  137. +0 −133 test/functional/drop_buffer_support.ts
  138. +1 −1 test/functional/duplicate.ts
  139. +5 −5 test/functional/elasticache.ts
  140. +8 −8 test/functional/exports.ts
  141. +3 −3 test/functional/fatal_error.ts
  142. +5 −5 test/functional/hgetall.ts
  143. +21 −21 test/functional/lazy_connect.ts
  144. +6 −6 test/functional/maxRetriesPerRequest.ts
  145. +20 −15 test/functional/monitor.ts
  146. +89 −88 test/functional/pipeline.ts
  147. +0 −26 test/functional/promise.ts
  148. +22 −31 test/functional/pub_sub.ts
  149. +40 −15 test/functional/ready_check.ts
  150. +21 −21 test/functional/reconnect_on_error.ts
  151. +99 −171 test/functional/scan_stream.ts
  152. +157 −86 test/functional/scripting.ts
  153. +6 −6 test/functional/select.ts
  154. +84 −42 test/functional/send_command.ts
  155. +100 −100 test/functional/sentinel.ts
  156. +8 −8 test/functional/sentinel_nat.ts
  157. +3 −3 test/functional/show_friendly_error_stack.ts
  158. +19 −27 test/functional/string_numbers.ts
  159. +17 −17 test/functional/tls.ts
  160. +21 −21 test/functional/transaction.ts
  161. +25 −37 test/functional/transformer.ts
  162. +7 −7 test/functional/watch-exec.ts
  163. +4 −4 test/helpers/global.ts
  164. +7 −8 test/helpers/mock_server.ts
  165. +0 −28 test/helpers/once.ts
  166. +33 −1 test/helpers/util.ts
  167. +108 −0 test/typing/commands.test-d.ts
  168. +41 −0 test/typing/options.test-d.ts
  169. +17 −0 test/typing/pipeline.test-d.ts
  170. +2 −11 test/unit/autoPipelining.ts
  171. +28 −13 test/unit/clusters/index.ts
  172. +17 −17 test/unit/command.ts
  173. +6 −6 test/unit/commander.ts
  174. +10 −10 test/unit/debug.ts
  175. +3 −3 test/unit/index.ts
  176. +6 −6 test/unit/pipeline.ts
  177. +20 −20 test/unit/redis.ts
  178. +83 −140 test/unit/utils.ts
  179. +11 −11 tsconfig.json
9 changes: 0 additions & 9 deletions .dockerignore

This file was deleted.

3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

73 changes: 73 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"ignorePatterns": ["bin/generateRedisCommander/template.ts"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"env": { "node": true },
"rules": {
"prefer-rest-params": 0,
"no-var": 0,
"no-prototype-builtins": 0,
"prefer-spread": 0,
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-this-alias": 0,
"@typescript-eslint/ban-ts-ignore": 0,
"@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/adjacent-overload-signatures": 0,
"@typescript-eslint/ban-types": 0,
"@typescript-eslint/member-ordering": [
1,
{
"default": {
"memberTypes": [
"public-static-field",
"protected-static-field",
"private-static-field",

"public-static-method",
"protected-static-method",
"private-static-method",

"public-instance-field",
"protected-instance-field",
"private-instance-field",

"public-constructor",
"private-constructor",
"protected-constructor",

"public-instance-method",
"protected-instance-method",
"private-instance-method"
]
}
}
],
"@typescript-eslint/explicit-member-accessibility": [
1,
{ "accessibility": "no-public" }
],
"@typescript-eslint/no-empty-interface": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-unused-vars": [
"warn",
{
"args": "none"
}
]
},
"overrides": [
{
"files": ["test/cluster/*", "test/unit/*", "test/functional/*"],
"env": {
"mocha": true
},
"rules": { "prefer-const": 0 }
}
]
}
42 changes: 0 additions & 42 deletions .eslintrc.yml

This file was deleted.

46 changes: 0 additions & 46 deletions .github/workflows/main.yml

This file was deleted.

9 changes: 9 additions & 0 deletions .github/workflows/push-requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Pull Requests

on:
pull_request:
branches: [main]

jobs:
test:
uses: ./.github/workflows/test.yml
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release

on:
push:
branches: [main]

jobs:
test:
uses: ./.github/workflows/test.yml
release:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: "lts/*"
- run: npm ci
- run: npm run build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_AUTHOR_NAME: "ioredis robot"
GIT_AUTHOR_EMAIL: "ioredis-robot@zihua.li"
run: npx semantic-release
54 changes: 54 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
on:
workflow_call:

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [12.x, 14.x, 16.x]
redis: ['2', '6']
steps:
- name: Git checkout
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Start Redis
uses: supercharge/redis-github-action@1.4.0
with:
redis-version: ${{ matrix.redis }}

- run: npm install
- run: npm run lint
- run: npm run build
- run: npm run test:tsd
- run: npm run test:cov || npm run test:cov || npm run test:cov
- name: Coveralls
if: matrix.node == '16.x' && matrix.redis == '6'
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: redis-${{matrix.redis}}-node-${{matrix.node}}
parallel: true

test-cluster:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build and test cluster
run: bash test/cluster/docker/main.sh

code-coverage:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
node_modules
*.cpuprofile
/test.js
/test.*
/.idea
built

.nyc_output
coverage

.vscode
benchmarks/fixtures/*.txt

*.rdb
2 changes: 0 additions & 2 deletions .npmrc

This file was deleted.

52 changes: 16 additions & 36 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,19 @@
{
"branch": "master",
"verifyConditions": [
"@semantic-release/npm",
"@semantic-release/changelog",
"branches": ["main"],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"parserOpts": {
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"]
}
}
],
"@semantic-release/release-notes-generator",
["@semantic-release/changelog", { "changelogFile": "CHANGELOG.md" }],
"@semantic-release/git",
"@semantic-release/github"
],
"getLastRelease": "@semantic-release/git",
"prepare": [
{
"path": "@semantic-release/changelog",
"changelogFile": "Changelog.md"
},
"@semantic-release/npm",
{
"path": "@semantic-release/git",
"assets": [
"Changelog.md",
"package.json",
"package-lock.json",
"npm-shrinkwrap.json"
]
}
],
"publish": [
"@semantic-release/npm",
"@semantic-release/github"
],
"analyzeCommits": {
"preset": "angular",
"releaseRules": [
{ "type": "minor", "release": "minor" },
{ "type": "patch", "release": "patch" },
{ "type": "major", "release": "major" },
{ "type": "breaking", "release": "major" }
]
}
"@semantic-release/github",
"@semantic-release/npm"
]
}
53 changes: 0 additions & 53 deletions .travis.yml

This file was deleted.

Loading