Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(storage): export Default Part Size constant #13851

2 changes: 2 additions & 0 deletions packages/aws-amplify/__tests__/exports.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ describe('aws-amplify Exports', () => {
'getUrl',
'isCancelError',
'StorageError',
'DEFAULT_PART_SIZE',
].sort(),
);
});
Expand All @@ -252,6 +253,7 @@ describe('aws-amplify Exports', () => {
'getProperties',
'copy',
'getUrl',
'DEFAULT_PART_SIZE',
].sort(),
);
});
Expand Down
2 changes: 2 additions & 0 deletions packages/storage/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ export { TransferProgressEvent } from './types';

export { isCancelError } from './errors/CanceledError';
export { StorageError } from './errors/StorageError';

export { DEFAULT_PART_SIZE } from './providers/s3/utils/constants';
2 changes: 2 additions & 0 deletions packages/storage/src/providers/s3/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ export {
GetUrlOutput,
GetUrlWithPathOutput,
} from './types/outputs';

export { DEFAULT_PART_SIZE } from './utils/constants';
3 changes: 3 additions & 0 deletions packages/storage/src/providers/s3/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ const MiB = 1024 * 1024;
const GiB = 1024 * MiB;
const TiB = 1024 * GiB;

/**
* Default part size in MB that is used to determine if an upload task is single part or multi part.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we also make it more explicit: "talk to UI before changing the value."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the doc strings? This is for the public and not just internal.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we can add a line with // on top of the doc string

*/
export const DEFAULT_PART_SIZE = 5 * MiB;
export const MAX_OBJECT_SIZE = 5 * TiB;
export const MAX_PARTS_COUNT = 10000;
Expand Down
Loading