Enter-tainer / typst-preview

[DEPRECATED] Use tinymist instead
https://Enter-tainer.github.io/typst-preview/
MIT License
450 stars 21 forks source link

vanilla JS framework for frontend and refactoring work #207

Open Myriad-Dreamin opened 9 months ago

Myriad-Dreamin commented 9 months ago

We need a JS framework to deduplicate code like this:

https://github.com/Enter-tainer/typst-preview/blob/e31b29cd302262693d7c7fc6c0d2354bf3ed7f81/addons/frontend/src/typst-doc.ts#L574-L597

The JS framework should be like vanilla JS, since:

I personally pick https://github.com/vanjs-org/van with seeing benchmark. It is also the first googled item. But we can check other ones.

The refactoring plan and work needs participation of @Enter-tainer.

It is not quite urgent, and once we have a plan, we can break refactoring into parts and merge them into main branch. The each part of code refactoring should be simple, easy to review. And they should get separated into multiple version publish, so to avoid thrushing the stability of software?

Enter-tainer commented 9 months ago

For the code piece shown in the desciption I think vanjs is OK. I wonder do we need the reactive functionality of it. I guess it might be useful in presentation mode where there are multiple buttons and key bindings