feathersjs / feathers

The API and real-time application framework
https://feathersjs.com
MIT License
15.08k stars 752 forks source link

uWebsocket deprecated #1223

Closed matiaslopezd closed 5 years ago

matiaslopezd commented 5 years ago

Steps to reproduce

uWebSocket npm package here are deprecated, check here.

Expected behavior

Initialize uWebSocket with a stable npm package

Actual behavior

Can't initialize uWebSocket with deprecated package

internal/modules/cjs/loader.js:582
    throw err;
    ^

Error: Cannot find module 'uws'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
    at Function.Module._load (internal/modules/cjs/loader.js:506:25)    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Server.init (C:\xampp\htdocs\api-feathers\node_modules\engine.io\lib\server.js:107:28)
    at new Server (C:\xampp\htdocs\api-feathers\node_modules\engine.io\lib\server.js:65:8)
    at Function.attach (C:\xampp\htdocs\api-feathers\node_modules\engine.io\lib\engine.io.js:123:16)
    at Server.initEngine (C:\xampp\htdocs\api-feathers\node_modules\socket.io\lib\index.js:310:21)
    at C:\xampp\htdocs\api-feathers\node_modules\socket.io\lib\index.js:295:10
    at Encoder.encode (C:\xampp\htdocs\api-feathers\node_modules\socket.io-parser\index.js:135:5)
    at Server.listen.Server.attach (C:\xampp\htdocs\api-feathers\node_modules\socket.io\lib\index.js:290:16)
    at new Server (C:\xampp\htdocs\api-feathers\node_modules\socket.io\lib\index.js:59:17)
    at Function.Server [as listen] (C:\xampp\htdocs\api-feathers\node_modules\socket.io\lib\index.js:44:41)
    at Function.setup (C:\xampp\htdocs\api-feathers\node_modules\@feathersjs\socketio\lib\index.js:50:16)
    at Function.newMethod [as setup] (C:\xampp\htdocs\api-feathers\node_modules\uberproto\lib\proto.js:34:20)
    at Function.listen (C:\xampp\htdocs\api-feathers\node_modules\@feathersjs\express\lib\index.js:63:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! v-1@0.0.0 start: `node src/`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the v-1@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Module versions (especially the part that's not working): npm install uws --save -> uws@99.0.0 DEPRECATED

NodeJS version: v10.13.0

Module Loader: @feathersjs/cli

Suggested Solution

Npm package is updated here.

npm install uNetworking/uWebSockets.js#v15.1.0

daffl commented 5 years ago

Thanks. The uws section has been removed from the documentation.

8BallBomBom commented 5 years ago

Is this actually being removed?

daffl commented 5 years ago

uws has been deprecated for a while and was never used with Feathers (or the CLI) itself. Current versions of Socket.io come with a performant websocket engine that does not require any additional configuration.

jafri commented 5 years ago

image image

Socket.io performance issues still remain, it would be worthwhile to support uWebSockets.js

daffl commented 5 years ago

This is why Feathers also has a Primus adapter which allows support for many other websocket libraries. Please submit an issue there first.

Native Feathers transport adapters are usually more established libraries (currently planned: KoaJS and native HTTP/HTTP2) or will have to be community contributions.