• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Khan / perseus / 5380851655 / 1 – cypress
69%
main: 69%

Build:
DEFAULT BRANCH: main
Ran 26 Jun 2023 05:02PM UTC
Files 360
Run time 5s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

26 Jun 2023 04:51PM UTC coverage: 26.381% (-0.006%) from 26.387%
cypress – 5380851655.1

push

github

web-flow
Introduce Perseus analytics API and a first consumer (input evaluated) (#583)

## Summary:

This PR introduces infrastructure for sending analytics events. Importantly, it _does not_ actually send the events, but uses an injected function provided by the host application. 

### `@khanacademy/perseus` 
For `@khanacademy/perseus` I've added an `analytics` key to `PerseusDependencies` so that it can be provided once.  I had several options and chose to add to `PerseusDependencies` as that's the simplest, least "churn". Two other options were: 

   1) ~Add it to `APIOptions`~. In talking with KevinB we agreed that `APIOptions` should be reserved for customizing how Perseus work rather than providing dependencies.
 
   2) ~Create a new dependency mechanism based on React Context.~ In a different conversation with @handeyeco we came to the conclusion that this required too many other changes to introduce a new concept into Perseus (ie. a way to drive dependencies through Perseus using React Context). Introducing this new approach would mean we either need to convert all the existing `PerseusDependencies` API to the new one _or_ introduce just the analytics to this new API and now have 2 (or 3 if you include `APIOptions`) ways of managing dependencies adding to tech debt that would remain to be completed. 

### `@khanacademy/math-input`

For `@khanacademy/math-input` I've opted to add the function to the `Keypad` (v2) props as we had no pattern in place for providing "package-wide" dependencies. We can follow this pattern in other components of this package if we need to dispatch analytics. 

### Shared package - `@khanacademy/perseus-core`

As part of this PR, I've also introduced a new package (`@khanacademy/perseus-core`) to host the `SendEvent` function type and the event types that we can dispatch. The event types are based on our CEDAR schema. I've chosen to do this for a few reasons:
  1. It reduces the amount of mapping a host appli... (continued)

1922 of 9583 branches covered (20.06%)

Branch coverage included in aggregate %.

5508 of 18581 relevant lines covered (29.64%)

937.57 hits per line

Source Files on job cypress - 5380851655.1
  • Tree
  • List 0
  • Changed 19
  • Source Changed 0
  • Coverage Changed 19
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 5380851655
  • 1f3fdc6c on github
  • Prev Job for on main (#5360733165.1)
  • Next Job for on main (#5380876217.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc