aws / aws-sdk-js

AWS SDK for JavaScript in the browser and Node.js
https://aws.amazon.com/developer/language/javascript/
Apache License 2.0
7.57k stars 1.55k forks source link

Could we recommend developers to install `@aws-sdk/client-ses` directly? We now need to install `aws-sdk` first, then migrate from v2 to v3 with `aws-sdk-js-codemod`. #4605

Closed tjcchen closed 3 months ago

tjcchen commented 3 months ago

Describe the issue

Hi Team,

Recently, I needed to use Amazon Simple Email Service (SES) for the password resetting feature. After some investigation, I installed the npm package aws-sdk first.

Successfully configured the SendEmail service, then I got a warning prompt on the terminal like this:

(node:19860) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.

Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy

After revisiting your documentation, I understand I need to do the migration work from v2 to v3 with aws-sdk-js-codemod. The code is listed below:

npx aws-sdk-js-codemod@latest --dry --print -t v2-to-v3 utils/sesClient.ts

Finally, I pasted your generated v3 code and reinstalled @aws-sdk/client-ses, then the service worked OK, and without warning message.

Although I ultimately fixed this issue, but I think the procedure is too complicated. Why wouldn't we tell the developers who are first to use your service to install @aws-sdk/client-ses directly and use then your v3 code?

I think the documentation could change a little for better clarity.

Thanks, Andy

Links

https://www.npmjs.com/package/aws-sdk

RanVaknin commented 3 months ago

Hi @tjcchen ,

v2 existed since 2017 and is still heavily used, the warning message was introduced to inform legacy users of the v2 SDK that they should start migrating over to v3.

The very first line in v2 documentation, in our API reference, v2 Developer Guide and readme on this repo calls this exact change and informs customers to use v3

Thanks, Ran~

tjcchen commented 3 months ago

Hello @RanVaknin,

Thank you very much for your feedback. I mean if someone is new to your service, no need to migrate from v2 to v3.

I think for better clarity, we can suggest them to install v3 package directly.

https://github.com/aws/aws-sdk-js?tab=readme-ov-file#version-2x-upcoming-end-of-support

Or maybe my comment is in the wrong place. But anyway, I'm still very thankful for your update.

Cheers & happy coding!

Thanks, Andy