Skip to content

Feature request: provide scoped subpath exports for schemas & envelopes #2829

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

Closed
1 of 2 tasks
dreamorosi opened this issue Jul 24, 2024 · 6 comments · Fixed by #2847
Closed
1 of 2 tasks

Feature request: provide scoped subpath exports for schemas & envelopes #2829

dreamorosi opened this issue Jul 24, 2024 · 6 comments · Fixed by #2847
Assignees
Labels
completed This item is complete and has been merged/shipped feature-request This item refers to a feature request for an existing or new utility parser This item relates to the Parser Utility

Comments

@dreamorosi
Copy link
Contributor

Use case

The Parser utility has a number of built-in schemas and envelopes that customers can use in their functions. Currently, all of these except two are exposed via a barrel file @aws-lambda-powertools/parser/schemas.

We should work towards exporting each category of schemas and envelopes on a per-service basis via dedicated exports.

Solution/User Experience

Customers should be able to import any given schema or envelope using a targeted export, for example, all the API Gateway-related schemas should be available under the @aws-lambda-powertools/parser/schemas/api-gateway export and all the S3 ones under @aws-lambda-powertools/parser/schemas/s3, the same applies to envelopes which would have, for example, SQS envelopes under @aws-lambda-powertools/parser/envelopes/sqs.

With this change, customers would be able to have a slimmer bundle since they'd be importing only the schemas/envelopes of the category they're actually using instead of all of them.

Alternative solutions

No response

Acknowledgment

Future readers

Please react with 👍 and your use case to help us understand customer demand.

@dreamorosi dreamorosi added help-wanted We would really appreciate some support from community for this one feature-request This item refers to a feature request for an existing or new utility confirmed The scope is clear, ready for implementation parser This item relates to the Parser Utility labels Jul 24, 2024
@dreamorosi dreamorosi moved this from Triage to Backlog in Powertools for AWS Lambda (TypeScript) Jul 24, 2024
@daschaa
Copy link
Contributor

daschaa commented Jul 24, 2024

I would like to take this issue :) One question tho: Should the barrel export stay for backwards compatibility (and the explicit exports are added on top)? So that it doesn't break existing code?

@dreamorosi
Copy link
Contributor Author

Thank you @daschaa, assigning this to you!

Should the barrel export stay for backwards compatibility (and the explicit exports are added on top)? So that it doesn't break existing code?

Yes, we will leave it both for backwards compatibility but also for convenience for those who can't/don't want to use subpath exports.

@dreamorosi dreamorosi moved this from Backlog to Working on it in Powertools for AWS Lambda (TypeScript) Jul 24, 2024
@am29d
Copy link
Contributor

am29d commented Jul 25, 2024

While we are talking about exports, this is a good opportunity to close #2811 , should we do both with one PR?

@dreamorosi
Copy link
Contributor Author

dreamorosi commented Jul 25, 2024

should we do both with one PR?

I would do them separately (easier to review, identify issues, and revert if needed), but ideally would do #2811 first so we can include the new schemas from that PR in the exports from this one as well.

Copy link
Contributor

⚠️ COMMENT VISIBILITY WARNING ⚠️

This issue is now closed. Please be mindful that future comments are hard for our team to see.

If you need more assistance, please either tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

@github-actions github-actions bot added pending-release This item has been merged and will be released soon and removed help-wanted We would really appreciate some support from community for this one confirmed The scope is clear, ready for implementation labels Jul 29, 2024
Copy link
Contributor

github-actions bot commented Aug 8, 2024

This is now released under v2.7.0 version!

@github-actions github-actions bot added completed This item is complete and has been merged/shipped and removed pending-release This item has been merged and will be released soon labels Aug 8, 2024
@dreamorosi dreamorosi moved this from Coming soon to Shipped in Powertools for AWS Lambda (TypeScript) Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed This item is complete and has been merged/shipped feature-request This item refers to a feature request for an existing or new utility parser This item relates to the Parser Utility
Projects
3 participants