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

Unify page.on event mappings #1473

Merged
merged 8 commits into from
Oct 10, 2024
Merged

Unify page.on event mappings #1473

merged 8 commits into from
Oct 10, 2024

Conversation

inancgumus
Copy link
Member

@inancgumus inancgumus commented Oct 9, 2024

What?

  1. Conforms the page.on event mappings to the existing mappers.
  2. Adds a test for the metric mapping.

Why?

This will be needed when generalizing the page.on API events. To be generalized, all mappers need to be in the same signature. This is a part of the suggestions.

Checklist

  • I have performed a self-review of my code
  • I have added tests for my changes
  • I have commented on my code, particularly in hard-to-understand areas

Related PR(s)/Issue(s)

Updates: #1227

Mapped methods are lowercase so that we can test them. They're also used
in JavaScript like so.
So that we can use it the mapping test.
JavaScript functions are conventionally lowercase, and since we changed
Tag to tag from the Go side, we should also rename this script.
So that we can get rid of the non-conforming metric mapper. This way, we
don't have to deal with error handling in other mappers in the test.
This provides a uniform way.

Also, this is a prior step for the generalization of the page on API.
@inancgumus inancgumus self-assigned this Oct 9, 2024
@inancgumus inancgumus changed the title Unify page.on metric event mapping Unify page.on('metric') event mapping Oct 9, 2024
@inancgumus inancgumus changed the title Unify page.on('metric') event mapping Unify page.on event mappings Oct 9, 2024
@inancgumus inancgumus requested a review from ankur22 October 9, 2024 18:38
Copy link
Collaborator

@ankur22 ankur22 left a comment

Choose a reason for hiding this comment

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

Thanks for this! 🚀

browser/metric_event_mapping.go Show resolved Hide resolved
browser/mapping_test.go Show resolved Hide resolved
common/page.go Outdated Show resolved Hide resolved
common/page.go Outdated Show resolved Hide resolved
browser/mapping_test.go Outdated Show resolved Hide resolved
browser/mapping_test.go Outdated Show resolved Hide resolved
examples/pageon-metric.js Show resolved Hide resolved
browser/page_mapping.go Show resolved Hide resolved
@inancgumus inancgumus merged commit ebb1391 into main Oct 10, 2024
8 of 22 checks passed
@inancgumus inancgumus deleted the fix/metric-event-mapping branch October 10, 2024 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants