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

Khan / perseus / 5380851655
69%

Build:
DEFAULT BRANCH: main
Ran 26 Jun 2023 04:55PM UTC
Jobs 2
Files 517
Run time 11s
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

pending completion
5380851655

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)

7537 of 16328 branches covered (46.16%)

Branch coverage included in aggregate %.

20098 of 44487 relevant lines covered (45.18%)

1003.79 hits per line

Subprojects
ID Flag name Job ID Ran Files Coverage
1 cypress 5380851655.1 26 Jun 2023 04:54PM UTC 0
26.38
GitHub Action Run
2 jest 5380851655.2 26 Jun 2023 05:01PM UTC 0
63.05
GitHub Action Run
Source Files on build 5380851655
Detailed source file information is not available for this build.
  • Back to Repo
  • 1f3fdc6c on github
  • Prev Build on main (#5360733165)
  • Next Build on main (#5380876217)
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