This issue is a Request For Comments (RFC). It is intended to elicit community feedback regarding a proposed change to the Amplify JS UI components. Please feel free to post comments or questions here.
The Phase 1 of Amplify UI components refactor was completed around March 2020 where we refactored existing codebase into newer web components that would bring parity for all Auth UI components across different frameworks. You can read more about the project in the RFC here. As mentioned in the previous RFC, we are starting Phase 2 of UI component refactor.
The first milestone of Phase 2 is to refactor Amplify Storage UI components. This RFC is intended to collect feedback on the proposed changes to these components.
Amplify Storage UI components provides a convenient way of using AWS S3 for managing different types of data in an UI application. The existing storage UI components are S3Image, S3Text, S3Album.
The problems for the need of the refactor still remains the same as initial RFC.
Additionally, specific to storage category, since each of the storage components is tightly coupled with a pickerprop causing ambiguity to use them. Depending on the picker prop's value, the other properties of these component behave differently. For instance, in the S3Image component, if the picker is not set, imgKey or path prop is used as the S3 file path to get the image from the bucket. But if the picker prop is set, then the path prop is used as the S3 file path prefix along with sanitized filename of the local file to upload and get the image.
imgKey or path prop is used as the S3 file path to get the image.body prop along with imgKey or path is used as the S3 file path to upload and get the image.path prop is used as the S3 file path prefix along with sanitized filename of the picked local file.We plan to address these issues by simplifying existing component and adding new components.
For this milestone, we are planning to modify the 3 storage component - S3Image, S3Text by splitting each of them into two components - A core component and its picker counterpart. S3Album will be modified to support only image file type.
S3Image will be split into amplify-s3-image and amplify-s3-image-picker. amplify-s3-image component will deal with uploading an image into s3 bucket and rendering an image. amplify-s3-image-picker will provide a customizable image file picker component and uploads the image to S3.
S3Text will be split into amplify-s3-text and amplify-s3-text-picker. amplify-s3-text component will deal with uploading of a text file into s3 bucket and rendering the text in a pre tag. amplify-s3-text-picker will use amplify-s3-text along with a text file picker component.
S3Album component, given a path prop, will render all images from the specified S3 file path in an image grid. With the picker enabled, it will restrict uploading content type to image and render it into the image grid.
Additional improvements would be
In this milestone we will add new components for primitive S3 functionalities such as upload, download and preview any S3 supported file type.
Basic design - (Rough Draft):

This remains the same as the UI refactor RFC.
The feedback that you all give is extremely helpful and gives us a better understanding of what people want us to build. If anyone would like to contribute ideas to what components you鈥檇 like to see added in the future please post it in this RFC.!
Hello everyone,
We have launched Phase 1 of Storage components 馃殌馃殌 As mentioned in the RFC, we have introduced the following components that has the functional parity with existing ones as part of Phase 1.
amplify-s3-imageamplify-s3-image-pickeramplify-s3-textamplify-s3-text-pickeramplify-s3-albumThese new components should enable better customizability and flexibility on usage
The storage components should be available now in the latest version
| Framework | Package | Version |
| ------------------ | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| React | @aws-amplify/ui-react | |
| Angular | @aws-amplify/ui-angular | |
| Vue | @aws-amplify/ui-vue | |
| Web Components | @aws-amplify/ui-components | |
_Docs for the usage of the components in your app_ - https://docs.amplify.aws/ui/storage/s3-image/q/framework/react
_Migration Docs_ - https://docs.amplify.aws/ui/storage/s3-image/q/framework/react#migration
The feedback that you all give is extremely helpful and gives us a better understanding of what people want us to build. Go ahead and try out the new component libraries and let us know what you think. Feel free to open up FR for improvements and any issues you find, we are actively looking to improve the UI components.
There should be a way to not pull the @aws-amplify/storage dependency into bundle if I'm not using S3 components. Every S3 component has unnecessary dependency on storage (630KB) when only album actually uses it. Also loader.mjs is not configurable to simply ignore those components and registers all even if I'm using just a few.
Closing this issue. We will open up separate RFCs for any new components as we plan.
Most helpful comment
Hello everyone,
We have launched Phase 1 of Storage components 馃殌馃殌 As mentioned in the RFC, we have introduced the following components that has the functional parity with existing ones as part of Phase 1.
amplify-s3-imageamplify-s3-image-pickeramplify-s3-textamplify-s3-text-pickeramplify-s3-albumThese new components should enable better customizability and flexibility on usage
The storage components should be available now in the
latestversion| Framework | Package | Version |
|
|
|
|
| ------------------ | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| React |
@aws-amplify/ui-react|| Angular |
@aws-amplify/ui-angular|| Vue |
@aws-amplify/ui-vue|| Web Components |
@aws-amplify/ui-components|Docs:
_Docs for the usage of the components in your app_ - https://docs.amplify.aws/ui/storage/s3-image/q/framework/react
_Migration Docs_ - https://docs.amplify.aws/ui/storage/s3-image/q/framework/react#migration
Thank you
The feedback that you all give is extremely helpful and gives us a better understanding of what people want us to build. Go ahead and try out the new component libraries and let us know what you think. Feel free to open up FR for improvements and any issues you find, we are actively looking to improve the UI components.