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

fix(angular): Support strict: true #890

Merged
merged 11 commits into from Dec 1, 2021
Merged

fix(angular): Support strict: true #890

merged 11 commits into from Dec 1, 2021

Conversation

wlee221
Copy link
Contributor

@wlee221 wlee221 commented Nov 26, 2021

Issue #, if available: Fixes #889

Description of changes: This sets strict to true on examples/angular, as it is defaults to true on Angular 12+. Also refreshes yarn.lock to get aws-amplify/amplify-js#8984 patch.

Resolves the following errors:

  • 'aws-exports.js' implicitly has an 'any' type
  • Element implicitly has an 'any' type because index expression is not of type 'number'.
  • Property 'socialProviders' does not exist on type '{ loginMechanisms?: ("username" | "email" | "phone_number")[] | undefined; signUpAttributes?: SignUpAttribute[] | undefined; socialProviders?: SocialProvider[] | undefined; } | undefined'.
  • Could not find a declaration file for module 'graphql/error/GraphQLError'

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@changeset-bot
Copy link

changeset-bot bot commented Nov 26, 2021

🦋 Changeset detected

Latest commit: 8964373

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@aws-amplify/ui Patch
@aws-amplify/ui-angular Patch
@aws-amplify/ui-react Patch
@aws-amplify/ui-vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@wlee221 wlee221 marked this pull request as ready for review December 1, 2021 01:25
@wlee221 wlee221 added the Angular An issue or a feature-request for Angular platform label Dec 1, 2021
@wlee221 wlee221 temporarily deployed to ci December 1, 2021 05:49 Inactive
@wlee221 wlee221 temporarily deployed to ci December 1, 2021 05:49 Inactive
@wlee221 wlee221 temporarily deployed to ci December 1, 2021 05:49 Inactive
@wlee221 wlee221 temporarily deployed to ci December 1, 2021 06:06 Inactive
Comment on lines +31 to +32
loginMechanisms: Required<AuthContext>['config']['loginMechanisms'];
socialProviders: Required<AuthContext>['config']['socialProviders'];
Copy link
Contributor

Choose a reason for hiding this comment

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

Is adding Required going to cause any of the frameworks to complain if these props aren't passed into the authenticator?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so, because the parent machine have default values for loginMechanisms and socialProviders even if these props weren't passed by the end user:

loginMechanisms: loginMechanisms ?? cliLoginMechanisms,
signUpAttributes:
signUpAttributes ??
Array.from(
new Set([
...cliVerificationMechanisms,
...cliSignUpAttributes,
])
),

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@ErikCH ErikCH left a comment

Choose a reason for hiding this comment

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

👍

@wlee221 wlee221 merged commit 712edfc into main Dec 1, 2021
@wlee221 wlee221 deleted the angular/strict branch December 1, 2021 19:56
@github-actions github-actions bot mentioned this pull request Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Angular An issue or a feature-request for Angular platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@aws-amplify/ui-angular@v2 doesn't support strict mode
2 participants