[BREAKING CHANGE] update the sockiet.io's version
Refs:https://github.com/eggjs/egg/issues/5006.
[Breaking Changes]
-
Socket.id cannot be generated through function's replacement, we have to override the Socket.id in the middleware instead.
-
Nodejs Only supports >=14.x.x
-
Egg only supports >= 3.x.x
Ref:
-
https://github.com/eggjs/egg-socket.io/pull/44
-
https://github.com/socketio/socket.io/pull/3761
change unittest to github action
Before converting this to GitHub Actions……I want to confirm several things:
-
Mine is only a simple test (a rough solution) to try to update socketIO from v2 directly to v4, it will have a BREAK CHANGE now, so all the older versions of Nodejs WON'T be supported. Is that OK?
-
'uws' is officially abandoned, do we really need a replacer called 'eiows' instead? Any other better solutions? Notice 'eiows' needs Nodejs >= 14... And if we use 'eiows', we have to compile through C++, I'm now trying and it really takes me quite a long time to download windows-build-tools in the console app……
-
Maybe this needs a discussion.....?
node14 这个没问题,egg3 已经是 14+ 了。
c++ 模块这个我就不懂了, @hyj1991 有什么建议?
package-lock.json 不要提交上来吧
c++ 模块这个我就不懂了, @hyj1991 有什么建议?
是的。就是说有没有必要为了一个已经被废弃的模块,替换成另外一个add-on,然后让开发者安装相关的编译组件做一大堆配置,而后把程序关键部分改掉?又或者说直接抛弃uws——因为这个库已经被作者彻底清空(话说真不负责……哎!)
- https://www.npmjs.com/package/uws
- https://medium.com/@alexhultman/beware-of-tin-foil-hattery-f738b620468c
模块中最好不要内置需要编译的,会产生大量编译相关的 issue
@hyj1991 :那怎么处理?目前没有更好替代的。作者那个uWebSocket无法直接使用,因为和WebSocket的接口方法完全不一致。那个你可以看一下我提交时候具体信息,看看SocketIO和uWebSocket,eiwos等内容,变化挺大的。
还是要不先讨论一下,这个因为要引入一连串BREAKING CHANGE的库。 谢谢你们!
话说,uWebSockets.js 这个咋样,是不是可以写个新插件
话说,uWebSockets.js 这个咋样,是不是可以写个新插件
我没有用过这个三方工具,得空看一下。 不过这个还是需要预装C++一大堆东西进行编译的,前置工作很多。
Now I've kept the old version of uws so that it cannot be updated any more (So the file won't be affected by the milicious attack). And I've forcely updated the Socket.IO to the latest version.
目前我因为uwsSocket那个类库尝试了多次,均未成功。而且要换库的话改动很大,暂时先升级Socket.IO到最新版本. 这是一个很大的改动,具体可以看上面说明。