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

Open
opened 5 years ago by Macavirus · 4 comments
Macavirus commented 5 years ago (Migrated from github.com)

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
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 5 years ago (Migrated from github.com)

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.

`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`](https://docs.racket-lang.org/pollen/raco-pollen.html?q=select*#%28part._raco_pollen_render%29). 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 5 years ago (Migrated from github.com)

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

Have you looked at using `raco pollen setup` to [preheat the cache](https://docs.racket-lang.org/pollen/Cache.html#%28part._.Preloading_and_reseting%29)?
mbutterick commented 5 years ago (Migrated from github.com)

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.

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 5 years ago (Migrated from github.com)

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.

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.
This repo is archived. You cannot comment on issues.
No Milestone
No project
No Assignees
1 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mbutterick/pollen-users#38
Loading…
There is no content yet.