hsmusic / hsmusic-wiki

The Homestuck Music Wiki — static wiki software cataloguing collaborative creation
MIT License
2 stars 6 forks source link

Replace CACHEBUST with more robust STATIC_VERSION routing #495

Closed towerofnix closed 4 months ago

towerofnix commented 4 months ago

This PR aids multiple versions (preview and release) of the website in coexisting at once by making sure they source from distinctly named root /static directories. Details:

Imports are unfortunately slightly misrepresented by the new code structure. We opted not to move any files currently under src/util, pending #82, and there's possibly room for improving apparent relative imports at that point. We're currently addressing the confusion by creating a mock src/static/shared-util folder (appropriately adjacent to src/static/js), which just has a readme explaining what's what.

This allows us to indicate new versions of the site source internals just by updating STATIC_VERSION. We're tentatively using this naming scheme:

This allows us to avoid source file collisions, have obvious updates within the naming scheme, and still benefit from cachebust in subsequent release/preview builds.

Ideally, after a release, the first commit is url-spec: STATIC_VERSION 2r1 (for example). This should make it easier to rebase preview after publishing a patch to release (not pending changes to how we merge pull requests, keep commit history, etc).