Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: socket compatible with different system platforms #2450

Merged
merged 2 commits into from
Jul 16, 2019

Conversation

chenbin92
Copy link
Collaborator

@chenbin92 chenbin92 commented Jul 15, 2019

问题

socket 在不同的 Node 版本上出现以下 Error 导致页面白屏

image

解决

Refs: https://socket.io/docs/client-api/#With-websocket-transport-only

const socket = io({  transports: ['websocket']});

@chenbin92 chenbin92 self-assigned this Jul 15, 2019
@chenbin92 chenbin92 requested a review from alvinhui July 15, 2019 09:23
@alvinhui
Copy link
Collaborator

alvinhui commented Jul 15, 2019

  1. socket.io 的 transports 默认值是 ['polling', 'websocket'],这样设定的好处是当 websocket 不可用时,依然可以通过轮询去实现实时通信。这样看来这个默认值的设定并无问题?

  2. socket.io 不可用的问题,似乎跟下面的讨论有关:

没有深入了解,看评论,是 node 8 不可用,node 10 最新版本可用。
如果是这样的话,我们可以通过 engine 的设定来指定我们支持的 node 版本?只支持 node 10? @imsobear

@chenbin92
Copy link
Collaborator Author

chenbin92 commented Jul 15, 2019

  1. socket.io 的 transports 默认值是 ['polling', 'websocket'],这样设定的好处是当 websocket 不可用时,依然可以通过轮询去实现实时通信。这样看来这个默认值的设定并无问题?

  2. socket.io 不可用的问题,似乎跟下面的讨论有关:

没有深入了解,看评论,是 node 8 不可用,node 10 最新版本可用。
如果是这样的话,我们可以通过 engine 的设定来指定我们支持的 node 版本?只支持 node 10? @imsobear

  1. node v10.15.3 的版本不可用,其他 10.x 的版本未测试
  2. node 8.x 的版本可用

@chenbin92 chenbin92 changed the base branch from iceworks/release-3.0.0-beta.4 to iceworks/release-3.0.0-beta.5 July 15, 2019 13:43
@alvinhui
Copy link
Collaborator

alvinhui commented Jul 16, 2019

从用户反馈来看,一下两个版本都有问题:

  • 10.15.x
  • 8.x

@chenbin92 确定吗?

@chenbin92
Copy link
Collaborator Author

从用户反馈来看,一下两个版本都有问题:

  • 10.15.x
  • 8.x

@chenbin92 确定吗?

image

image

@alvinhui alvinhui merged commit e297fcb into iceworks/release-3.0.0-beta.5 Jul 16, 2019
@delete-merged-branch delete-merged-branch bot deleted the iceworks/socket-compatible branch July 16, 2019 06:21
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants