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

7.0.2 typing inaccuracies #216

Closed
simon-barton opened this issue Jun 12, 2023 · 5 comments · Fixed by #217
Closed

7.0.2 typing inaccuracies #216

simon-barton opened this issue Jun 12, 2023 · 5 comments · Fixed by #217
Assignees
Labels
support Questions, discussions, and general support
Milestone

Comments

@simon-barton
Copy link

simon-barton commented Jun 12, 2023

Support plan

  • is this issue currently blocking your project? (no):
  • is this issue affecting a production system? (no):

Context

  • node version: v16.18.0
  • module version with issue: 7.0.2
  • last module version without issue: 7.0.1
  • environment (e.g. node, browser, native): node
  • used with (e.g. hapi application, another framework, standalone, ...): hapi
  • any other relevant information: TypeScript

What are you trying to achieve or the steps to reproduce?

Our application maintains a list of plugins with the type ServerRegisterPluginObject<T, D>[] which the default export of @hapi/vision adheres to.

The recent typing additions however has the default export as a Plugin rather than a wrapped object. The correct typing should resemble something like @hapi/inert where the Plugin type is wrapped.

What was the result you got?

Incorrect typing. Worked around with @ts-ignore.

What result did you expect?

Accurate typing.

@simon-barton simon-barton added the support Questions, discussions, and general support label Jun 12, 2023
@Marsup
Copy link
Contributor

Marsup commented Jun 12, 2023

To get a correct understanding, we incorporated the DT types without any modification, was this bug already present or is it a new one?

@simon-barton
Copy link
Author

It must've already been present in the DT types if it was a straight copy. I don't use DT types as they can be a bit flakey and slow to catch up so tend to rely on those provided by the libraries themselves, hence why it's only become apparent for us in this latest release.

@fmlukaszmatusik
Copy link

Struggling with the same problem from 7.0.2

Marsup pushed a commit that referenced this issue Aug 4, 2023
Marsup pushed a commit that referenced this issue Aug 4, 2023
Marsup added a commit that referenced this issue Aug 4, 2023
Ported from #214.
Fixes #216.

Co-authored-by: Danilo Alonso <damusix@gmail.com>
@Marsup
Copy link
Contributor

Marsup commented Aug 4, 2023

Is it better now?

@Marsup Marsup added this to the 7.0.3 milestone Aug 4, 2023
@Marsup Marsup self-assigned this Aug 4, 2023
@fmlukaszmatusik
Copy link

Seems it works fine right now, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Questions, discussions, and general support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants