Skip to content

AWS JavaScript SDK V3#162

Merged
LinusU merged 12 commits intoanacronw:masterfrom
Takaitra:aws-sdk-v3
May 27, 2022
Merged

AWS JavaScript SDK V3#162
LinusU merged 12 commits intoanacronw:masterfrom
Takaitra:aws-sdk-v3

Conversation

@Takaitra
Copy link
Copy Markdown
Contributor

@Takaitra Takaitra commented Jan 10, 2022

Description

Addresses #146

AWS SDK for JavaScript, v3, a rewrite of the AWS SDK, was announced in December 2020: https://aws.amazon.com/blogs/developer/modular-aws-sdk-for-javascript-is-now-generally-available/. V2 was monolithic whereas V3 introduces separate packages for each service. This upgrades multer-s3 to use v3 of the SDK, importing only the S3 module. This will accompanied by a major version bump to 3.0.0.

Changes

  1. AWS SDK v3 multipart, streaming uploads via @aws-sdk/lib-storage
  2. Update tests
  3. Update README

Testing

  1. Unit tests via npm test
  2. Integration test via https://github.com/Takaitra/multer-s3-test

@Takaitra
Copy link
Copy Markdown
Contributor Author

@LinusU can you please take a look? There is a lot of interest in a release that supports v3 of the AWS SDK.

@LinusU
Copy link
Copy Markdown
Collaborator

LinusU commented Jan 17, 2022

Use Multer's built-in mime type recognition for multerS3.AUTO_CONTENT_TYPE

Multer (2.x) doesn't have built-in mime type recognition, the value that code is updated to is the one provided by the client. Generally, depending on a mime type submitted by the client isn't a good idea and could lead to exploits (although detecting it isn't a silver bullet either, and could have similar problems...)

Anyhow, I not sure that we should remove that functionality since people might be using it? And if we are, we should update the documentation and remove the AUTO_CONTENT_TYPE constant.

Besides that, I would recommend to use Multer 3.x instead which makes this library obsolete...

@Takaitra
Copy link
Copy Markdown
Contributor Author

Takaitra commented Jan 18, 2022

Besides that, I would recommend to use Multer 3.x instead which makes this library obsolete...

I'm having trouble finding Multer 3.x. Can you provide a link please?

depending on a mime type submitted by the client isn't a good idea

I'll look into reverting this part of the PR.
Done. The diff is smaller now.

Comment thread README.md Outdated
Comment thread package.json Outdated
Comment thread package.json Outdated
Comment thread test/basic.js Outdated
Comment thread test/util/mock-s3.js Outdated
Comment thread index.js Outdated
Copy link
Copy Markdown
Collaborator

@LinusU LinusU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments, could you also please remove the package-lock.json file? Since this is a library for others to consume, that lock file will not be respected when anyone depends on this library and thus we don't want it committed here...

@LinusU
Copy link
Copy Markdown
Collaborator

LinusU commented Jan 18, 2022

I'm having trouble finding Multer 3.x. Can you provide a link please?

expressjs/multer#399

Takaitra and others added 4 commits January 18, 2022 08:59
Co-authored-by: Linus Unnebäck <linus@folkdatorn.se>
Co-authored-by: Linus Unnebäck <linus@folkdatorn.se>
@Takaitra
Copy link
Copy Markdown
Contributor Author

Takaitra commented Jan 18, 2022

Thank you for the comments. I reran the unit and integration tests and they pass.

Regarding versioning, 2.x.x should be branched so it can continue to be maintained separately right?

@Takaitra Takaitra requested a review from LinusU January 18, 2022 17:13
@Takaitra
Copy link
Copy Markdown
Contributor Author

Bump

@aitorosabrooktec
Copy link
Copy Markdown

When can we expect merging of PR?

@1valdis
Copy link
Copy Markdown

1valdis commented Mar 25, 2022

@LinusU is there anything blocking the merge and release?

@lukes00
Copy link
Copy Markdown

lukes00 commented Apr 4, 2022

@LinusU would really appreciate this PR being merged 🙏

@adriandersen
Copy link
Copy Markdown

Any status on this?

@LinusU LinusU merged commit 92f1494 into anacronw:master May 27, 2022
LinusU pushed a commit that referenced this pull request May 27, 2022
Migration Guide:

When upgrading to this version, you also need to migrate from version 2 of the AWS JavaScript SDK to version 3. Instead of passing an instance of the old `aws.S3`, use the new `S3Client` class from `@aws-sdk/client-s3`.

The minimum required version of Node.js has also been increased to 12.0.0, to align with the AWS JavaScript SDK.
@LinusU
Copy link
Copy Markdown
Collaborator

LinusU commented May 27, 2022

I'm really sorry for dropping the ball on this!

It's now merged and released as 🚢 3.0.0 / 2022-05-27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants