pewpewlive / ppl-utils

Utility for creating custom PewPew Live levels.
https://pewpew.live
MIT License
47 stars 4 forks source link

Embed static ressources into the ppl-utils binary. #2

Open jyaif opened 3 years ago

jyaif commented 3 years ago

The ppl-utils binary and the static files (pewpewlive-wasm.js, pewpewlive-wasm.wasm, pewpew.html) need to stay in sync. To prevent user error it would be nice if the static files were stored in the binary.

Packr seems like it would do the job: https://github.com/gobuffalo/packr [edit: Go 1.16 will support this natively! No need to use Packr]

ModEngineer commented 3 years ago

I prefer to compile my own binaries, so how would this affect me? Keeping static files externally would mean that I wouldn't have to recompile the binary all that often. This could be implemented in a way where the releases(i.e. prebuilt binaries) or a separate branch use this system without touching the main branch.

ModEngineer commented 3 years ago

As a side note in relation to my previous comment, using something like Git or GitHub Desktop allows you to sync all files automatically, thus making it easier to update the entire local clone of the repository.

jyaif commented 3 years ago

This change would impact you negatively. Note however that compiling ppl-utils should be trivial.

ModEngineer commented 3 years ago

It is trivial to compile ppl-utils, which is why I'm not necessarily in favor of this change, though I understand the convenience of it.

jyaif commented 3 years ago

I really prefer the simplicity of having a single binary. I suppose that one solution to your problem would be for ppl-utils to serve the built-in webasm files by default, but offer the possibility to override the served files. Overriding the served files could for instance be done via arguments on the command line.

ModEngineer commented 3 years ago

I understand. It's annoying for most people to have to redownload the entire repository and release each time a small update is made to the Webassembly.