-
Notifications
You must be signed in to change notification settings - Fork 1.1k
chore: Clean up lingering usage of deprecated default exports. #4790
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
Conversation
import { Amplify } from 'aws-amplify' | ||
import * as AmplifyModules from 'aws-amplify' | ||
import { AmplifyPlugin } from 'aws-amplify-vue' | ||
import awsconfig from './aws-exports' | ||
Amplify.configure(awsconfig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit
import { Amplify } from 'aws-amplify' | |
import * as AmplifyModules from 'aws-amplify' | |
import { AmplifyPlugin } from 'aws-amplify-vue' | |
import awsconfig from './aws-exports' | |
Amplify.configure(awsconfig) | |
import * as AmplifyModules from 'aws-amplify' | |
import { AmplifyPlugin } from 'aws-amplify-vue' | |
import awsconfig from './aws-exports' | |
AmplifyModules.Amplify.configure(awsconfig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I went back and forth on this one, seemed cleaner to just have two imports (to have the standard Amplify.configure
call) but willing to change if you have strong opinions about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need both? what does the * as AmplifyModules accomplish here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So with default exports you're able to import the default and also star import the rest of the module, e.g. the original code: import Amplify, * as AmplifyModules from 'aws-amplify'
This really isn't possible with named exports, so something like this is not valid for example: import { Amplify }, * as AmplifyModules from 'aws-amplify'
. We can do what Chris suggested, but I personally thought having AmplifyModules.Amplify.configure(awsconfig)
felt weirder than just have two imports so we can use the standard Amplify.configure
form which is used everywhere else. Can change though if folks feel strongly about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a question
import { Amplify } from 'aws-amplify' | ||
import * as AmplifyModules from 'aws-amplify' | ||
import { AmplifyPlugin } from 'aws-amplify-vue' | ||
import awsconfig from './aws-exports' | ||
Amplify.configure(awsconfig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need both? what does the * as AmplifyModules accomplish here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Issue #, if available:
Description of changes:
This change cleans up lingering usage of deprecated default exports from the
amplify-js
repo, which will be fully removed for the upcoming v5 release.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.