Monorepo for Tangled โ€” https://tangled.org

appview/pages: rework caching mechanism #537

merged
opened by oppi.li targeting master from push-mvmrzuxwmzvs

instead of loading all templates at once and storing into a map, we now memoize the results of parse. the first call to parse will require calculation but subsequent calls will be cached.

this is simpler to reason about because the new execution model requires us to parse differently for each "base" template that is being used:

  • for timeline, it is necessary to parse with layouts/base
  • for repo-index, it is necessary to parse with layouts/base and layouts/repobase in that order

the previous approach to loading also had a latent bug: all layouts were loaded atop each other in alphabetical order (order of iteration over the filesystem), and therefore it was not possible to selectively parse and execute templates on a subset of layouts.

Signed-off-by: oppiliappan me@oppi.li

0
by oppi.li 0 comments
expand 1 commit
appview/pages: rework caching mechanism
pull request successfully merged
sign up or login to add to the discussion
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:qfpnj4og54vl56wngdriaxug/sh.tangled.repo.pull/3lxfflozpvm22