@feathersjs/socketio
Advanced tools
Comparing version 5.0.0-pre.1 to 5.0.0-pre.2
@@ -6,2 +6,46 @@ # Change Log | ||
# [5.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.1...v5.0.0-pre.2) (2021-04-06) | ||
**Note:** Version bump only for package @feathersjs/socketio | ||
# [5.0.0-beta.1](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.0...v5.0.0-beta.1) (2021-04-03) | ||
### Bug Fixes | ||
* **dependencies:** Fix transport-commons dependency and update other dependencies ([#2284](https://github.com/feathersjs/feathers/issues/2284)) ([05b03b2](https://github.com/feathersjs/feathers/commit/05b03b27b40604d956047e3021d8053c3a137616)) | ||
# [5.0.0-beta.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.1...v5.0.0-beta.0) (2021-03-28) | ||
### Bug Fixes | ||
* Update Grant usage and other dependencies ([#2264](https://github.com/feathersjs/feathers/issues/2264)) ([7b0f8fa](https://github.com/feathersjs/feathers/commit/7b0f8fad252419ed0ad0bf259cdf3104d322ab60)) | ||
### Features | ||
* **core:** Public custom service methods ([#2270](https://github.com/feathersjs/feathers/issues/2270)) ([e65abfb](https://github.com/feathersjs/feathers/commit/e65abfb5388df6c19a11c565cf1076a29f32668d)) | ||
* Application service types default to any ([#1566](https://github.com/feathersjs/feathers/issues/1566)) ([d93ba9a](https://github.com/feathersjs/feathers/commit/d93ba9a17edd20d3397bb00f4f6e82e804e42ed6)) | ||
* Feathers v5 core refactoring and features ([#2255](https://github.com/feathersjs/feathers/issues/2255)) ([2dafb7c](https://github.com/feathersjs/feathers/commit/2dafb7ce14ba57406aeec13d10ca45b1e709bee9)) | ||
* **core:** Remove Uberproto ([#2178](https://github.com/feathersjs/feathers/issues/2178)) ([ddf8821](https://github.com/feathersjs/feathers/commit/ddf8821f53317e6a378657f7d66acb03a037ee47)) | ||
### BREAKING CHANGES | ||
* **core:** Services no longer extend Uberproto objects and | ||
`service.mixin()` is no longer available. | ||
# [5.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.5.11...v5.0.0-pre.1) (2020-12-17) | ||
@@ -8,0 +52,0 @@ |
@@ -0,3 +1,11 @@ | ||
/// <reference types="node" /> | ||
import { Server, ServerOptions } from 'socket.io'; | ||
import http from 'http'; | ||
import { Application } from '@feathersjs/feathers'; | ||
declare module '@feathersjs/feathers/lib/declarations' { | ||
interface Application<ServiceTypes, AppSettings> { | ||
io: Server; | ||
listen(options: any): Promise<http.Server>; | ||
} | ||
} | ||
declare function configureSocketio(callback?: (io: Server) => void): (app: Application) => void; | ||
@@ -4,0 +12,0 @@ declare function configureSocketio(options: number | Partial<ServerOptions>, callback?: (io: Server) => void): (app: Application) => void; |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
// @ts-ignore | ||
const uberproto_1 = __importDefault(require("uberproto")); | ||
const debug_1 = __importDefault(require("debug")); | ||
@@ -28,38 +35,40 @@ const socket_io_1 = require("socket.io"); | ||
const socketMap = new WeakMap(); | ||
if (!app.version || app.version < '3.0.0') { | ||
throw new Error('@feathersjs/socketio is not compatible with this version of Feathers. Use the latest at @feathersjs/feathers.'); | ||
} | ||
// Promise that resolves with the Socket.io `io` instance | ||
// when `setup` has been called (with a server) | ||
const done = new Promise(resolve => { | ||
uberproto_1.default.mixin({ | ||
const { listen, setup } = app; | ||
Object.assign(app, { | ||
listen(...args) { | ||
if (typeof this._super === 'function') { | ||
// If `listen` already exists | ||
// usually the case when the app has been expressified | ||
return this._super(...args); | ||
} | ||
const server = http_1.default.createServer(); | ||
this.setup(server); | ||
return server.listen(...args); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (typeof listen === 'function') { | ||
// If `listen` already exists | ||
// usually the case when the app has been expressified | ||
return listen.call(this, ...args); | ||
} | ||
const server = http_1.default.createServer(); | ||
yield this.setup(server); | ||
return server.listen(...args); | ||
}); | ||
}, | ||
setup(server) { | ||
if (!this.io) { | ||
const io = this.io = new socket_io_1.Server(port || server, options); | ||
io.use(middleware_1.disconnect(app, getParams)); | ||
io.use(middleware_1.params(app, socketMap)); | ||
io.use(middleware_1.authentication(app, getParams)); | ||
// In Feathers it is easy to hit the standard Node warning limit | ||
// of event listeners (e.g. by registering 10 services). | ||
// So we set it to a higher number. 64 should be enough for everyone. | ||
io.sockets.setMaxListeners(64); | ||
} | ||
if (typeof config === 'function') { | ||
debug('Calling SocketIO configuration function'); | ||
config.call(this, this.io); | ||
} | ||
resolve(this.io); | ||
return this._super.apply(this, arguments); | ||
setup(server, ...rest) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (!this.io) { | ||
const io = this.io = new socket_io_1.Server(port || server, options); | ||
io.use(middleware_1.disconnect(app, getParams)); | ||
io.use(middleware_1.params(app, socketMap)); | ||
io.use(middleware_1.authentication(app, getParams)); | ||
// In Feathers it is easy to hit the standard Node warning limit | ||
// of event listeners (e.g. by registering 10 services). | ||
// So we set it to a higher number. 64 should be enough for everyone. | ||
io.sockets.setMaxListeners(64); | ||
} | ||
if (typeof config === 'function') { | ||
debug('Calling SocketIO configuration function'); | ||
config.call(this, this.io); | ||
} | ||
resolve(this.io); | ||
return setup.call(this, server, ...rest); | ||
}); | ||
} | ||
}, app); | ||
}); | ||
}); | ||
@@ -66,0 +75,0 @@ app.configure(transport_commons_1.socket({ |
{ | ||
"name": "@feathersjs/socketio", | ||
"description": "The Feathers Socket.io real-time API provider", | ||
"version": "5.0.0-pre.1", | ||
"version": "5.0.0-pre.2", | ||
"homepage": "https://feathersjs.com", | ||
@@ -30,3 +30,3 @@ "main": "lib/", | ||
"engines": { | ||
"node": ">= 10" | ||
"node": ">= 12" | ||
}, | ||
@@ -54,22 +54,21 @@ "files": [ | ||
"dependencies": { | ||
"@feathersjs/transport-commons": "^5.0.0-pre.1", | ||
"@feathersjs/transport-commons": "^5.0.0-pre.2", | ||
"debug": "^4.3.1", | ||
"socket.io": "^3.0.3", | ||
"uberproto": "^2.0.6" | ||
"socket.io": "^4.0.1" | ||
}, | ||
"devDependencies": { | ||
"@feathersjs/adapter-memory": "^5.0.0-pre.1", | ||
"@feathersjs/commons": "^5.0.0-pre.1", | ||
"@feathersjs/express": "^5.0.0-pre.1", | ||
"@feathersjs/feathers": "^5.0.0-pre.1", | ||
"@feathersjs/tests": "^5.0.0-pre.1", | ||
"@types/mocha": "^8.0.4", | ||
"@types/node": "^14.14.10", | ||
"lodash": "^4.17.20", | ||
"mocha": "^8.2.1", | ||
"@feathersjs/adapter-memory": "^5.0.0-pre.2", | ||
"@feathersjs/commons": "^5.0.0-pre.2", | ||
"@feathersjs/express": "^5.0.0-pre.2", | ||
"@feathersjs/feathers": "^5.0.0-pre.2", | ||
"@feathersjs/tests": "^5.0.0-pre.2", | ||
"@types/mocha": "^8.2.2", | ||
"@types/node": "^14.14.37", | ||
"lodash": "^4.17.21", | ||
"mocha": "^8.3.2", | ||
"shx": "^0.3.3", | ||
"socket.io-client": "^3.0.3", | ||
"typescript": "^4.1.2" | ||
"socket.io-client": "^4.0.1", | ||
"typescript": "^4.2.3" | ||
}, | ||
"gitHead": "3756506935c520fc50d4be416ff649c2158afdac" | ||
"gitHead": "6e1f888dc5b612d2d77653177622e3f66245a0fb" | ||
} |
@@ -21,4 +21,4 @@ # @feathersjs/socketio | ||
Copyright (c) 2019 [Feathers contributors](https://github.com/feathersjs/client/graphs/contributors) | ||
Copyright (c) 2021 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors) | ||
Licensed under the [MIT license](LICENSE). |
@@ -1,3 +0,1 @@ | ||
// @ts-ignore | ||
import Proto from 'uberproto'; | ||
import Debug from 'debug'; | ||
@@ -13,2 +11,9 @@ import { Server, ServerOptions } from 'socket.io'; | ||
declare module '@feathersjs/feathers/lib/declarations' { | ||
interface Application<ServiceTypes, AppSettings> { // eslint-disable-line | ||
io: Server; | ||
listen (options: any): Promise<http.Server>; | ||
} | ||
} | ||
function configureSocketio (callback?: (io: Server) => void): (app: Application) => void; | ||
@@ -34,16 +39,13 @@ function configureSocketio (options: number | Partial<ServerOptions>, callback?: (io: Server) => void): (app: Application) => void; | ||
const socketMap = new WeakMap(); | ||
if (!app.version || app.version < '3.0.0') { | ||
throw new Error('@feathersjs/socketio is not compatible with this version of Feathers. Use the latest at @feathersjs/feathers.'); | ||
} | ||
// Promise that resolves with the Socket.io `io` instance | ||
// when `setup` has been called (with a server) | ||
const done = new Promise(resolve => { | ||
Proto.mixin({ | ||
listen (...args: any[]) { | ||
if (typeof this._super === 'function') { | ||
const { listen, setup } = app as any; | ||
Object.assign(app, { | ||
async listen (this: any, ...args: any[]) { | ||
if (typeof listen === 'function') { | ||
// If `listen` already exists | ||
// usually the case when the app has been expressified | ||
return this._super(...args); | ||
return listen.call(this, ...args); | ||
} | ||
@@ -53,3 +55,3 @@ | ||
this.setup(server); | ||
await this.setup(server); | ||
@@ -59,3 +61,3 @@ return server.listen(...args); | ||
setup (server: http.Server) { | ||
async setup (this: any, server: http.Server, ...rest: any[]) { | ||
if (!this.io) { | ||
@@ -81,5 +83,5 @@ const io = this.io = new Server(port || server, options); | ||
return this._super.apply(this, arguments); | ||
return setup.call(this, server, ...rest); | ||
} | ||
}, app); | ||
}); | ||
}); | ||
@@ -86,0 +88,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
51590
3
283
1
+ Added@socket.io/component-emitter@3.1.2(transitive)
+ Addedcookie@0.7.2(transitive)
+ Addedengine.io@6.6.4(transitive)
+ Addedengine.io-parser@5.2.3(transitive)
+ Addedsocket.io@4.8.1(transitive)
+ Addedsocket.io-adapter@2.5.5(transitive)
+ Addedsocket.io-parser@4.2.4(transitive)
+ Addedws@8.17.1(transitive)
- Removeduberproto@^2.0.6
- Removed@types/component-emitter@1.2.14(transitive)
- Removed@types/cookie@0.4.1(transitive)
- Removedbase64-arraybuffer@0.1.4(transitive)
- Removedcomponent-emitter@1.3.1(transitive)
- Removedcookie@0.4.2(transitive)
- Removedengine.io@4.1.2(transitive)
- Removedengine.io-parser@4.0.3(transitive)
- Removedsocket.io@3.1.2(transitive)
- Removedsocket.io-adapter@2.1.0(transitive)
- Removedsocket.io-parser@4.0.5(transitive)
- Removeduberproto@2.0.6(transitive)
- Removedws@7.4.6(transitive)
Updatedsocket.io@^4.0.1