pusher-js 8.4.3 → 8.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/.github/workflows/release.yml +5 -5
  2. package/.github/workflows/release_pr.yml +4 -4
  3. package/.github/workflows/run-tests.yml +13 -6
  4. package/CHANGELOG.md +7 -0
  5. package/dist/node/pusher.js +5715 -5673
  6. package/dist/node/pusher.js.map +1 -1
  7. package/dist/react-native/pusher.js +2 -8
  8. package/dist/react-native/pusher.js.LICENSE.txt +7 -0
  9. package/dist/react-native/pusher.js.map +1 -1
  10. package/dist/web/pusher-with-encryption.js +353 -363
  11. package/dist/web/pusher-with-encryption.js.map +1 -1
  12. package/dist/web/pusher-with-encryption.min.js +2 -8
  13. package/dist/web/pusher-with-encryption.min.js.LICENSE.txt +7 -0
  14. package/dist/web/pusher-with-encryption.min.js.map +1 -1
  15. package/dist/web/pusher.js +340 -348
  16. package/dist/web/pusher.js.map +1 -1
  17. package/dist/web/pusher.min.js +2 -8
  18. package/dist/web/pusher.min.js.LICENSE.txt +7 -0
  19. package/dist/web/pusher.min.js.map +1 -1
  20. package/dist/worker/pusher-with-encryption.worker.js +327 -337
  21. package/dist/worker/pusher-with-encryption.worker.js.map +1 -1
  22. package/dist/worker/pusher-with-encryption.worker.min.js +2 -8
  23. package/dist/worker/pusher-with-encryption.worker.min.js.LICENSE.txt +7 -0
  24. package/dist/worker/pusher-with-encryption.worker.min.js.map +1 -1
  25. package/dist/worker/pusher.worker.js +314 -322
  26. package/dist/worker/pusher.worker.js.map +1 -1
  27. package/dist/worker/pusher.worker.min.js +2 -8
  28. package/dist/worker/pusher.worker.min.js.LICENSE.txt +7 -0
  29. package/dist/worker/pusher.worker.min.js.map +1 -1
  30. package/integration_tests_server/package-lock.json +7 -6
  31. package/integration_tests_server/package.json +1 -0
  32. package/package.json +16 -9
  33. package/spec/config/jasmine/webpack.integration.js +1 -1
  34. package/spec/config/jasmine/webpack.unit.js +1 -1
  35. package/spec/javascripts/helpers/mocks.js +1 -0
  36. package/spec/javascripts/integration/index.web.js +14 -0
  37. package/spec/javascripts/unit/core/connection/connection_manager_spec.js +43 -0
  38. package/spec/javascripts/unit/core/pusher_spec.js +58 -0
  39. package/src/core/auth/options.ts +9 -11
  40. package/src/core/config.ts +23 -14
  41. package/src/core/connection/connection_manager.ts +9 -0
  42. package/src/core/options.ts +5 -0
  43. package/src/core/pusher.ts +17 -6
  44. package/types/src/core/auth/options.d.ts +5 -10
  45. package/types/src/core/connection/connection_manager.d.ts +1 -0
  46. package/types/src/core/options.d.ts +4 -0
  47. package/types/src/core/pusher.d.ts +3 -1
  48. package/webpack/config.node.js +1 -2
  49. package/webpack/config.react-native.js +1 -2
  50. package/webpack/config.shared.js +6 -6
  51. package/webpack/config.web.js +1 -2
  52. package/webpack/config.worker.js +1 -2
  53. package/webpack/dev.server.js +2 -9
@@ -7,7 +7,7 @@ jobs:
7
7
  runs-on: ubuntu-latest
8
8
  steps:
9
9
  - name: Checkout code
10
- uses: actions/checkout@v4
10
+ uses: actions/checkout@v6
11
11
  with:
12
12
  fetch-depth: 0
13
13
  - name: Prepare tag
@@ -34,7 +34,7 @@ jobs:
34
34
  needs: check-release-tag
35
35
  if: ${{ needs.check-release-tag.outputs.tag }}
36
36
  steps:
37
- - uses: actions/checkout@v4
37
+ - uses: actions/checkout@v6
38
38
  - name: Prepare tag
39
39
  run: |
40
40
  TAG=v$(jq -r '.version' package.json)
@@ -55,8 +55,8 @@ jobs:
55
55
  runs-on: ubuntu-latest
56
56
  needs: create-github-release
57
57
  steps:
58
- - uses: actions/checkout@v4
59
- - uses: actions/setup-node@v4
58
+ - uses: actions/checkout@v6
59
+ - uses: actions/setup-node@v6
60
60
  with:
61
61
  node-version: '20'
62
62
  registry-url: https://registry.npmjs.org/
@@ -77,7 +77,7 @@ jobs:
77
77
  runs-on: ubuntu-latest
78
78
  needs: create-github-release
79
79
  steps:
80
- - uses: actions/checkout@v4
80
+ - uses: actions/checkout@v6
81
81
  - name: Upload to S3
82
82
  run: |
83
83
  VERSION=$(jq -r '.version' package.json | cut -d'.' -f1,2,3)
@@ -11,13 +11,13 @@ jobs:
11
11
  name: Prepare release
12
12
  runs-on: ubuntu-latest
13
13
  steps:
14
- - uses: actions/checkout@v2
14
+ - uses: actions/checkout@v6
15
15
  - name: Get current version
16
16
  shell: bash
17
17
  run: |
18
18
  CURRENT_VERSION=$(jq -r '.version' package.json)
19
19
  echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
20
- - uses: actions/checkout@v2
20
+ - uses: actions/checkout@v6
21
21
  with:
22
22
  repository: pusher/public_actions
23
23
  path: .github/actions
@@ -25,9 +25,9 @@ jobs:
25
25
  id: bump
26
26
  with:
27
27
  current_version: ${{ env.CURRENT_VERSION }}
28
- - uses: actions/setup-node@v2
28
+ - uses: actions/setup-node@v6
29
29
  with:
30
- node-version: '16'
30
+ node-version: '20'
31
31
  - run: npm install
32
32
  - name: Push
33
33
  shell: bash
@@ -12,11 +12,14 @@ jobs:
12
12
  env:
13
13
  CI: ${{ github.event_name == 'push' && 'basic' || 'full' }}
14
14
  MINIMAL_INTEGRATION_TESTS: ${{ github.event_name == 'push' && 'true' || '' }}
15
+ # webpack 4 uses MD4 hashing which is unsupported in OpenSSL 3 (Node 17+).
16
+ # Remove once webpack is upgraded to v5.
17
+ NODE_OPTIONS: --openssl-legacy-provider
15
18
  steps:
16
- - uses: actions/checkout@v2
17
- - uses: actions/setup-node@v2
19
+ - uses: actions/checkout@v6
20
+ - uses: actions/setup-node@v6
18
21
  with:
19
- node-version: '16'
22
+ node-version: '20'
20
23
  - run: npm install
21
24
  - run: npm run check-format
22
25
  - run: make web_unit
@@ -36,11 +39,15 @@ jobs:
36
39
  INTEGRATION_TESTS_APP_EU_SECRET: ${{ secrets.INTEGRATION_TESTS_APP_EU_SECRET }}
37
40
  run-node-tests:
38
41
  runs-on: ubuntu-latest
42
+ env:
43
+ # webpack 4 uses MD4 hashing which is unsupported in OpenSSL 3 (Node 17+).
44
+ # Remove once webpack is upgraded to v5.
45
+ NODE_OPTIONS: --openssl-legacy-provider
39
46
  steps:
40
- - uses: actions/checkout@v2
41
- - uses: actions/setup-node@v2
47
+ - uses: actions/checkout@v6
48
+ - uses: actions/setup-node@v6
42
49
  with:
43
- node-version: '16'
50
+ node-version: '20'
44
51
  - run: npm install
45
52
  - run: npm run check-format
46
53
  - run: make node_unit
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 8.5.0
4
+
5
+ - [ADDED] New `switchCluster` method on Pusher instances to switch cluster/app without losing channel subscriptions (PR #773)
6
+ - [FIXED] Persist previous options when switching cluster so custom handlers and other settings are retained (PR #783)
7
+ - [FIXED] Refactored `AuthOptionsT` to a discriminated union (`InternalAuthOptions | CustomAuthOptions`) for improved type safety
8
+ - [FIXED] Integration tests now run HTTP tests before HTTPS to avoid browser Strict-Transport-Security downgrade issues
9
+
3
10
  ## 8.4.3
4
11
 
5
12
  - [FIXED] Pin additional transitive dependencies to patched versions to resolve known vulnerabilities (express, qs, body-parser, lodash, minimatch, browserstack-local)