-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Graphql library included even if you don't want to use graphql #701
Comments
Hi @shark404 this is a very valid request. Modularized Amplify is in our plan. We are exploring approaches right now, not just graphql but also all categories. |
Modularizing Amplify sounds like an wonderful idea. I have a project built with Create React App(not ejected yet) and using aws-amplify in it. The unnecessary dependencies actually added 352 kb to my code. I am using version 0.2.14 . I tried the latest version 0.3.3 but it actually increased the bundle size more. My problem goes up a notch as my project already import/use AWS SDK for S3, SES and SNS support. So I kind of have 2 copies of AWS-SDK being added to my app build. Can anyone suggest a quick workaround until the Moduler version get released? Note: I use amplify for Auth purpose only. |
Hi @ishtiaque23 As a quick workaround you can try depending on the same aws-sdk version that the aws-amplify version is using, that would be aws-sdk@2.198.0 https://github.com/aws/aws-amplify/blob/aws-amplify%400.2.14/packages/aws-amplify/package.json#L61 |
Hi, is there an update on this? |
Modular imports for Amplify has been implemented as part of v1.0. See docs here: Going to close this issue as the release of modular Amplify seems to solve the issue here. Please reopen if there are any more related questions or concerns. |
Modular imports doesn't resolve this isue. |
See
#488 (comment)
…On Tue, Apr 9, 2019 at 4:46 PM Paweł ***@***.***> wrote:
Module imports doesn't resolve this. graphl is a direct dependency on
@aws-amplify/api
https://github.com/aws-amplify/amplify-js/blob/master/packages/api/package.json#L58
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#701 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACXo7t9TrAuV9UsNZIrT4dhJh8WggeLSks5vfLW-gaJpZM4TcrAX>
.
|
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
Do you want to request a feature or report a bug?
I guess you could say it's an optimisation feature request.
What is the current behavior?
Since v0.3.0 with the introduction of graphql in the API module the graphql library is forced upon users of the Amplify library even if you're not using the graphql functionality. This is a ~140kb library so the affect on a webapp bundle size is actually quite large.
What is the expected behavior?
Ideally the imports of graphql should be done in a way that webpack can remove them during treeshaking. I'm not sure the best approach here but happy to help on the implementation side of things if someone has some ideas on how to approach it.
The text was updated successfully, but these errors were encountered: