Skip to content

Commit f72321a

Browse files
committed
Release version 2.0.0-beta1
* Move aws-sdk to a dev dependency This enables smaller installation sizes in production when run in contexts, like AWS Lambda, where the SDK is already available.
1 parent b2b1d47 commit f72321a

File tree

4 files changed

+294
-524
lines changed

4 files changed

+294
-524
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,9 @@ knex.transaction(async trx => {
7373
}
7474
});
7575
```
76+
77+
## Breaking Changes
78+
### Version 1 to 2
79+
Version 1 depended on aws-sdk, which at the time of the change was 71 MB in size. This package may be used in contexts where package size is important and the SDK may already be available, such as AWS Lambda Functions.
80+
81+
Version 2 drops aws-sdk from a dependency to a dev dependency. This means you need to make sure the aws-sdk package is available in some form in your project. This can be accomplished by adding aws-sdk to your project's dependencies, or by allowing the package to be implicitly provided like it is in AWS Lambda Functions.

index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@ class Client_AuroraDataMySQL extends Client_MySQL { // eslint-disable-line camel
6767
}
6868

6969
_driver () {
70-
const RDSDataService = require('aws-sdk/clients/rdsdataservice');
70+
let RDSDataService;
71+
try {
72+
RDSDataService = require('aws-sdk/clients/rdsdataservice');
73+
} catch (err) { /* istanbul ignore next */
74+
throw new Error(`Failed to load aws-sdk rdsdataservice client, did you forget to install it as a dependency? (${err.message})`);
75+
}
76+
7177
const https = require('https');
7278

7379
const agent = new https.Agent({

0 commit comments

Comments
 (0)