Open
Conversation
Migrated dynamodb-subscriber from AWS SDK for JavaScript v2 to v3. Changes: - Updated imports to use modular v3 packages - @aws-sdk/client-dynamodb - @aws-sdk/client-dynamodb-streams - @aws-sdk/util-dynamodb - Replaced DynamoDB.Converter.output() with unmarshall() - Updated client instantiation to use v3 classes - Maintained v2-compatible API calls for backward compatibility - Updated test mocking to use Sinon (v3-compatible) External API remains unchanged: - All exports preserved (DynamoDBSubscriber, Stream) - Constructor parameters unchanged - Method signatures unchanged (start, stop, on, emit) - Event signatures unchanged (record, error) Dependencies: - Removed: aws-sdk ^2.45.0, aws-sdk-mock ~1.4.0 - Added: @aws-sdk/client-dynamodb, @aws-sdk/client-dynamodb-streams, @aws-sdk/util-dynamodb, sinon Tests: All 3 tests passing JIRA: https://replicon.atlassian.net/browse/SF-2432
Generated with Node v18.20.2 and npm v10.5.0 after updating to AWS SDK v3 packages. SF-2432
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrated from AWS SDK v2 to v3 with full backward compatibility. All external APIs remain unchanged.
Changes
Production Code
@aws-sdk/client-dynamodb,@aws-sdk/client-dynamodb-streams,@aws-sdk/util-dynamodb)aws.DynamoDB.Converter.output()→unmarshall()Tests
aws-sdk-mock→SinonDependencies
Testing
✅ Real Integration Test (Verified with Production AWS)
Tested against actual DynamoDB table with streams enabled:
awanishkup-1683523044938-us-west-2-devops-rs-oauth-clientsca-central-1NEW_AND_OLD_IMAGESResults:
✅ Output Shape Verification
Compared V2 vs V3 output structure:
Backward Compatibility
External API is 100% unchanged:
DynamoDBSubscriber,.Stream)start(),stop())Example - Still works identically:
Benefits
JIRA
https://replicon.atlassian.net/browse/SF-2432