Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1cf70a3
chore: bump path-parse from 1.0.6 to 1.0.7 (#678)
dependabot[bot] Aug 29, 2021
c7e27b0
chore(release): 5.2.0
darrachequesne Aug 29, 2021
7245b80
chore: migrate to TypeScript
darrachequesne Sep 28, 2021
221433e
chore: bump ws
darrachequesne Oct 4, 2021
27de300
chore: migrate to rollup
darrachequesne Oct 8, 2021
b2c7381
refactor: remove JSONP polling
darrachequesne Oct 8, 2021
00d7e7d
feat: provide an ESM build without debug
darrachequesne Oct 8, 2021
c656192
refactor: remove XDomainRequest support
darrachequesne Oct 8, 2021
1524413
chore(release): 6.0.0
darrachequesne Oct 8, 2021
b3bb73a
chore: bump @socket.io/component-emitter to version 3.0.0
darrachequesne Oct 14, 2021
4971914
fix: fix usage with vite
darrachequesne Oct 14, 2021
00fcb6e
chore: export package.json file
darrachequesne Oct 14, 2021
9a62294
chore(release): 6.0.1
darrachequesne Oct 14, 2021
faa9f31
fix(bundle): fix vite build
darrachequesne Oct 15, 2021
68dc241
chore(release): 6.0.2
darrachequesne Oct 15, 2021
8f68f77
fix(typings): allow port to be a number (#680)
kaangokdemir Nov 5, 2021
018e1af
fix(typings): allow any value in the query option
darrachequesne Nov 5, 2021
c813fff
test: skip flaky test
darrachequesne Nov 5, 2021
e7ebf4b
chore: update caniuse-lite
darrachequesne Nov 5, 2021
e7b4700
chore(release): 6.1.0
darrachequesne Nov 8, 2021
2793628
chore: make postcompile.sh script work on macOS (#681)
lpinca Nov 13, 2021
8de51c3
chore: add bundle files as exportable asset (#682)
exsilium Nov 14, 2021
c557707
fix: fix vite build for CommonJS users
darrachequesne Nov 14, 2021
6e798fb
fix: add package name in nested package.json
darrachequesne Nov 14, 2021
3c40aa9
chore(release): 6.1.1
darrachequesne Nov 14, 2021
1c0fd93
docs(changelog): add changelog for version 6.0.3
darrachequesne Nov 14, 2021
56af9c5
chore: bump engine.io from 4.0.2 to 4.1.2 (#685)
dependabot[bot] Jan 15, 2022
00c6734
chore: bump ajv from 6.10.2 to 6.12.6 (#687)
dependabot[bot] Feb 16, 2022
f51ca4a
chore: bump cached-path-relative from 1.0.2 to 1.1.0 (#686)
dependabot[bot] Mar 8, 2022
f4725f1
test: exclude iOS 15 from the test matrix for now
darrachequesne Mar 12, 2022
46fdc2f
feat: slice write buffer according to the maxPayload value
darrachequesne Mar 12, 2022
6e1bbff
chore: add Node.js 16 in the test matrix
darrachequesne Mar 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
node-version: [14, 16]

steps:
- uses: actions/checkout@v2
Expand Down
92 changes: 92 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,95 @@
## [6.0.3](https://github.com/socketio/engine.io-client/compare/6.0.2...6.0.3) (2021-11-14)

Some bug fixes were backported from master, to be included by the latest `socket.io-client` version.

### Bug Fixes

* add package name in nested package.json ([32511ee](https://github.com/socketio/engine.io-client/commit/32511ee32a0a6122e99db35833ed948aa4e427ac))
* fix vite build for CommonJS users ([9fcaf58](https://github.com/socketio/engine.io-client/commit/9fcaf58d18c013c0b92fdaf27481f0383efb3658))



## [6.1.1](https://github.com/socketio/engine.io-client/compare/6.1.0...6.1.1) (2021-11-14)


### Bug Fixes

* add package name in nested package.json ([6e798fb](https://github.com/socketio/engine.io-client/commit/6e798fbb5b11a1cfec03ece3dfce03213b5f9a12))
* fix vite build for CommonJS users ([c557707](https://github.com/socketio/engine.io-client/commit/c557707fb694bd10397b4cd8b4ec2fbe59128faa))



# [6.1.0](https://github.com/socketio/engine.io-client/compare/6.0.2...6.1.0) (2021-11-08)

The minor bump is due to changes on the server side.

### Bug Fixes

* **typings:** allow any value in the query option ([018e1af](https://github.com/socketio/engine.io-client/commit/018e1afcc5ef5eac81e9e1629db053bda44120ee))
* **typings:** allow port to be a number ([#680](https://github.com/socketio/engine.io-client/issues/680)) ([8f68f77](https://github.com/socketio/engine.io-client/commit/8f68f77825af069fe2c612a3200a025d4130ac0a))



## [6.0.2](https://github.com/socketio/engine.io-client/compare/6.0.1...6.0.2) (2021-10-15)


### Bug Fixes

* **bundle:** fix vite build ([faa9f31](https://github.com/socketio/engine.io-client/commit/faa9f318e70cd037af79bfa20e9d21b284ddf257))



## [6.0.1](https://github.com/socketio/engine.io-client/compare/6.0.0...6.0.1) (2021-10-14)


### Bug Fixes

* fix usage with vite ([4971914](https://github.com/socketio/engine.io-client/commit/49719142f65e23efa65fca4f66765ded5d955972))


# [6.0.0](https://github.com/socketio/engine.io-client/compare/5.2.0...6.0.0) (2021-10-08)

This major release contains three important changes:

- the codebase was migrated to TypeScript ([7245b80](https://github.com/socketio/engine.io-client/commit/7245b803e0c8d57cfc1f1cd8b8c8d598e8397967))
- rollup is now used instead of webpack to create the bundles ([27de300](https://github.com/socketio/engine.io-client/commit/27de300de42420ab59a02ec7a3445e636cbcc78e))
- code that provided support for ancient browsers (think IE8) was removed ([c656192](https://github.com/socketio/engine.io-client/commit/c6561928be628084fd2f5e7a70943c8e5c582873) and [b2c7381](https://github.com/socketio/engine.io-client/commit/b2c73812e978489b5dfbe516a26b6b8fd628856d))

There is now three distinct builds (in the build/ directory):

- CommonJS
- ESM with debug
- ESM without debug (rationale here: [00d7e7d](https://github.com/socketio/engine.io-client/commit/00d7e7d7ee85b4cfa6f9f547203cc692083ac61c))

And three bundles (in the dist/ directory) :

- `engine.io.js`: unminified UMD bundle
- `engine.io.min.js`: minified UMD bundle
- `engine.io.esm.min.js`: ESM bundle

Please note that the communication protocol was not updated, so a v5 client will be able to reach a v6 server (and vice-versa).

Reference: https://github.com/socketio/engine.io-protocol

### Features

* provide an ESM build without debug ([00d7e7d](https://github.com/socketio/engine.io-client/commit/00d7e7d7ee85b4cfa6f9f547203cc692083ac61c))

### BREAKING CHANGES

* the enableXDR option is removed ([c656192](https://github.com/socketio/engine.io-client/commit/c6561928be628084fd2f5e7a70943c8e5c582873))
* the jsonp and forceJSONP options are removed ([b2c7381](https://github.com/socketio/engine.io-client/commit/b2c73812e978489b5dfbe516a26b6b8fd628856d))

`ws` version: `~8.2.3`

# [5.2.0](https://github.com/socketio/engine.io-client/compare/5.1.2...5.2.0) (2021-08-29)


### Features

* add an option to use native timer functions ([#672](https://github.com/socketio/engine.io-client/issues/672)) ([5d1d5be](https://github.com/socketio/engine.io-client/commit/5d1d5bea11ab6854473ddc02a3391929ea4fc8f4))


## [5.1.2](https://github.com/socketio/engine.io-client/compare/5.1.1...5.1.2) (2021-06-24)


Expand Down
28 changes: 12 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ Engine.IO is a commonjs module, which means you can include it by using
1. write your app code

```js
const socket = require('engine.io-client')('ws://localhost');
const { Socket } = require('engine.io-client');
const socket = new Socket('ws://localhost');
socket.on('open', () => {
socket.on('message', (data) => {});
socket.on('close', () => {});
Expand All @@ -65,7 +66,7 @@ Engine.IO is a commonjs module, which means you can include it by using
```html
<script src="/path/to/engine.io.js"></script>
<script>
const socket = new eio.Socket('ws://localhost/');
const socket = eio('ws://localhost/');
socket.binaryType = 'blob';
socket.on('open', () => {
socket.send(new Int8Array(5));
Expand All @@ -80,7 +81,8 @@ Engine.IO is a commonjs module, which means you can include it by using
Add `engine.io-client` to your `package.json` and then:

```js
const socket = require('engine.io-client')('ws://localhost');
const { Socket } = require('engine.io-client');
const socket = new Socket('ws://localhost');
socket.on('open', () => {
socket.on('message', (data) => {});
socket.on('close', () => {});
Expand All @@ -95,7 +97,8 @@ const opts = {
ca: fs.readFileSync('test/fixtures/ca.crt')
};

const socket = require('engine.io-client')('ws://localhost', opts);
const { Socket } = require('engine.io-client');
const socket = new Socket('ws://localhost', opts);
socket.on('open', () => {
socket.on('message', (data) => {});
socket.on('close', () => {});
Expand All @@ -111,7 +114,8 @@ const opts = {
}
};

const socket = require('engine.io-client')('ws://localhost', opts);
const { Socket } = require('engine.io-client');
const socket = new Socket('ws://localhost', opts);
socket.on('open', () => {
socket.on('message', (data) => {});
socket.on('close', () => {});
Expand All @@ -124,13 +128,13 @@ Please note that in this case the headers won't be sent in the WebSocket upgrade

```js
// WILL NOT WORK in the browser
require('engine.io-client')('http://localhost', {
const socket = new Socket('http://localhost', {
extraHeaders: {
'X-Custom-Header-For-My-Project': 'will not be sent'
}
});
// WILL NOT WORK
require('engine.io-client')('http://localhost', {
const socket = new Socket('http://localhost', {
transports: ['websocket'], // polling is disabled
transportOptions: {
polling: {
Expand All @@ -141,7 +145,7 @@ require('engine.io-client')('http://localhost', {
}
});
// WILL WORK
require('engine.io-client')('http://localhost', {
const socket = new Socket('http://localhost', {
transports: ['polling', 'websocket'],
transportOptions: {
polling: {
Expand Down Expand Up @@ -222,15 +226,7 @@ Exposed as `eio` in the browser standalone build.
- `agent` (`http.Agent`): `http.Agent` to use, defaults to `false` (NodeJS only)
- `upgrade` (`Boolean`): defaults to true, whether the client should try
to upgrade the transport from long-polling to something better.
- `forceJSONP` (`Boolean`): forces JSONP for polling transport.
- `jsonp` (`Boolean`): determines whether to use JSONP when
necessary for polling. If disabled (by settings to false) an error will
be emitted (saying "No transports available") if no other transports
are available. If another transport is available for opening a
connection (e.g. WebSocket) that transport
will be used instead.
- `forceBase64` (`Boolean`): forces base 64 encoding for polling transport even when XHR2 responseType is available and WebSocket even if the used standard supports binary.
- `enablesXDR` (`Boolean`): enables XDomainRequest for IE8 to avoid loading bar flashing with click sound. default to `false` because XDomainRequest has a flaw of not sending cookie.
- `withCredentials` (`Boolean`): defaults to `false`, whether to include credentials (cookies, authorization headers, TLS client certificates, etc.) with cross-origin XHR polling requests.
- `timestampRequests` (`Boolean`): whether to add the timestamp with each
transport request. Note: polling requests are always stamped unless this
Expand Down
7 changes: 7 additions & 0 deletions dist/engine.io.esm.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/engine.io.esm.min.js.map

Large diffs are not rendered by default.

2,757 changes: 2,380 additions & 377 deletions dist/engine.io.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/engine.io.js.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions dist/engine.io.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/engine.io.min.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions lib/browser-entrypoint.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { Socket } from "./socket.js";

export default (uri, opts) => new Socket(uri, opts);
2 changes: 1 addition & 1 deletion lib/globalThis.browser.js → lib/globalThis.browser.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = (() => {
export default (() => {
if (typeof self !== "undefined") {
return self;
} else if (typeof window !== "undefined") {
Expand Down
1 change: 0 additions & 1 deletion lib/globalThis.js

This file was deleted.

1 change: 1 addition & 0 deletions lib/globalThis.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default global;
14 changes: 0 additions & 14 deletions lib/index.js

This file was deleted.

8 changes: 8 additions & 0 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Socket } from "./socket.js";

export { Socket };
export { SocketOptions } from "./socket.js";
export const protocol = Socket.protocol;
export { Transport } from "./transport.js";
export { transports } from "./transports/index.js";
export { installTimerFunctions } from "./util.js";
Loading