Skip to content
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

Upgrade to MathJax 3.x #725

Open
ggrossetie opened this issue Jun 17, 2023 · 3 comments
Open

Upgrade to MathJax 3.x #725

ggrossetie opened this issue Jun 17, 2023 · 3 comments
Labels
💬 discussion Disccussion on new features, projects, etc... ✨ enhancement

Comments

@ggrossetie
Copy link
Member

I think we should upgrade MathJax to 3.x

@ggrossetie ggrossetie added ✨ enhancement 💬 discussion Disccussion on new features, projects, etc... labels Jun 17, 2023
@yne
Copy link

yne commented May 5, 2024

Hi @ggrossetie , Can we take this opportunity to improve the VSIX bundling ?
The current VSIX is 30.8MiB mainly because of MathJax (and goes down to 7.5MiB without it)
Since we can't include all the plugins in the world (example: mermaid) why not make them modular ?

We also include a lot of unused content : dist/browser, dist/src/test, *.map, node_modules/@asciidoc/core/dist/{browser,graal}, fontawesome (otf, ttf, woff,woff2, svg) which, once removed gives us ad 4.9MiB VSIX

The reason behind this request is that my colleagues use asciidoc on remote machines.
Those machines traverse many NAT/proxies/corporate firewalls, and they extranet download are painfully slow (but not blocked unlike microsoft/vscode#195911).
This makes the update (and even the installation) of a 30MiB VSIX almost impossible to justify to my asciidoc creators.

4.9MiB VSIX: asciidoctor.asciidoctor-vscode-3.2.3.zip (rename .zip as .vsix)

@ggrossetie
Copy link
Member Author

We also include a lot of unused content : dist/browser, dist/src/test, *.map, node_modules/@asciidoc/core/dist/{browser,graal}, fontawesome (otf, ttf, woff,woff2, svg) which, once removed gives us ad 4.9MiB VSIX

Feel free to submit a pull request to improve the bundling. I did some work in the past with esbuild: #506

The current VSIX is 30.8MiB mainly because of MathJax (and goes down to 7.5MiB without it)
Since we can't include all the plugins in the world (example: mermaid) why not make them modular ?

By default, Asciidoctor does not use all the features available in MathJax so we could create a trimmed down version of MathJax. That's what I did in the browser extension for similar reasons: https://github.com/asciidoctor/asciidoctor-browser-extension/tree/main/app/vendor/MathJax-3.0.1

If we don't include it, it means that we need to rely on a CDN (and, as a result, it won't work offline)/ Currently, we don't have an adapter facility to integrate MathJax as a plugin, see: asciidoctor/asciidoctor#4522

@yne
Copy link

yne commented May 5, 2024

I thought mathjax really was 23MB, in which case, saving 3MB in better bundling would not make a big difference.
I'll try to see what can be stripped from mathjax and send a PR 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💬 discussion Disccussion on new features, projects, etc... ✨ enhancement
Projects
None yet
Development

No branches or pull requests

2 participants