alexa / alexa-skills-kit-sdk-for-nodejs

The Alexa Skills Kit SDK for Node.js helps you get a skill up and running quickly, letting you focus on skill logic instead of boilerplate code.
Apache License 2.0
3.13k stars 738 forks source link

v3 Javascript SDK compatibility? #697

Open paul-uz opened 3 years ago

paul-uz commented 3 years ago

When will this SDK be updated to work with the v3 JS SDK?

talkingnews commented 3 years ago

See also https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/issues/696 - same thing, opened 22 days ago but no comments...

sjcomstock67 commented 3 years ago

Thanks for the feedback @paul-uz and @talkingnews. This is something we definitely want to pick up. Prioritization has been challenging given competing priorities. But we'll take a look

rahulawl commented 2 years ago

Is this issue/feature-request still relevant? We are working on prioritization of relevant issues and cleanup of rest. If we don’t hear back in 2 weeks, we will assume that the issue is not relevant and we will close it.

paul-uz commented 2 years ago

Yes of course its still relevant. Why wouldn't it be?

seanfisher commented 1 year ago

@rahulawl It is still relevant and more needed than ever now that Node.js 18.x is out. From this AWS blog post:

In v3, the modular packages reduce the bundle size of your application by ~75% when compared to v2, which helps improve application performance. The middleware stack allows you to easily customize SDK behavior, where you can add your custom asynchronous actions and/or remove default ones. The v3 has first-class TypeScript support, which saves you time catching errors and providing fixes before you run your code.

Additionally, from this AWS blog post on the Node.js 18.x runtime:

Up until Node.js 16, Lambda’s Node.js runtimes have included the AWS SDK for JavaScript version 2. This has since been superseded by the AWS SDK for JavaScript version 3, which was released in December 2020. With this release, Lambda has upgraded the version of the AWS SDK for JavaScript included with the runtime from v2 to v3.

If your existing Lambda functions are using the included SDK v2, then you must update your function code to use the SDK v3 when upgrading to the Node.js 18 runtime. This is the recommended approach when upgrading existing functions to Node.js 18. Alternatively, you can use the Node.js 18 runtime without updating your existing code if you deploy the SDK v2 together with your function code.

Version 3 of the SDK for JavaScript offers many benefits over version 2. Most importantly, it is modular, so your code only loads the modules it needs. Modularity also reduces your function size if you choose to deploy the SDK with your function code rather than using the version built into the Lambda runtime. Learn more about optimizing Node.js dependencies in Lambda here.

Because ask-sdk does not use v3 of the AWS SDK, developers have to bundle the large v2 SDK code with their application - just for this library. When you're trying to reduce request latency from cold starts to service Alexa skills, this matters. Looks like this is also discussed in #696.

talkingnews commented 1 year ago

It's now almost 2 years since this issue was opened - it looks like this library is abandonded so we're going to have to work with what we've got.

Fortunately, there now appears to be a way of stopping all the warnings clogging up your logs...

https://github.com/aws/aws-sdk-js/issues/4354

Either use env var AWS_SDK_JS_SUPPRESS_MAINTENANCE_MODE_MESSAGE=1 or require('aws-sdk/lib/maintenance_mode_message').suppress = true;