Anki/ts
Damien Elmes ae18ba2a05 Switch editor to full MathJax package to fix broken autoloads
Re: https://forums.ankiweb.net/t/anki-2-1-53-release-candidate/20122/2

Autoloads in MathJax are asynchronous, and the caller is expected to
use asynchronous APIs when they are in use [1]. The editor uses the synchronous
tex2svg(), which throws a "MathJax retry" error when an autoload package
has not yet loaded. Attempting to use the package before it has loaded
appears to break future invocations as well, so the package fails to work
at all until a new webview is created.

The following HTML will reproduce the issue when added to a single card
in a new profile:

```
<strong>6&nbsp; &nbsp;&nbsp;</strong>Every combination of <anki-mathjax>\boldsymbol{v}=(1,-2,1)</anki-mathjax> and <anki-mathjax>\boldsymbol{w}=(0,1,-1)</anki-mathjax> has components that add to&nbsp; _____.<br>
```

Ideally we'd switch the MathJax rendering to be asynchronous, but that
didn't work well when I tried it in #1862. For now I've just switched
to the full package, which adds about 130KB to the final minified JS
(2.76MB), and likely slows down editor loading somewhat.

[1] https://github.com/mathjax/MathJax/issues/2557#issuecomment-727655089
2022-05-21 14:01:38 +10:00
..
card-info Add back support for custom mountpoint in card stats 2022-04-15 15:30:05 +10:00
change-notetype Consider using --force-message for ts/protobuf.bzl (#1694) 2022-02-27 17:35:07 +10:00
components Fix when tooltip changes before tooltipObject is created (#1845) 2022-05-10 11:36:54 +10:00
congrats add back support for custom mount point in congrats screen 2022-02-17 16:28:48 +10:00
deck-options fix typo. Shortcut uses on:action not on:click (#1846) 2022-05-09 19:55:35 +10:00
domlib Move all buttons to our custom inline surrounding (#1682) 2022-02-22 22:17:22 +10:00
editable Switch editor to full MathJax package to fix broken autoloads 2022-05-21 14:01:38 +10:00
editor Allow style tags in HTML editor (#1870) 2022-05-17 16:37:20 +10:00
fields Add a flag to allow loading the fields dialog in a web view (#1706) 2022-03-03 22:45:26 +10:00
graphs Fix graphs tooltip incorrect position (#1872) 2022-05-19 11:08:57 +10:00
html-filter Allow alt tags when pasting images 2022-05-16 14:32:24 +10:00
icons Add extra button group for cloze commands (#1756) 2022-03-31 13:30:00 +10:00
lib Change how resizable images work (#1859) 2022-05-13 12:57:07 +10:00
mathjax Use same config for editor and reviewer Mathjax (#1865) 2022-05-13 13:23:35 +10:00
patches Add support for proto3 optional scalars 2022-02-27 19:42:06 +10:00
reviewer Align list items to start (#1816) 2022-04-22 14:18:11 +10:00
sql_format run buildifier/buildozer to tidy up BUILD files 2021-12-14 09:18:24 +10:00
svelte Improved add-on extension API (#1626) 2022-02-03 14:52:11 +10:00
sveltelib Remove onInput call in input handler (#1819) 2022-04-25 13:56:05 +10:00
.eslintrc.js Use eslint for sorting our imports (#1637) 2022-02-04 18:36:34 +10:00
.gitignore Update eslint to 4.22.0 2021-04-22 19:19:39 +02:00
BUILD.bazel Add extra button group for cloze commands (#1756) 2022-03-31 13:30:00 +10:00
compile_sass.bzl Remove individual .html files + other refactorings (#1588) 2022-01-16 15:05:35 +10:00
copy.bzl include sourcemaps for pages/* in dev builds 2021-04-20 17:33:46 +10:00
esbuild.bzl Fix invisible tag input in Qt5 (thanks to Hikaru) 2022-04-05 09:53:36 +10:00
eslint.bzl Use eslint for sorting our imports (#1637) 2022-02-04 18:36:34 +10:00
format.sh prettier: don't depend on system node being available 2021-11-25 07:14:15 +10:00
generate_page.bzl Remove individual .html files + other refactorings (#1588) 2022-01-16 15:05:35 +10:00
jest.bzl Update to Jest 28 alpha 2022-02-25 16:20:50 +10:00
jest.config.js update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
licenses.json Update Svelte to 3.48.0 (#1867) 2022-05-16 14:47:38 +10:00
page.html Load page script after body created (#1802) 2022-04-19 17:16:56 +10:00
prettier.bzl prettier: don't depend on system node being available 2021-11-25 07:14:15 +10:00
proto.bzl update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
protobuf-no-long.js add a hack to avoid Long.js in Jest tests 2021-04-17 17:05:48 +10:00
protobuf.bzl Consider using --force-message for ts/protobuf.bzl (#1694) 2022-02-27 17:35:07 +10:00
README.md add add.sh helper for adding dependency and updating licenses 2020-12-31 12:20:51 +10:00
tsconfig.json Use same config for editor and reviewer Mathjax (#1865) 2022-05-13 13:23:35 +10:00
typescript.bzl Refactor i18n (#1405) 2021-10-07 23:31:49 +10:00
update-licenses.sh fix update-licenses.sh 2021-12-03 20:35:53 +10:00
update.sh add add.sh helper for adding dependency and updating licenses 2020-12-31 12:20:51 +10:00
vendor.bzl copy_bootstrap_css/icons were unused 2022-01-15 20:35:11 +10:00
yarn.sh Replace individual d3 libraries with encompassing d3 2021-01-30 00:00:22 +01:00

Anki's TypeScript and Sass dependencies. Some TS/JS code is also stored separately in ../qt/aqt/data/web/.

To update all dependencies:

./update.sh

To add a new dev dependency, use something like:

./add.sh -D @rollup/plugin-alias