mbutterick / pollen-users

please use https://forums.matthewbutterick.com/c/typesetting/ instead
https://forums.matthewbutterick.com/c/typesetting/
52 stars 0 forks source link

Auto-generate all files when using project server? #38

Open Macavirus opened 4 years ago

Macavirus commented 4 years ago

Running the pollen dev server doesn’t seem to actually generate any files until you click on them through the menu. I would expect that this would generate all files just as raco pollen publish does. It would make sense to generate all of the files so that they can all be worked on iteratively (e.g., if pollen is just one step in a larger publishing pipeline) but maybe there are performance reasons not to do this?

For reference, I’m using:

raco pollen reset && raco pollen start
sorawee commented 4 years ago

raco pollen start probably should not generate any file. For big projects, generating files will take a lot of time, and the file that you request to render need to wait for the generations to complete first. If you wish to generate all files, use raco pollen render.

It might be possible to have a background process that generates all files when the system is idle and gives priority to requests from users, but this feature doesn't currently exist in Pollen.

oldmankit commented 4 years ago

Have you looked at using raco pollen setup to preheat the cache?

mbutterick commented 4 years ago

The Pollen project server is “lazy” in the sense that it doesn’t render anything until it needs to (because as @sorawee says, the costs are unknown). But it maintains a disk cache as you use the project server that persists between sessions. If you start the project server as you suggest:

raco pollen reset && raco pollen start

You will be erasing that disk cache (with reset) and losing that benefit.

As noted above, you can use raco pollen setup to partially populate the disk cache or raco pollen render to completely populate it. If you use raco pollen start immediately after these commands, your server session will be snappier. But if you don’t, you’re no worse off — all the same files will have to be generated and cached during the server session.

Macavirus commented 4 years ago

Thanks everyone for the pointers. I understand the unknown costs part is a good concern as there are surely some complicated builds going on! It looks like using a combination of raco pollen render and potentially running it in combination with inotify could meet my needs.