NetLogo / Galapagos

NetLogo model simulation visualizer (Beak) and the netlogoweb.org website 🐢
https://netlogoweb.org/
Other
62 stars 42 forks source link

Support a way of hot-linking models to a specific NetLogo Web release version #425

Open LaCuneta opened 4 months ago

LaCuneta commented 4 months ago

Hot-linking models is advantageous for a few reasons. It allows the compiler, engine, and runtime simulation code to be cached by the web browser so pages with multiple models should load much more quickly than static HTML exports. A hot-linked model gets the latest updates to the NLW code, meaning performance enhancements or other improvements get automatically applied to the new models. In rarer cases, bug fixes can also be applied, such as the case when we found a web extension that blocked NetLogo Web from running.

But there are a few use-cases where a user would want to hot-link to a specific NetLogo Web version:

On the technical side, the static HTML export could be used to create an all-in-one NetLogo Web bundle. An export that excludes the NetLogo model code would be generated with a filename appended with the current version. It'd be easy to add to the NetLogo Web site's assets, and should respect the usual URL parameters for loading a remote model. This could be automated as part of the release process.

Fancier techniques are also possible, such as dynamically dispatching to a supplied NetLogo Web query parameter version as a fallback if the current code fails to load. We could also change how hot-linking works to require a version query parameter from the user, in order to make sure they don't encounter breaking changes. It would be up to users to change this parameter if they wanted to take advantage of newer NetLogo Web code.