Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Exports the Namespace and Socket type v3 #3699

Merged
merged 1 commit into from Jan 14, 2021

Conversation

ptejada
Copy link
Contributor

@ptejada ptejada commented Nov 18, 2020

Exports the Namespace and Socket type from MJS wrapper

The kind of change this PR does introduce

  • a bug fix
  • a new feature
  • an update to the documentation
  • a code change that improves performance
  • other

Current behavior

MJS wrapper only exports Server

New behavior

MJS wrapper exports Server, Namaspace and Socket types

Other information (e.g. related issues)

I would say is a continuation of PR #3684 and my comment there
#3684 (comment)

Exports the Namespace and Socket type from MJS wrapper
@ptejada ptejada changed the title Exports the Namespace and Socket type Exports the Namespace and Socket type v3 Nov 18, 2020
@darrachequesne
Copy link
Member

May I ask what the use case is?

For TypeScript, I understand that it can be used for englobing types:

import { Namespace } from "socket.io";

class Application {
  private mainNamespace: Namespace;
}

But is this needed for ES modules?

@ptejada
Copy link
Contributor Author

ptejada commented Nov 26, 2020

@darrachequesne
Correct is only for ES module and type hinting with JSDoc. IDEs, or at least Jetbrains IDEs cannot resolve the Namaspace or Socket for autocomplete, inline docs and so on.

Without my update
image

With the update
image

@darrachequesne
Copy link
Member

@ptejada oh ok. Could you please open an issue in Jetbrains issue tracker then? (here I guess: https://youtrack.jetbrains.com/issues/WEB)

@ptejada
Copy link
Contributor Author

ptejada commented Nov 28, 2020

I don't think is an issue of the IDE. What is the purpose of the wrapper.mjs file?

That is the file the IDE is referencing which only exports Server at the moment.

I don't have enough information to log bug report for the IDE. All I know is making the edits in the PR fixes the references.

@darrachequesne darrachequesne merged commit 233650c into socketio:master Jan 14, 2021
@darrachequesne darrachequesne added this to the 3.1.0 milestone Jan 15, 2021
This was referenced Mar 10, 2021
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.

None yet

3 participants