Skip to content

Remove version.json from repository #16

@hackathi

Description

@hackathi

version.json essentially is a build artifact, that has no place to be checked in with master. In essence, it is a moving target, and each and every commit must touch that file.

For releases, this is not a big deal: just generate it using make release. However, the code currently has a hard dependency on the contents of this file to generate cache invalidation additions.

In a development scenario, this logic is fundamentally flawed anyways; I want reloads on every request that the actual file has changed.

So my proposed solution would be:

  1. nuke version.json from the repository, but generate an manifest file on every build.
  2. The version of the manifest is determined by git describe --tags
  3. Stop using the version as a cache invalidation method in the url. Instead use sha1(sha1(grocy.js) + sha1(grocy.css)) as a content hash. This has the slight downside of reloading the cache if either grocy.js or grocy.css change, but is stable in scenarios where not-grocy is installed from git and upgraded between releases.
  4. Put all these things into a php file manifest.php and include that. There is absolutely no reason to use json here, this file isn't consumed by anyone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cruical life improvementThings that need to be fixed to enjoy development morehelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions