Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Technically, the interface is still compatible with version 3.x (`100x100_max/my-image.jpg` - the path is still the same), but this update brings major changes including using new import/export syntax, so the decision was to jump to a new version. Here is what's new: - Update the Sharp library: [v0.23.3](https://www.npmjs.com/package/sharp/v/0.23.3) => [v0.32.0](https://www.npmjs.com/package/sharp/v/0.32.0) - Update AWS SDK: [aws-sdk v2.36.0](https://www.npmjs.com/package/aws-sdk/v/2.36.0) => [@aws-sdk/client-s3 v3.304.0](https://www.npmjs.com/package/@aws-sdk/client-s3/v/3.304.0). The former api contained the whole sdk with 99% unused code whereas the new one contains functions specific to S3. - Buffers were replaced by streams. So now it's almost impossible to go out-of-memory if an image is too large (though it is still highly recommended to keep memory big +512mb, you can do that in Configuration->Edit) - CommonJS => ES Module. And hence `require/exports` => `import/export`. They promise to be faster as well. - Reduce zip size containing compiled node_modules: 30mb => 10mb. - If `?path=` is not set, return explaining message and `statusCode: 400`. Previously it was `Internal Server Error` with `statusCode: 500`. 🎉 Compiled and tested for NodeJS 18.x 🎉 ```bash npm i --arch=x64 --platform=linux npm i --arch=x64 --platform=linux --only=prod ``` Use the latter only if you know what you are doing! It does not contain awk libraries in node_modules, so the latest version of the sdk will be used. You can configure auto update of built-in sdk in lambda _Runtime settings -> Edit runtime management configuration -> Update runtime version_.
- Loading branch information