Use retryAfter() and handleRetriesFor() from mathjax so they are easier to override - #1547
Open
dpvc wants to merge 1 commit into
Open
Use retryAfter() and handleRetriesFor() from mathjax so they are easier to override#1547dpvc wants to merge 1 commit into
mathjax so they are easier to override#1547dpvc wants to merge 1 commit into
Conversation
…sier to override
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1547 +/- ##
===========================================
- Coverage 86.92% 86.92% -0.01%
===========================================
Files 390 390
Lines 87853 87852 -1
Branches 4984 4984
===========================================
- Hits 76370 76369 -1
Misses 11464 11464
Partials 19 19 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
zorkow
requested changes
Aug 12, 2026
zorkow
left a comment
Member
There was a problem hiding this comment.
I have two concerns about the new async loading. Please have a look.
| dynamic.promise = Promise.resolve(); | ||
| try { | ||
| mathjax.asyncLoad(this.dynamicFileName(dynamic)); | ||
| asyncLoad(this.dynamicFileName(dynamic)); |
Member
There was a problem hiding this comment.
This now returns a promise regardless of if it fails or not. So the try...catch does not really have an effect on this. But that means that dynamic.failed is never set. That would mean the file is set to loaded
even if the promise failed.
| if (!loaded[file]) { | ||
| loaded[file] = true; | ||
| const promise = mathjax.asyncLoad(`./util/entities/${file}.js`); | ||
| const promise = asyncLoad(`./util/entities/${file}.js`); |
Member
There was a problem hiding this comment.
Similarly, should the promise failure here not be handled explicitly?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR moves the references to
retryAfter()andhandleRetriesFor()to the version in themathjaxvariable rather than from theRetries.tsmodule directly. This makes it easier to override them. I have an example of making MathJax load tex extensions synchronously that would be helped by this, as that means there would be fewer methods that need to be overridden. Together with the synchronous loading of dynamic font data and of entity definitions, this would allow MathJax to be run synchronously in node applications, where synchronous file loading can be achieved.Note that
asyncLoadusesmathjax.asyncLoadinternally, so we don't have to usemathjaxfor that.