anacronw / multer-s3

multer storage engine for amazon s3
MIT License
660 stars 190 forks source link

feat: support for both v2 and v3 AWS Javascript SDK #174

Closed rielicat closed 2 years ago

rielicat commented 2 years ago

This PR adds support for both v2 and v3 of AWS Javascript SDK.

Imagine a really huge project that is slowly migrating from v2 to v3 and uses multer-s3 in multiple places with mixed versions of the S3 Client, it won't be possible for them to use multer-s3 anymore.

Takaitra commented 2 years ago

The AWS SDK v3 has TypeScript support built in. Both v2 and v3 of multer-s3 have TypeScript types via @types/multer-s3. See https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/multer-s3/index.d.ts. Adding this backward compatibility to the TypeScript definitions adds a transitive dependency on both v2 and v3 of the AWS SDK negating the benefit of using the modular v3 SDK.

Can you use npm package aliases in your project?

rielicat commented 2 years ago

Makes sense to preserve the modular benefit from AWS SDK v3. Will use npm package aliases for this scenario.

Thanks!

LinusU commented 2 years ago

Sorry for the late reply, I also feel like the increased maintenance burden makes this change out of scope for the project. I would recommend having both the old and new version of multer-s3 installed in order to work around your transitioning period...