Anki-Android icon indicating copy to clipboard operation
Anki-Android copied to clipboard

Get MathJax and jquery directly from the backend instead of copying it with a GitHub workflow

Open BrayanDSO opened this issue 1 year ago • 2 comments

In the pre backend era, Mani built a GH workflow to get jQuery and Mathjax libraries from Anki's repository

Since we now can ship anything from there with the new backend, that seems like an easier approach and more future proof.

It's a very low priority issue since both MathJax and jQuery rarely updates and this is mostly a non functional change

BrayanDSO avatar Jan 02 '24 20:01 BrayanDSO

Hello 👋, this issue has been opened for more than 3 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

github-actions[bot] avatar Apr 01 '24 21:04 github-actions[bot]

Hello 👋, this issue has been opened for more than 3 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

github-actions[bot] avatar Jun 30 '24 22:06 github-actions[bot]

Hello 👋, this issue has been opened for more than 3 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

github-actions[bot] avatar Sep 30 '24 14:09 github-actions[bot]

Indeed I'm not sure that workflow will even work anymore and I fear those libs are pretty out of date Script under the workflow is still using the old bazelisk build system from anki https://github.com/ankidroid/Anki-Android/blob/main/tools/update-js-libs.sh

Since we now can ship anything from there with the new backend

@BrayanDSO what's the rough process to "ship" something ("expose", perhaps the correct verb?) from the backend to the front-end ?

Looks like it might be in the anki build web artifacts area, with a copy --> https://github.com/BrayanDSO/Anki-Android-Backend/blob/ea684c64e7e00b271af718376e983ce7d88814f3/build_rust/src/main.rs#L52

...then on the Anki-Android side, reference jquery and mathjax bundles from the copied location?

Then a cleanup here to remove the old workflow and tools script

mikehardy avatar Sep 30 '24 14:09 mikehardy

Yes, basically all of that. Check the directory that Anki stores those files, copy them with main.rs, then reference them in AnkiDroid.

If the file doesn't get embedded in the aar file, check if its name or the name of its parent directory is allowed as an Android asset (e.g. directories starting with _ aren't embedded)

BrayanDSO avatar Oct 01 '24 20:10 BrayanDSO

Perfect, thanks. Alright, reasonable path forward here then, doesn't look too bad

mikehardy avatar Oct 02 '24 01:10 mikehardy

Fixing this will hopefully resolve #17226

mikehardy avatar Oct 10 '24 21:10 mikehardy

Leave it to me

MorenoTropical avatar Oct 11 '24 13:10 MorenoTropical