effekt-lang / effekt-website

Website of the Effekt programming language
https://effekt-lang.github.io/effekt-website
MIT License
4 stars 6 forks source link

Experiments with single-page setup to keep Effekt cache #74

Open marvinborner opened 1 month ago

marvinborner commented 1 month ago

The typical workflow of doing the language tour involves reloading the site several times. On every reload, the library/webpack/etc. caches all need to be evaluated from scratch. Running code snippets this way sometimes takes 10-30s per page.

In this PR I hook up the navigation bar links to a function that reloads the main site's content dynamically. This way, the old caches remain since the site isn't reloaded completely. In order to keep the modules working, I have to force some additional refreshes of the modules per page.

The entire implementation is quite hacky right now, probably hides some annoying bugs, and should only serve as a proof of concept. However, for me it works without notable issues and reduced the code execution time after page switching by 99+% :)