Skip to content

Allow entity definitions to load synchronously, and add tests for it. - #1532

Merged
dpvc merged 2 commits into
developfrom
feature/sync-entities
Aug 8, 2026
Merged

Allow entity definitions to load synchronously, and add tests for it.#1532
dpvc merged 2 commits into
developfrom
feature/sync-entities

Conversation

@dpvc

@dpvc dpvc commented Jul 22, 2026

Copy link
Copy Markdown
Member

This PR adds the ability to synchronously load entity extensions from node applications that have asyncIsSyncronous set. This is similar to the synchronous loading of dynamic font data font. A number of new tests are added, and the current single function is broken into several pieces.

It also removes a deprecated use of RegExp.$1.

@dpvc
dpvc requested a review from zorkow July 22, 2026 18:00
@dpvc dpvc added this to the v4.2 milestone Jul 22, 2026
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.93%. Comparing base (9ef060f) to head (cd5f2eb).
⚠️ Report is 139 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1532      +/-   ##
===========================================
+ Coverage    86.70%   86.93%   +0.22%     
===========================================
  Files          340      390      +50     
  Lines        86264    87833    +1569     
  Branches      3246     4984    +1738     
===========================================
+ Hits         74798    76355    +1557     
+ Misses       11466    11459       -7     
- Partials         0       19      +19     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zorkow zorkow left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm.

But I am wondering if the jsdoc in mathjax.ts

  /**
   * When asyncLoad uses require(), it actually operates synchronously and this is true
   */
  asyncIsSynchronous: false,

should be updated. asyncLoad could be a function using readFileSync in Node.

@dpvc

dpvc commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

asyncLoad could be a function using readFileSync in Node.

Only if the user replaces asyncLoad; of our ts/utility/asyncLoad/*.ts files, the only one that sets asyncIsSynchronous to true is node.ts, which uses require(). None of our versions use readFileSync().

But I will modify the comment to be more generic.

@dpvc
dpvc merged commit 2175062 into develop Aug 8, 2026
1 check passed
@dpvc
dpvc deleted the feature/sync-entities branch August 8, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants