typst / webapp-issues

Issue tracker for Typst's web app.
https://typst.app
13 stars 0 forks source link

Intermediate Compiler Lag #349

Open manuel5975p opened 6 months ago

manuel5975p commented 6 months ago

Description

Let's say you have a 50 page document, and at the top you have

#set text(11pt)

Now you change those 11pt to 10pt by inserting a 0 and deleting a 1.

-#set text(11pt)
+#set text(101pt)
-#set text(101pt)
+#set text(10pt)

This triggers the compiler to compile the entire document with font size 101, which might take quite long, inducing a massive lag (especially since all new pages are attached to the page as separate elements, correct me if I'm wrong) and font size 101pt will approximately x100 the page count.

Anyway, it would be nice if that would be somewhat asynchronous, and the compilation for 101pt should be terminated as soon as the trailing 1 is deleted.

Use Case

Reduces lagginess of the web app.

laurmaedje commented 6 months ago

The problem is that if we always cancel an in-progress compile once an edit comes in, we might never finish compiling when the user is typing quickly, and the preview gets stuck.