Skip to content

Conversation

@briangough
Copy link

This PR removes the dependency on socket.io-client and requires the socket.io client files to be served from express in the calling app with a route like this:

app.get('/socket.io/socket.io.js', function (req, res) {
  res.sendFile(
    Path.join(__dirname, 'node_modules/socket.io-client/dist/socket.io.min.js')
  )
})

This removes the unwanted call to uglify and gzip in the upstream file static.js where socket.io was minifying and gzipping files at runtime.

@briangough briangough self-assigned this Oct 25, 2022
@briangough briangough requested a review from das7pad October 25, 2022 13:19
@briangough briangough marked this pull request as ready for review October 25, 2022 13:19
@briangough briangough assigned das7pad and unassigned briangough Oct 25, 2022
Copy link
Member

@das7pad das7pad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Bonus for the real-time part: Gzip the socket.io.js.min file in CI (e.g. in the Dockerfile or we commit it into the socket.io-client/dist/ folder) and serve it when the client supports compression.

@das7pad das7pad assigned briangough and unassigned das7pad Oct 25, 2022
@briangough briangough merged commit 0f1d0b6 into 0.9.x Oct 25, 2022
@briangough briangough deleted the bg-remove-client branch October 25, 2022 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants