-
Notifications
You must be signed in to change notification settings - Fork 146
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
Feature request: implement top-level await & ESM #1033
Comments
|
Hey @dreamorosi , do you have an alpha release for this already? |
Hi @marcioemiranda, yes - I just published the first alpha release. You can download it by running Note that I haven't yet been able to publish the docs, nor release notes, that's why I haven't announced it yet. |
This is available in preview starting from the |
Description of the feature request
Problem statement
With ES modules, developers may use top-level await within their functions. This allows developers to use the await keyword in the top level of the file. With this feature, Node.js functions may now complete asynchronous initialization code before handler invocations.
In the context of the Parameters utility, this minimises the execution time in favor of a longer and single initialisation time as parameters that are shared across invocations could be fetched ahead and used immediately when the handler is executed.
Summary of the feature
For this feature to be possible two things need to happen:
Code examples
N/A
Benefits for you and the wider AWS community
Shorter execution times, simpler handler logic
Describe alternatives you've considered
Fetching all secrets in the handler's scope.
Additional context
Depending on the strategy that is decided in #521 examples should be provided in the docs for both ESM and CJS since the latter won't have access to top-level async/await.
Related issues, RFCs
#846
#521
The text was updated successfully, but these errors were encountered: