Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The previous (CJS module) export semantics were of a namespace-style export, while the semantics introduced in c76d367 are of a single value exported as the default value instead. This broke downstream consumers who were using the namespace-style export, as documented at socketio/socket.io#4121. While the single default export should work fine (and might be preferable!), it's a breaking change, and appears to be an accidental breaking change, so this reverts to the previous semantics.
Accordingly, (re)introduce a manual 'namespace' by assigning the other exported value objects to the
lookup
function, thereby allowing it to be called directly, e.g.io(...)
, or used to access the other values, e.g.io.connect(...)
. Maintain the other existing exports so that the nice new ES module interface is still useful in its own right.The kind of change this PR does introduce
Current behaviour
Accidentally switched away from namespace-style export.
New behaviour
Revert to previous namespace-style export.
Other information (e.g. related issues)
socketio/socket.io#4121 has the details and the history of my root-causing this.