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(@aws-amplify/analytics): Analytics Typescript updates #9272

Merged
merged 9 commits into from
Feb 10, 2022

Conversation

jamesaucode
Copy link
Contributor

@jamesaucode jamesaucode commented Nov 23, 2021

Description of changes

  • Adding clearer Typescript types for the parameters of Analytics.record function
  • Removing implicit any wherever possible
  • Marking the old way of calling Analytics.record @deprecated

Issue #, if available

related #9162

Description of how you validated changes

yarn clean && yarn setup-dev
yarn test

Checklist

  • PR description included
  • yarn test passes

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov-commenter
Copy link

codecov-commenter commented Nov 23, 2021

Codecov Report

Merging #9272 (0a51ea3) into main (bc5235a) will not change coverage.
The diff coverage is 82.35%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #9272   +/-   ##
=======================================
  Coverage   78.29%   78.29%           
=======================================
  Files         250      250           
  Lines       18258    18258           
  Branches     3927     3927           
=======================================
  Hits        14296    14296           
  Misses       3832     3832           
  Partials      130      130           
Impacted Files Coverage Δ
packages/analytics/src/Analytics.ts 62.71% <82.35%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bc5235a...0a51ea3. Read the comment docs.

Comment on lines 243 to +247
public async record(
event: string | object,
provider?,
eventName: string,
attributes?: EventAttributes,
metrics?: EventMetrics
);
Copy link
Contributor

Choose a reason for hiding this comment

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

is this something we allow too?

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 believe this is the old way of using Analytics.record (at least from the implementation, this is supported)

Copy link
Contributor

@ashika01 ashika01 Dec 7, 2021

Choose a reason for hiding this comment

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

Gotcha. I dont see documentation on it. Do u think we can add this usage in docs with a deprecation notice?

Copy link
Contributor

@ashika01 ashika01 left a comment

Choose a reason for hiding this comment

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

LGTM. Just a tiny nit - you can add in and merge :)

packages/analytics/src/Analytics.ts Outdated Show resolved Hide resolved
@jamesaucode jamesaucode requested a review from hkjpotato January 6, 2022 19:44
Copy link
Contributor

@hkjpotato hkjpotato left a comment

Choose a reason for hiding this comment

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

LGTM and thank you for running through offline. Nice job 🎆

@jamesaucode jamesaucode merged commit 9a52c2b into aws-amplify:main Feb 10, 2022
jamesaucode added a commit to jamesaucode/amplify-js that referenced this pull request Feb 24, 2022
@github-actions
Copy link

This pull request 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 *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants