-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render MathJax in the backend (SSR) #33
Comments
Just to avoid people finding the wrong resource: https://docs.mathjax.org/en/latest/server/start.html links to official examples. A common problem is that some client-side features are lost when rendering server-side, e.g., the mathjax menu (and everything it enables) depends on client-side rendering and there's currently no hydration solution (besides re-rendering). You can do a lot of things server-side however (e.g., generate descriptions for accessibility) and it's sometimes easier to just build your own for these missing features (e.g., copy&paste for sources). |
Good points. And I know accessibility is a very important concern of the Mathjax creators so definitely worth to thread lightly here. |
I personally prefer SSR and have built (with help from the MathJax team) a lightweight helper that makes expressions explorable on the client (see the last examples on github pages). While it's naturally possible to do this on the client, too, I suspect most people would prefer the standard client-side MathJax experience. Given how MathJax works the full experience invariably needs re-rendering - which might still be done efficiently (e.g., via an instant.page or quicklink kind of approach). |
There has been discussion around this earlier and now it seems NextJS 13 is supporting serverside components. This makes it more interesting to look into using the MathJax library itself to generate MathJax n the serverside and then not downloading MathJax in the frontend at all.
The text was updated successfully, but these errors were encountered: