Skip to content

Commit

Permalink
[🔥AUDIT🔥] Add TODO comment (#1358)
Browse files Browse the repository at this point in the history
🖍 _This is an audit!_ 🖍

The `skipMathJax` parameter to `Perseus.init()` controls whether MathJax 2 gets configured
during the `init` call. This is gross because Perseus doesn't even import MathJax 2: it
depends on a global `MathJax` variable existing whenever `skipMathJax` is not passed.

`skipMathJax` is almost always being passed in webapp, except in a couple cases in the 
exercise editor where we need to use the legacy KaTeX+MathJax2 math renderer. The
story referenced in the TODO comment is about removing that legacy renderer from webapp
once all mobile app versions that use it have been deprecated. Once MathJax 2 is gone for
good, we should be able to remove `skipMathJax` and the code it controls from Perseus.

Issue: none

## Test plan:

All CI checks should pass.

Author: benchristel

Auditors: Myranae, SonicScrewdriver

Required Reviewers:

Approved By: Myranae

Checks: ✅ codecov/project, ✅ codecov/patch, ✅ Upload Coverage (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Jest Coverage (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), ✅ gerald

Pull Request URL: #1358
  • Loading branch information
benchristel committed Jun 27, 2024
1 parent 3ee100a commit 93eeda1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/lazy-readers-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/perseus": patch
---

Add TODO comment
2 changes: 2 additions & 0 deletions packages/perseus/src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import * as Widgets from "./widgets";
declare const MathJax: any;

export type PerseusOptions = {
// TODO(LEMS-1608): remove skipMathJax once we have completely removed the
// legacy MathJax 2 renderer from webapp.
skipMathJax: boolean;
};

Expand Down

0 comments on commit 93eeda1

Please sign in to comment.