From b214d868dfa18f95960407fd23b996f96276cce9 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Fri, 22 Nov 2019 11:13:55 -0800 Subject: [PATCH 01/14] doc: bundle style difference between legacy and modular approaches --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 65bc70a7974d4..c42d176895ac4 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,8 @@ example(); ``` If you want to use non-modular (v2-like) interfaces, you can import client with only the service name (e.g DynamoDB), and call the operation name directly from the client: +======= +For users want to use legacy (v2-like) interfaces, you can import client with only the service name(e.g DynamoDB), and call the operation name directly from the client: ```javascript const { DynamoDB } = require("@aws-sdk/client-dynamodb-node"); @@ -58,6 +60,8 @@ example(); ``` If you use tree shaking to reduce bundle size, using non-modular interface will increase the bundle size as compared to using modular interface. +======= +If you use tree shaking to reduce bundle size, using legacy interface will increase the bundle size as compared to using modular interface. In our workshop code, a lambda with DynamoDBClient and a command takes ~18kB while DynamoDB takes ~26 kB ([details](https://github.com/aws-samples/aws-sdk-js-v3-workshop/blob/dc3ad778b04dfe3f8f277dca67162da79c937eca/Exercise1/backend/README.md#reduce-bundle-size-by-just-importing-dynamodb)) ## New features From 7b456b2ad1d52b5c9c304fc93c4a40a07b7f2077 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Sun, 24 Nov 2019 14:07:57 -0800 Subject: [PATCH 02/14] WIP: experimental commit --- .../test/integ/index.spec.ts | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 clients/node/client-dynamodb-node/test/integ/index.spec.ts diff --git a/clients/node/client-dynamodb-node/test/integ/index.spec.ts b/clients/node/client-dynamodb-node/test/integ/index.spec.ts new file mode 100644 index 0000000000000..4bafcd4ec8ffa --- /dev/null +++ b/clients/node/client-dynamodb-node/test/integ/index.spec.ts @@ -0,0 +1,49 @@ +import { DynamoDB } from "../../DynamoDB"; + +describe("DynamoDB integration tests", () => { + const client = new DynamoDB({}); + const tableName = `aws-js-integration-${Math.random() + .toString(36) + .substring(2)}`; + + describe("Table CRUD operations", () => { + beforeAll(async () => { + const params = { + TableName: tableName, + AttributeDefinitions: [ + { + AttributeName: "Artist", + AttributeType: "S" + }, + { + AttributeName: "SongTitle", + AttributeType: "S" + } + ], + KeySchema: [ + { + AttributeName: "Artist", + KeyType: "HASH" + }, + { + AttributeName: "SongTitle", + KeyType: "RANGE" + } + ], + ProvisionedThroughput: { + ReadCapacityUnits: 5, + WriteCapacityUnits: 5 + } + }; + const response = await client.createTable(params); + console.log(response); + }); + + afterAll(async () => { + const response = await client.deleteTable({ + TableName: tableName + }); + console.log(response); + }); + }); +}); From 7e6b8598cef0d156a80c28d095809aa0414eebc0 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Sun, 24 Nov 2019 15:37:23 -0800 Subject: [PATCH 03/14] chore: tested basic integ test Ran as follows: * run `yarn` from root * run following command from root to install dynamodb dependencies `lerna run pretest --scope '@aws-sdk/client-dynamodb-node' --include-dependencies` * cd clients/node/client-dynamodb-node * run `AWS_PROFILE= jest test/integ/index.spec.js` --- clients/node/client-dynamodb-node/test/integ/index.spec.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clients/node/client-dynamodb-node/test/integ/index.spec.ts b/clients/node/client-dynamodb-node/test/integ/index.spec.ts index 4bafcd4ec8ffa..49054932e9767 100644 --- a/clients/node/client-dynamodb-node/test/integ/index.spec.ts +++ b/clients/node/client-dynamodb-node/test/integ/index.spec.ts @@ -39,6 +39,8 @@ describe("DynamoDB integration tests", () => { console.log(response); }); + it("single test", () => {}); + afterAll(async () => { const response = await client.deleteTable({ TableName: tableName From 4a302b2b038661a36381c99a1db6775eff86a2b5 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Sun, 24 Nov 2019 15:49:03 -0800 Subject: [PATCH 04/14] chore: waitFor table to be created Test fails with: ResourceInUseException: Attempt to change a resource which is still in use: Table is being created: aws-js-integration-imtnejviovb at JsonRpcParser.Object..exports.jsonErrorUnmarshaller [as parseServiceException] (/Users/trivikr/workspace/aws-sdk-js-v3/packages/json-error-unmarshaller/src/index.ts:51:35) at JsonRpcParser. (/Users/trivikr/workspace/aws-sdk-js-v3/packages/protocol-json-rpc/src/JsonRpcParser.ts:33:18) at step (/Users/trivikr/workspace/aws-sdk-js-v3/node_modules/tslib/tslib.js:136:27) at Object.next (/Users/trivikr/workspace/aws-sdk-js-v3/node_modules/tslib/tslib.js:117:57) at fulfilled (/Users/trivikr/workspace/aws-sdk-js-v3/node_modules/tslib/tslib.js:107:62) at processTicksAndRejections (internal/process/task_queues.js:93:5) --- .../node/client-dynamodb-node/test/integ/index.spec.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/clients/node/client-dynamodb-node/test/integ/index.spec.ts b/clients/node/client-dynamodb-node/test/integ/index.spec.ts index 49054932e9767..3d2bcf16c6815 100644 --- a/clients/node/client-dynamodb-node/test/integ/index.spec.ts +++ b/clients/node/client-dynamodb-node/test/integ/index.spec.ts @@ -7,7 +7,8 @@ describe("DynamoDB integration tests", () => { .substring(2)}`; describe("Table CRUD operations", () => { - beforeAll(async () => { + beforeAll(async done => { + console.log("ENTER beforeAll"); const params = { TableName: tableName, AttributeDefinitions: [ @@ -37,15 +38,20 @@ describe("DynamoDB integration tests", () => { }; const response = await client.createTable(params); console.log(response); + console.log("EXIT beforeAll"); + done(); }); it("single test", () => {}); - afterAll(async () => { + afterAll(async done => { + console.log("ENTER afterAll"); const response = await client.deleteTable({ TableName: tableName }); console.log(response); + console.log("EXIT afterAll"); + done(); }); }); }); From 4b5d6abab767805c8013e0e5e2c2edc836111f0e Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Sun, 24 Nov 2019 17:08:18 -0800 Subject: [PATCH 05/14] feat: added waitFor for tableExists --- .../test/integ/index.spec.ts | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/clients/node/client-dynamodb-node/test/integ/index.spec.ts b/clients/node/client-dynamodb-node/test/integ/index.spec.ts index 3d2bcf16c6815..9abfbac58511a 100644 --- a/clients/node/client-dynamodb-node/test/integ/index.spec.ts +++ b/clients/node/client-dynamodb-node/test/integ/index.spec.ts @@ -1,11 +1,42 @@ import { DynamoDB } from "../../DynamoDB"; describe("DynamoDB integration tests", () => { + // Move this timeout to jest config for integ tests + jest.setTimeout(500000); + const client = new DynamoDB({}); const tableName = `aws-js-integration-${Math.random() .toString(36) .substring(2)}`; + // Replace with waiters once available + const tableExists = async (tableName: string) => { + const params = { TableName: tableName }; + const sleepFor = (ms: number) => + new Promise(resolve => setTimeout(resolve, ms)); + + // Iterate totalTries times + const totalTries = 25; + for (let i = 0; i < totalTries; i++) { + try { + const response = await client.describeTable(params); + if (response.Table && response.Table.TableStatus === "ACTIVE") { + return true; + } else { + if (i === totalTries - 1) { + throw `Table ${tableName} not in active status`; + } + await sleepFor(20000); + } + } catch (e) { + if (i === totalTries - 1) { + throw e; + } + await sleepFor(20000); + } + } + }; + describe("Table CRUD operations", () => { beforeAll(async done => { console.log("ENTER beforeAll"); @@ -38,6 +69,7 @@ describe("DynamoDB integration tests", () => { }; const response = await client.createTable(params); console.log(response); + await tableExists(tableName); console.log("EXIT beforeAll"); done(); }); From d8bf38a6e739d5852762d3c71fe85d8e3bd32446 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Sun, 24 Nov 2019 17:27:42 -0800 Subject: [PATCH 06/14] feat: added waitFor for tableNotExists --- .../test/integ/index.spec.ts | 39 ++++++++++++++----- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/clients/node/client-dynamodb-node/test/integ/index.spec.ts b/clients/node/client-dynamodb-node/test/integ/index.spec.ts index 9abfbac58511a..760cdd3e7cb4f 100644 --- a/clients/node/client-dynamodb-node/test/integ/index.spec.ts +++ b/clients/node/client-dynamodb-node/test/integ/index.spec.ts @@ -8,12 +8,12 @@ describe("DynamoDB integration tests", () => { const tableName = `aws-js-integration-${Math.random() .toString(36) .substring(2)}`; + const sleepFor = (ms: number) => + new Promise(resolve => setTimeout(resolve, ms)); // Replace with waiters once available const tableExists = async (tableName: string) => { const params = { TableName: tableName }; - const sleepFor = (ms: number) => - new Promise(resolve => setTimeout(resolve, ms)); // Iterate totalTries times const totalTries = 25; @@ -37,9 +37,32 @@ describe("DynamoDB integration tests", () => { } }; + // Replace with waiters once available + const tableNotExists = async (tableName: string) => { + const params = { TableName: tableName }; + + // Iterate totalTries times + const totalTries = 25; + for (let i = 0; i < totalTries; i++) { + try { + await client.describeTable(params); + if (i === totalTries - 1) { + throw `Table ${tableName} not deleted`; + } + await sleepFor(20000); + } catch (e) { + if (i === totalTries - 1) { + throw e; + } else if (e.name === "ResourceNotFoundException") { + return true; + } + await sleepFor(20000); + } + } + }; + describe("Table CRUD operations", () => { beforeAll(async done => { - console.log("ENTER beforeAll"); const params = { TableName: tableName, AttributeDefinitions: [ @@ -67,22 +90,18 @@ describe("DynamoDB integration tests", () => { WriteCapacityUnits: 5 } }; - const response = await client.createTable(params); - console.log(response); + await client.createTable(params); await tableExists(tableName); - console.log("EXIT beforeAll"); done(); }); it("single test", () => {}); afterAll(async done => { - console.log("ENTER afterAll"); - const response = await client.deleteTable({ + await client.deleteTable({ TableName: tableName }); - console.log(response); - console.log("EXIT afterAll"); + await tableNotExists(tableName); done(); }); }); From a5eaa21b6a4f97a9313fc4bb8cbe743e8afe5617 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Sun, 24 Nov 2019 17:47:18 -0800 Subject: [PATCH 07/14] temp: comment out table creation and deletion and use existing table --- .../test/integ/index.spec.ts | 85 ++++++++++--------- 1 file changed, 43 insertions(+), 42 deletions(-) diff --git a/clients/node/client-dynamodb-node/test/integ/index.spec.ts b/clients/node/client-dynamodb-node/test/integ/index.spec.ts index 760cdd3e7cb4f..558aba6a0df66 100644 --- a/clients/node/client-dynamodb-node/test/integ/index.spec.ts +++ b/clients/node/client-dynamodb-node/test/integ/index.spec.ts @@ -5,9 +5,10 @@ describe("DynamoDB integration tests", () => { jest.setTimeout(500000); const client = new DynamoDB({}); - const tableName = `aws-js-integration-${Math.random() - .toString(36) - .substring(2)}`; + // const tableName = `aws-js-integration-${Math.random() + // .toString(36) + // .substring(2)}`; + const tableName = "aws-js-integration"; const sleepFor = (ms: number) => new Promise(resolve => setTimeout(resolve, ms)); @@ -62,47 +63,47 @@ describe("DynamoDB integration tests", () => { }; describe("Table CRUD operations", () => { - beforeAll(async done => { - const params = { - TableName: tableName, - AttributeDefinitions: [ - { - AttributeName: "Artist", - AttributeType: "S" - }, - { - AttributeName: "SongTitle", - AttributeType: "S" - } - ], - KeySchema: [ - { - AttributeName: "Artist", - KeyType: "HASH" - }, - { - AttributeName: "SongTitle", - KeyType: "RANGE" - } - ], - ProvisionedThroughput: { - ReadCapacityUnits: 5, - WriteCapacityUnits: 5 - } - }; - await client.createTable(params); - await tableExists(tableName); - done(); - }); + // beforeAll(async done => { + // const params = { + // TableName: tableName, + // AttributeDefinitions: [ + // { + // AttributeName: "Artist", + // AttributeType: "S" + // }, + // { + // AttributeName: "SongTitle", + // AttributeType: "S" + // } + // ], + // KeySchema: [ + // { + // AttributeName: "Artist", + // KeyType: "HASH" + // }, + // { + // AttributeName: "SongTitle", + // KeyType: "RANGE" + // } + // ], + // ProvisionedThroughput: { + // ReadCapacityUnits: 5, + // WriteCapacityUnits: 5 + // } + // }; + // await client.createTable(params); + // await tableExists(tableName); + // done(); + // }); it("single test", () => {}); - afterAll(async done => { - await client.deleteTable({ - TableName: tableName - }); - await tableNotExists(tableName); - done(); - }); + // afterAll(async done => { + // await client.deleteTable({ + // TableName: tableName + // }); + // await tableNotExists(tableName); + // done(); + // }); }); }); From 717f3fc02d1bd3029dd7051e6e53faa38d86ffbf Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Sun, 24 Nov 2019 18:04:28 -0800 Subject: [PATCH 08/14] test: adds an item to the table --- .../test/integ/index.spec.ts | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/clients/node/client-dynamodb-node/test/integ/index.spec.ts b/clients/node/client-dynamodb-node/test/integ/index.spec.ts index 558aba6a0df66..8ee1054ef6694 100644 --- a/clients/node/client-dynamodb-node/test/integ/index.spec.ts +++ b/clients/node/client-dynamodb-node/test/integ/index.spec.ts @@ -63,6 +63,14 @@ describe("DynamoDB integration tests", () => { }; describe("Table CRUD operations", () => { + const itemKey = { + Artist: { + S: "Acme Band" + }, + SongTitle: { + S: "Happy Day" + } + }; // beforeAll(async done => { // const params = { // TableName: tableName, @@ -96,7 +104,27 @@ describe("DynamoDB integration tests", () => { // done(); // }); - it("single test", () => {}); + it("adds an item to the table", async () => { + expect.assertions(1); + + const albumTitle = "Somewhat Famous"; + const params = { + Item: { + ...itemKey, + AlbumTitle: { + S: albumTitle + } + }, + TableName: tableName + }; + + await client.putItem(params); + const item = await client.getItem({ + Key: itemKey, + TableName: tableName + }); + expect(item.Item && item.Item.AlbumTitle.S).toBe(albumTitle); + }); // afterAll(async done => { // await client.deleteTable({ From 78e8e211ba6fa05a64fbbba9209ec4af2a8723c4 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Sun, 24 Nov 2019 18:12:29 -0800 Subject: [PATCH 09/14] test: deletes an item from the table --- .../client-dynamodb-node/test/integ/index.spec.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/clients/node/client-dynamodb-node/test/integ/index.spec.ts b/clients/node/client-dynamodb-node/test/integ/index.spec.ts index 8ee1054ef6694..698733e665483 100644 --- a/clients/node/client-dynamodb-node/test/integ/index.spec.ts +++ b/clients/node/client-dynamodb-node/test/integ/index.spec.ts @@ -126,6 +126,20 @@ describe("DynamoDB integration tests", () => { expect(item.Item && item.Item.AlbumTitle.S).toBe(albumTitle); }); + it("deletes an item from the table", async () => { + expect.assertions(1); + + await client.deleteItem({ + Key: itemKey, + TableName: tableName + }); + const item = await client.getItem({ + Key: itemKey, + TableName: tableName + }); + expect(item.Item).toBeUndefined(); + }); + // afterAll(async done => { // await client.deleteTable({ // TableName: tableName From 9ab1eb224477c483ada0abd929a6d54d526dde82 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Sun, 24 Nov 2019 18:22:50 -0800 Subject: [PATCH 10/14] test: updates an item in the table --- .../test/integ/index.spec.ts | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/clients/node/client-dynamodb-node/test/integ/index.spec.ts b/clients/node/client-dynamodb-node/test/integ/index.spec.ts index 698733e665483..be120ecf39464 100644 --- a/clients/node/client-dynamodb-node/test/integ/index.spec.ts +++ b/clients/node/client-dynamodb-node/test/integ/index.spec.ts @@ -126,6 +126,40 @@ describe("DynamoDB integration tests", () => { expect(item.Item && item.Item.AlbumTitle.S).toBe(albumTitle); }); + it("updates an item in the table", async () => { + expect.assertions(1); + + const item = await client.getItem({ + Key: itemKey, + TableName: tableName + }); + + const newAlbumTitle = `New ${item.Item && item.Item.AlbumTitle.S}`; + var params = { + ExpressionAttributeNames: { + "#AT": "AlbumTitle" + }, + ExpressionAttributeValues: { + ":t": { + S: newAlbumTitle + } + }, + Key: itemKey, + ReturnValues: "ALL_NEW", + TableName: tableName, + UpdateExpression: "SET #AT = :t" + }; + await client.updateItem(params); + + const updatedItem = await client.getItem({ + Key: itemKey, + TableName: tableName + }); + expect(updatedItem.Item && updatedItem.Item.AlbumTitle.S).toBe( + newAlbumTitle + ); + }); + it("deletes an item from the table", async () => { expect.assertions(1); From 412647f9cf12ceb59ea577f29ea66aa931f79b13 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Sun, 24 Nov 2019 18:32:44 -0800 Subject: [PATCH 11/14] test: convert beforeAll and afterAll to test functions --- .../test/integ/index.spec.ts | 100 ++++++++++-------- 1 file changed, 57 insertions(+), 43 deletions(-) diff --git a/clients/node/client-dynamodb-node/test/integ/index.spec.ts b/clients/node/client-dynamodb-node/test/integ/index.spec.ts index be120ecf39464..b0f4be8c1c84b 100644 --- a/clients/node/client-dynamodb-node/test/integ/index.spec.ts +++ b/clients/node/client-dynamodb-node/test/integ/index.spec.ts @@ -5,10 +5,9 @@ describe("DynamoDB integration tests", () => { jest.setTimeout(500000); const client = new DynamoDB({}); - // const tableName = `aws-js-integration-${Math.random() - // .toString(36) - // .substring(2)}`; - const tableName = "aws-js-integration"; + const tableName = `aws-js-integration-${Math.random() + .toString(36) + .substring(2)}`; const sleepFor = (ms: number) => new Promise(resolve => setTimeout(resolve, ms)); @@ -71,38 +70,44 @@ describe("DynamoDB integration tests", () => { S: "Happy Day" } }; - // beforeAll(async done => { - // const params = { - // TableName: tableName, - // AttributeDefinitions: [ - // { - // AttributeName: "Artist", - // AttributeType: "S" - // }, - // { - // AttributeName: "SongTitle", - // AttributeType: "S" - // } - // ], - // KeySchema: [ - // { - // AttributeName: "Artist", - // KeyType: "HASH" - // }, - // { - // AttributeName: "SongTitle", - // KeyType: "RANGE" - // } - // ], - // ProvisionedThroughput: { - // ReadCapacityUnits: 5, - // WriteCapacityUnits: 5 - // } - // }; - // await client.createTable(params); - // await tableExists(tableName); - // done(); - // }); + + it("create table for testing CRUD operations", async () => { + expect.assertions(1); + const params = { + TableName: tableName, + AttributeDefinitions: [ + { + AttributeName: "Artist", + AttributeType: "S" + }, + { + AttributeName: "SongTitle", + AttributeType: "S" + } + ], + KeySchema: [ + { + AttributeName: "Artist", + KeyType: "HASH" + }, + { + AttributeName: "SongTitle", + KeyType: "RANGE" + } + ], + ProvisionedThroughput: { + ReadCapacityUnits: 5, + WriteCapacityUnits: 5 + } + }; + await client.createTable(params); + + // TODO: replace with waiters once introduced + await tableExists(tableName); + + const response = await client.describeTable(params); + expect(response.Table && response.Table.TableName).toBe(tableName); + }); it("adds an item to the table", async () => { expect.assertions(1); @@ -174,12 +179,21 @@ describe("DynamoDB integration tests", () => { expect(item.Item).toBeUndefined(); }); - // afterAll(async done => { - // await client.deleteTable({ - // TableName: tableName - // }); - // await tableNotExists(tableName); - // done(); - // }); + it("delete table after testing CRUD operations", async () => { + expect.assertions(1); + const params = { + TableName: tableName + }; + await client.deleteTable(params); + + // TODO: replace with waiters once introduced + await tableNotExists(tableName); + + try { + await client.describeTable(params); + } catch (e) { + expect(e.name).toBe("ResourceNotFoundException"); + } + }); }); }); From 29438c4d42afcc68cdba21f9eb983408eee8a8e1 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Sun, 24 Nov 2019 18:59:01 -0800 Subject: [PATCH 12/14] Revert "doc: bundle style difference between legacy and modular approaches" This reverts commit 9fdcd7274d5bb1cebff253d56991caf3ef8448ab. --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index c42d176895ac4..96b5469b2d173 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,6 @@ example(); ``` If you want to use non-modular (v2-like) interfaces, you can import client with only the service name (e.g DynamoDB), and call the operation name directly from the client: -======= -For users want to use legacy (v2-like) interfaces, you can import client with only the service name(e.g DynamoDB), and call the operation name directly from the client: ```javascript const { DynamoDB } = require("@aws-sdk/client-dynamodb-node"); @@ -59,8 +57,6 @@ async function example() { example(); ``` -If you use tree shaking to reduce bundle size, using non-modular interface will increase the bundle size as compared to using modular interface. -======= If you use tree shaking to reduce bundle size, using legacy interface will increase the bundle size as compared to using modular interface. In our workshop code, a lambda with DynamoDBClient and a command takes ~18kB while DynamoDB takes ~26 kB ([details](https://github.com/aws-samples/aws-sdk-js-v3-workshop/blob/dc3ad778b04dfe3f8f277dca67162da79c937eca/Exercise1/backend/README.md#reduce-bundle-size-by-just-importing-dynamodb)) From 9e7583dfb3bc203ee216534bd055321daa72268b Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Thu, 26 Dec 2019 10:21:35 -0800 Subject: [PATCH 13/14] chore: rename index.spec.ts to index.ispec.ts Steps to test: * cd to clients folder (example `cd clients/node/client-dynamodb-node`) * run `tsc` * run `AWS_PROFILE= jest --testMatch '**/*.ispec.js' test/integ/index.ispec.js` --- .../test/integ/{index.spec.ts => index.ispec.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename clients/node/client-dynamodb-node/test/integ/{index.spec.ts => index.ispec.ts} (100%) diff --git a/clients/node/client-dynamodb-node/test/integ/index.spec.ts b/clients/node/client-dynamodb-node/test/integ/index.ispec.ts similarity index 100% rename from clients/node/client-dynamodb-node/test/integ/index.spec.ts rename to clients/node/client-dynamodb-node/test/integ/index.ispec.ts From 46d5fb2e29cf1aa708eb62c7fd462bfa841b1a0b Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Thu, 26 Dec 2019 10:51:02 -0800 Subject: [PATCH 14/14] fix: README changes during merge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 96b5469b2d173..65bc70a7974d4 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ async function example() { example(); ``` -If you use tree shaking to reduce bundle size, using legacy interface will increase the bundle size as compared to using modular interface. +If you use tree shaking to reduce bundle size, using non-modular interface will increase the bundle size as compared to using modular interface. In our workshop code, a lambda with DynamoDBClient and a command takes ~18kB while DynamoDB takes ~26 kB ([details](https://github.com/aws-samples/aws-sdk-js-v3-workshop/blob/dc3ad778b04dfe3f8f277dca67162da79c937eca/Exercise1/backend/README.md#reduce-bundle-size-by-just-importing-dynamodb)) ## New features