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

Message type is not exposed #384

Closed
matehuszarik opened this issue Mar 23, 2023 · 7 comments
Closed

Message type is not exposed #384

matehuszarik opened this issue Mar 23, 2023 · 7 comments
Milestone

Comments

@matehuszarik
Copy link

matehuszarik commented Mar 23, 2023

Describe the bug

AWS Message type is not re-exported from the package.

Most of the functions (e.g.: handleMessage operate with this type and it would be good to use it after installing sqs-consumer.

Your minimal, reproducible example

Steps to reproduce

Expected behavior

As a user I'd like to provide type safety by importing Message type.

import { Message } from 'sqs-consumer'

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

  • OS: macos
  • Node: all version

Package version

v6.x.x

AWS SDK version

No response

Additional context

No response

@nicholasgriffintn
Copy link
Member

I'm not sure this is actually required, as you need to install sqs-client anyway, it's realistically not that different or better from doing this:

import { Message } from '@aws-sdk/client-sqs';

I'll have a think on it, we did used to do it, but that was when we were adjusting the type ourselves.

@matehuszarik
Copy link
Author

I'm a bit confused because the @aws-sdk/client-sqs pkg is added to peerDependencies and dependencies too.
https://github.com/bbc/sqs-consumer/blob/main/package.json#L65

Because of this, I'm not required to install the pkg separately.

@nicholasgriffintn
Copy link
Member

As of version 7 of npm, peer dependencies are also auto installed, but either way, you still need to install it yeah.

@matehuszarik
Copy link
Author

As of version 7 of npm, peer dependencies are also auto installed

Exactly, so I don't have to add @aws-sdk/client-sqs to dependencies separately and can not import the Message type. This is the problem I'd like to solve.

IMO sqs-consumer should either enforce the installation of @aws-sdk/client-sqs or re-export the Message type.

@nicholasgriffintn
Copy link
Member

Well no, the use case of needing the Message type is not that great (we haven't been exporting it for about half a year).

I'm not sure that it's that big of an ask for the user to import it directly themselves honestly, it's not something we're ever going to modify.

This isn't a bug either btw, so I'm gonna change the labelling.

@nicholasgriffintn nicholasgriffintn added feature-request feature request and removed bug labels Mar 24, 2023
@nicholasgriffintn nicholasgriffintn added this to the 7.1.0 milestone Apr 10, 2023
@nicholasgriffintn
Copy link
Member

This has sort of been done in #385 I'm not happy with it though due to the docs issues.

Thinking about the time I have available, I'm going to decide not to do this, if anyone would still like to do this, feel free to open a new pr with the documentation fixed.

@nicholasgriffintn nicholasgriffintn closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2023
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants