Thursday 18 October 2018

Require googleapis in private helper lib... good idea? bad idea?

My team and I are working on building various microservices between all of our business applications, and are about 1.5 years into our serverless journey. We are reaching out to various systems repeatedly(G-Suite, Workday, NetSuite, Zendesk, Etc), so we decided to create a common lib to store our helper functions, breaking each system into a separate class to allow us to tree shake what we need when we need it.The lib is starting to get large and the open topics on the table are:Is the way we've structured the common lib good practice? or should we be breaking this up into smaller lib modules per system?Each of these classes uses a large lib (ex. aws-sdk, googleapis, etc.) and in efforts to keep the common-lib small, we are passing in the clients from these large libs into the common lib constructor. Is this good practice?If we were to break up the common lib anyways, should we still be passing in the clients to keep those modules small?Using NodeJS 8.10Thanks in advance!

Submitted October 18, 2018 at 06:34PM by b1ackha7

No comments:

Post a Comment