Powertools for AWS Lambda (TypeScript) v3 - Ideas and notes #2560
Replies: 8 comments
-
Relating to the Batch Processor utility, the components of the utility follow an inheritance pattern with some abstract classes and methods. During the initial implementation we weren't necessarily the most diligent and so almost all methods were marked as Some of these methods (my feeling is that it's most of them) could potentially be converted to As part of v3 we could consider doing an exercise of minor refactoring and clean up the public API. |
Beta Was this translation helpful? Give feedback.
-
Maybe consider #749 for v3 if that would cause any breaking changes. |
Beta Was this translation helpful? Give feedback.
-
In aws-powertools/powertools-lambda-python#4907 the |
Beta Was this translation helpful? Give feedback.
-
As discussed in #3085, in v3 we will switch the In v5.0 of TypeScript, the default changed to Stage 3 decorators, which modify the signature of the decorator significantly as discussed more in depth here. While doing this, we should also make our decorators compatible with asynchronous methods only. Today they support both but in reality they implicitly convert sync methods to async under the hood. This is not a huge issue when decorating the main function handler since AWS Lambda will handle the promise correctly, but when decorating arbitrary methods this can cause subtle bugs. |
Beta Was this translation helpful? Give feedback.
-
Following the implementation of #3160 that adds async processing to SQS FIFO queues, to avoid breaking changes we had to invert the convention of At minimum, on v3 we should standardize this implementation to follow the rest of the Batch Processor classes. Additionally, as @am29d pointed out, there might be an opportunity to streamline the implementation and API of this utility significantly while making minimal breaking changes. For example, we could explore reducing the number of classes to have only one batch processor for event source, and then have both synchronous and asynchronous methods on it, so that customers don't have to think which one they need to import and use but just call We are unsure if this is possible or the extent of breaking changes it'll require - for now we're adding this to the v3 list to explore further. |
Beta Was this translation helpful? Give feedback.
-
Another item we're looking to remove or rework is the custom configuration services from the core utilities. Today it's possible to pass a custom configuration service to the constructor of Tracer, Metrics, and Logger which will be used during initialization. Currently this feature doesn't seem to have gotten any traction, most likely also because it's not documented anywhere, but also because it's too rigid. Defining your custom configurations service requires you to reimplement the entire interface, which might not be desirable when you want to only override one behavior. |
Beta Was this translation helpful? Give feedback.
-
In v3 we should stop including the Currently we still add the dimension but with value Customers have asked us to change this but doing so requires a breaking change, so I'm adding this here. More info in #3374. |
Beta Was this translation helpful? Give feedback.
-
Change |
Beta Was this translation helpful? Give feedback.
-
I would like to open a discussion to gather and ideally discuss ideas and changes for our next v3 milestone.
Note that at the time of writing we don't have any date nor plans for our next major version, however I think it'd be good to start gathering notes & ideas for things we might encounter along the way that we wish we could address but can't due to major refactors or breaking changes.
Beta Was this translation helpful? Give feedback.
All reactions