Skip to content

Conversation

@dpvc
Copy link
Member

@dpvc dpvc commented Jun 21, 2025

This PR resoves a problem with how the worker.path option is computed. It needs to be a full path when used in node applications, and the ts/components/mjs/sre-root.ts file uses import.meta.url to determine it. But webpack converts that to the full unix path of where it was compiled, and so that path was being included in the component files like tex-chtml.js which is not desired. (It would get replaced when used in a web setting, but not in a node setting.)

The ts/components/mjs/root.ts file works similarly, but is replaced during webpacking by components/root-pack.js, and that needs to be done for sre-root.js as well. So I've added the needed sre-pack.js file and a webpack rule to do the replacement.

In addition, there was still a problem with producing a full path to the webworker file when the mathjax root is set to a node packlage like @mathjax/src/bundle, which is the most convenient thing to do in node applications that use MathJax components. This works OK when loading the components from source, but not when loading the bundled versions. So I've modified components/mjs/a11y/speech/speech.js to work harder to resolve the path for the worker. This now works in all the use-cases that I have tried (loading of bundled combined components, loading of combinded components from source, loading of individual bundled components, loading of individual compoments from source, direct loading of modules). So I think this takes care of all the worker path problems.

Now that the speech is in the worker, not MathJax proper, the components/mjs/a11y/sre/sre_config.js file, which had been setting up the path for the JSON files, is no longer needed, so I've removed that.

Finally, I changed the version number to 4.0.0-rc.2.

@dpvc dpvc requested a review from zorkow June 21, 2025 15:57
@dpvc dpvc added this to the v4.0 milestone Jun 21, 2025
@codecov
Copy link

codecov bot commented Jun 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.69%. Comparing base (ef47836) to head (f7d8f6f).
Report is 6 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1284   +/-   ##
========================================
  Coverage    86.69%   86.69%           
========================================
  Files          337      337           
  Lines        84107    84107           
  Branches      4753     4752    -1     
========================================
  Hits         72919    72919           
  Misses       11165    11165           
  Partials        23       23           

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Member

@zorkow zorkow left a comment

Choose a reason for hiding this comment

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

lgtm.

@dpvc dpvc merged commit 62226e2 into develop Jun 21, 2025
3 checks passed
@dpvc dpvc deleted the fix/sre-root branch June 21, 2025 18:35
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.

3 participants