Skip to content

Commit

Permalink
superagent replacement and web worker for web (#367)
Browse files Browse the repository at this point in the history
feat(network): replace `superagent` with `fetch`

Upgraded the network layer, replacing the `superagent` module with the `Fetch API` for browser integrations and node-fetch for `npm` integrations, ensuring enhanced performance and reliability.

feat(service-worker): added service worker 

Enhanced the subscribe feature with service worker support, improving user experience across multiple browser windows and tabs.
    
feat(types): client interface rewritten with TypeScript
    
The client interface rewritten with TypeScript, which gives an up-to-date interface.

* PubNub SDK v8.0.0 release.

* Update configuration.ts

---------

Co-authored-by: Mohit Tejani <60129002+mohitpubnub@users.noreply.github.com>
  • Loading branch information
parfeon and mohitpubnub authored Apr 22, 2024
1 parent b29cc36 commit 410930f
Show file tree
Hide file tree
Showing 497 changed files with 66,207 additions and 45,428 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/workflows/release/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"clearedSuffix": false
}
],
"src/core/components/config.js": [
"src/core/components/configuration.ts": [
{
"pattern": "^\\s{2,}return '(v?(\\.?\\d+){2,}([a-zA-Z0-9-]+(\\.?\\d+)?)?)';$",
"clearedPrefix": true,
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ defaults:
shell: bash
env:
CXX: 'g++-4.8'
PAM_SUBSCRIBE_KEY: ${{ secrets.SDK_PAM_SUB_KEY }}
PAM_PUBLISH_KEY: ${{ secrets.SDK_PAM_PUB_KEY }}
PAM_SECRET_KEY: ${{ secrets.SDK_PAM_SEC_KEY }}
SUBSCRIBE_KEY: ${{ secrets.SDK_SUB_KEY }}
PUBLISH_KEY: ${{ secrets.SDK_PUB_KEY }}

jobs:
tests:
Expand All @@ -19,10 +24,10 @@ jobs:
strategy:
fail-fast: true
matrix:
node: [14, 16]
node: [18.18.0, 20]
env: ['ci:node']
include:
- node: 16
- node: 18.18.0
env: 'ci:web'
steps:
- name: Checkout repository
Expand Down Expand Up @@ -53,4 +58,4 @@ jobs:
needs: [tests]
steps:
- name: Tests summary
run: echo -e "\033[38;2;95;215;0m\033[1mAll tests successfully passed"
run: echo -e "\033[38;2;95;215;0m\033[1mAll tests successfully passed"
10 changes: 10 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"require": "tsx",
"spec": "test/**/*.test.ts",
"exclude": [
"test/dist/*.{js,ts}",
"test/feature/*.{js,ts}"
],
"timeout": 5000,
"reporter": "spec"
}
7 changes: 0 additions & 7 deletions .mocharc.yml

This file was deleted.

15 changes: 12 additions & 3 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
---
changelog:
- date: 2024-04-22
version: v8.0.0
changes:
- type: feature
text: "Upgraded the network layer, replacing the `superagent` module with the `Fetch API` for browser integrations and node-fetch for `npm` integrations, ensuring enhanced performance and reliability."
- type: feature
text: "Added service worker ."
- type: feature
text: "Enhanced the subscribe feature with service worker support, improving user experience across multiple browser windows and tabs. The client interface rewritten with TypeScript, which gives an up-to-date interface."
- date: 2024-04-18
version: v7.6.3
changes:
Expand Down Expand Up @@ -958,7 +967,7 @@ supported-platforms:
- 'Ubuntu 14.04 and up'
- 'Windows 7 and up'
version: 'Pubnub Javascript for Node'
version: '7.6.3'
version: '8.0.0'
sdks:
- full-name: PubNub Javascript SDK
short-name: Javascript
Expand All @@ -974,7 +983,7 @@ sdks:
- distribution-type: source
distribution-repository: GitHub release
package-name: pubnub.js
location: https://github.com/pubnub/javascript/archive/refs/tags/v7.6.3.zip
location: https://github.com/pubnub/javascript/archive/refs/tags/v8.0.0.zip
requires:
- name: 'agentkeepalive'
min-version: '3.5.2'
Expand Down Expand Up @@ -1645,7 +1654,7 @@ sdks:
- distribution-type: library
distribution-repository: GitHub release
package-name: pubnub.js
location: https://github.com/pubnub/javascript/releases/download/v7.6.3/pubnub.7.6.3.js
location: https://github.com/pubnub/javascript/releases/download/v8.0.0/pubnub.8.0.0.js
requires:
- name: 'agentkeepalive'
min-version: '3.5.2'
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## v8.0.0
April 22 2024

#### Added
- Upgraded the network layer, replacing the `superagent` module with the `Fetch API` for browser integrations and node-fetch for `npm` integrations, ensuring enhanced performance and reliability.
- Added service worker .
- Enhanced the subscribe feature with service worker support, improving user experience across multiple browser windows and tabs. The client interface rewritten with TypeScript, which gives an up-to-date interface.

## v7.6.3
April 18 2024

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Watch [Getting Started with PubNub JS SDK](https://app.dashcam.io/replay/64ee0d2
npm install pubnub
```
* or download one of our builds from our CDN:
* https://cdn.pubnub.com/sdk/javascript/pubnub.7.6.3.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.7.6.3.min.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.8.0.0.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.8.0.0.min.js

2. Configure your keys:

Expand Down
2 changes: 1 addition & 1 deletion cucumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ module.exports = {
'--format summary',
'--format progress-bar',
// '--format @cucumber/pretty-formatter',
'--publish-quiet',
// '--publish-quiet',
].join(' '),
};
Loading

0 comments on commit 410930f

Please sign in to comment.