diff --git a/.eslintrc.json b/.eslintrc.json index 1e8ee731e..3cc4c32f5 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -3,7 +3,8 @@ "parser": "babel-eslint", "env": { // Note: mocha env is defined inside test/.eslintrc.json - "node": true + "node": true, + "browser": true }, "rules": { "yoda": 0, diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 9d0b1cd92..03303efc5 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,5 +1,9 @@ -*Note*: for support questions, please use one of these channels: [stackoverflow](http://stackoverflow.com/questions/tagged/socket.io) or [slack](https://socketio.slack.com) +**Note**: for support questions, please use one of these channels: [stackoverflow](http://stackoverflow.com/questions/tagged/socket.io) or [slack](https://socketio.slack.com) + +For bug reports and feature requests for the **Swift client**, please open an issue [there](https://github.com/socketio/socket.io-client-swift). + +For bug reports and feature requests for the **Java client**, please open an issue [there](https://github.com/socketio/socket.io-client-java). ### You want to: @@ -8,13 +12,15 @@ ### Current behaviour +*What is actually happening?* ### Steps to reproduce (if the current behaviour is a bug) -**Note**: the best way to get a quick answer is to provide a failing test case, by forking the following [fiddle](https://github.com/darrachequesne/socket.io-fiddle) for example. +**Note**: the best way (and by that we mean **the only way**) to get a quick answer is to provide a failing test case by forking the following [fiddle](https://github.com/socketio/socket.io-fiddle). ### Expected behaviour +*What is expected?* ### Setup - OS: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..f7eb05277 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI + +on: + push: + pull_request: + +jobs: + test-node: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [10.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm test + env: + CI: true + + test-browser: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: '10.x' + - run: npm ci + - run: npm test + env: + CI: true + BROWSERS: 1 + NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} + SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} + SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} + timeout-minutes: 20 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9c17044d6..000000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: node_js -node_js: - - '4' - - '6' - - '8' - - node -sudo: false -git: - depth: 1 -notifications: - irc: 'irc.freenode.org#socket.io' -matrix: - include: - - node_js: node - env: BROWSERS=1 -cache: - directories: - - node_modules -env: - global: - - secure: >- - QYaPt9wtF7Vm+kRPaGNAaCRP/E74gjxA7T0k1GqPYIs2xDiuhU/ef03pzWIjBB+6z0GGnsQ4rG+6JlM1lsthTMEDcegbp6/XKZkqZqWUaJmCy7U41J2mJutwli6ZV9VAqh5pi0mfe5elAqeh/fx+GhFbtu6JzBQkpW58OytiP1Y= - - secure: >- - pa7ocLVb5BJPCIC1cnGWWC0nGOKywR6Ac/QuiX1VD1SUt0XxpPVrbBzdgfHIMD0MCJ8F8xIlu2IPgp0O/a6c+Nj2V825Up5yKD/H0k1FKQ/4jp9aInV1VDFkKmoWdQcpCSaHq9HXJH58Bm4lpNyJdCydMpGOjZmSfs/ZGbzNN1Y= - - secure: >- - Og1/VRKnYHFNIj5rFhn/MIWvk8TBJ4CrNwffeBsUmusPJzyeATjkD8ZjGHD3jcjUcI3m4ihHe5al+WOt8GT9pUABDbuvFJXCBtNMGlo0URRlFu+oc3Qi3Ux8gJ/2317HDx9RNOJ+AC8EcBym49BDTm93rHc80ZLBVZZDS2pUU6o= diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..0c8a38998 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,29 @@ +# [2.5.0](https://github.com/socketio/socket.io-client/compare/2.4.0...2.5.0) (2022-06-26) + + +### Bug Fixes + +* ensure buffered events are sent in order ([991eb0b](https://github.com/Automattic/socket.io-client/commit/991eb0b0289bbbf680099e6d42b302beee7568b8)) + + + +# [2.4.0](https://github.com/socketio/socket.io-client/compare/2.3.1...2.4.0) (2021-01-04) + +The minor bump is matching the bump of the server, but there is no new feature in this release. + + +## [2.3.1](https://github.com/socketio/socket.io-client/compare/2.3.0...2.3.1) (2020-09-30) + +The `debug` dependency has been reverted to `~3.1.0`, as the newer versions contains ES6 syntax which breaks in IE +browsers. + +Please note that this only applied to users that bundle the Socket.IO client in their application, with webpack for +example, as the "official" bundles (in the dist/ folder) were already transpiled with babel. + +For webpack users, you can also take a look at the [webpack-remove-debug](https://github.com/johngodley/webpack-remove-debug) +plugin. + +### Bug Fixes + +* fix reconnection after opening socket asynchronously ([#1253](https://github.com/socketio/socket.io-client/issues/1253)) ([050108b](https://github.com/Automattic/socket.io-client/commit/050108b2281effda086b197cf174ee2e8e1aad79)) + diff --git a/Makefile b/Makefile index 20a4dbba7..a250ac3df 100644 --- a/Makefile +++ b/Makefile @@ -1,21 +1,20 @@ -REPORTER = dot +help: ## print this message + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' -build: socket.io.js +build: ## update the browser builds + @./node_modules/.bin/gulp build -socket.io.js socket.io.min.js: lib/*.js package.json - @./node_modules/.bin/gulp - -test: +test: ## run tests either in the browser or in Node.js, based on the `BROWSERS` variable @./node_modules/.bin/gulp test -test-node: +test-node: ## run tests in Node.js @./node_modules/.bin/gulp test-node -test-zuul: +test-zuul: ## run tests in the browser @./node_modules/.bin/gulp test-zuul -test-cov: +test-cov: ## run tests with coverage in Node.js @./node_modules/.bin/gulp test-cov -.PHONY: test +.PHONY: help test test-node test-zuul test-cov diff --git a/README.md b/README.md index b4c185624..bf7b5de89 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # socket.io-client -[![Build Status](https://secure.travis-ci.org/socketio/socket.io-client.svg?branch=master)](http://travis-ci.org/socketio/socket.io-client) +[![Build Status](https://github.com/socketio/socket.io-client/workflows/CI/badge.svg)](https://github.com/socketio/socket.io-client/actions) [![Dependency Status](https://david-dm.org/socketio/socket.io-client.svg)](https://david-dm.org/socketio/socket.io-client) [![devDependency Status](https://david-dm.org/socketio/socket.io-client/dev-status.svg)](https://david-dm.org/socketio/socket.io-client#info=devDependencies) [![NPM version](https://badge.fury.io/js/socket.io-client.svg)](https://www.npmjs.com/package/socket.io-client) @@ -14,12 +14,12 @@ A standalone build of `socket.io-client` is exposed automatically by the socket.io server as `/socket.io/socket.io.js`. Alternatively you can -serve the file `socket.io.js` found in the `dist` folder. +serve the file `socket.io.js` found in the `dist` folder or include it via [CDN](https://cdn.jsdelivr.net/npm/socket.io-client@2/dist/socket.io.js). ```html