Visitar URL original
fix(typings): ensure compatibility with TypeScript 3.x by delucis · Pull Request #4259 · socketio/socket.io · GitHub
Skip to content

fix(typings): ensure compatibility with TypeScript 3.x - #4259

Merged
darrachequesne merged 1 commit into
socketio:masterfrom
delucis:delucis/fix/typings
Jan 25, 2022
Merged

darrachequesne merged 1 commit into
socketio:masterfrom
delucis:delucis/fix/typings

Conversation

@delucis

@delucis delucis commented Jan 23, 2022 •

Copy link
Copy Markdown
Contributor

The kind of change this PR does introduce

  • a bug fix

Current behavior

#4138 added an Event type using Typescript’s labelled tuple syntax:

type Event = [eventName: string, ...args: any[]];

This fails to compile if a consumer is using a TypeScript version less than 4.x

Reference: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#labeled-tuple-elements

New behavior

This PR removes the labelling in the Event type to continue to support TypeScript 3.x as did 0cb6ac9.

@darrachequesne
darrachequesne merged commit 02c87a8 into socketio:master Jan 25, 2022
@darrachequesne

Copy link
Copy Markdown
Member

@delucis thanks 👍

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.

2 participants