Giter VIP home page Giter VIP logo

Comments (5)

jeremydaly avatar jeremydaly commented on September 26, 2024 3

The dependency has been removed in the v0.2 branch.

from dynamodb-toolbox.

jeremydaly avatar jeremydaly commented on September 26, 2024 1

Been thinking more about this and I'm going to remove this dependency from the project. Instead, I'm going to require you to pass in an instance of the DynamoDB DocumentClient. v0.2 is moving to issuing calls directly (rather than just returning a formatted call), so this will give you the ability to fully control your AWS SDK settings.

from dynamodb-toolbox.

jeremydaly avatar jeremydaly commented on September 26, 2024

The recommended practice is NOT to rely on the included SDK in the Node runtimes, but making this optional would make sense. Also, if you are webpacking your Lambda functions, then the tree-shaking will significantly reduce the dependency size.

from dynamodb-toolbox.

alexdilley avatar alexdilley commented on September 26, 2024

Thanks for your response.

Oh, that's strange; why's it not good practice to rely on the included SDK? Why wouldn't it be safe to assume that the version appropriate to the NodeJS runtime is available and fully functional. I've never had any problems, but that's not to say their aren't things I'm not aware of!

from dynamodb-toolbox.

serverlesspolska avatar serverlesspolska commented on September 26, 2024

Hi @alexdilley
I don't want to start a discussion over this topic (it's not the place). However, I can offer you a hack that can be useful in development when you deploy to AWS often and you are not using sets.

Go to node_modules/dynamodb-toolbox/package.json in your project and remove aws-sdk from dependencies. Then the serverless framework will not include it. For my simple project package size went down from 9MB to ~600KB, deploys are significantly faster now.

Also, in your own project set aws-sdk as dev dependency otherwise, this hack will not work for you.

@jeremydaly is using AWS-SDK to create sets on line 508 & 512 you can see it here
https://github.com/jeremydaly/dynamodb-toolbox/blob/master/index.js#L508. If you're not using it you're safe to remove it.

Again, it's a dirty hack. You've been warned :-)

from dynamodb-toolbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.